Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8463a028ab129288748b50a392f62cbc8984fa1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*******************************************************************************
 * Copyright (c) 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.jst.ws.internal.consumption.ui.widgets.object;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.wsdl.validation.internal.IValidationMessage;
import org.eclipse.wst.wsdl.validation.internal.IValidationReport;
import org.eclipse.wst.wsdl.validation.internal.ui.eclipse.WSDLValidator;



public class ValidateWSDLJob extends Job {
	
	final public static String VALIDATE_WSDL_JOB_FAMILY = "ValidateWSDLJobJamily";
	
	private String wsdlURI_ = null;
	private IValidationMessage[] validationMessages_ = null;

	public ValidateWSDLJob(String wsdlURI) {
		super("ValidateWSDLJob");
		wsdlURI_ = wsdlURI;
	}

	protected IStatus run(IProgressMonitor monitor) {
		WSDLValidator wsdlValidator = WSDLValidator.getInstance();
	    IValidationReport valReport = wsdlValidator.validate(wsdlURI_);
	    validationMessages_ = valReport.getValidationMessages();
		return Status.OK_STATUS;
	}
	
	public boolean belongsTo(Object family)
	{
		return family == VALIDATE_WSDL_JOB_FAMILY;
	}
	
	public IValidationMessage[] getValidationMessages() {
		return validationMessages_;
	}

	public String getWsdlURI() {
		return wsdlURI_;
	}
}

Back to the top