Package com.redwood.scheduler.api.soap
Class SOAP
- java.lang.Object
-
- com.redwood.scheduler.api.soap.SOAP
-
public final class SOAP extends Object
SOAP support.- Create
SOAPRequest
instances - XML escaping
- XML formatting
- Create
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROXY_NONE
Force the use of no proxy, ie.static String
VERSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SOAPRequest
createSOAPRequest()
Create a SOAP request that is not tied to a job.static SOAPRequest
createSOAPRequestFromJob()
Create a SOAP request that is tied to a job.static String
escapeXML10(String s)
Escape the string for inclusion in XML 1.0.static String
formatXML(String xml)
Format an XML documentstatic String
getVersion()
Get the version number.static SOAPRemoteJob
prepareRemoteJob(String wsdlURL)
Submit a job via SOAP on the remote serverstatic SOAPQueryJobResult
queryJob(String wsURL, Long jobId, int waitForFinal)
Query the state of a remote Job
-
-
-
Field Detail
-
VERSION
public static final String VERSION
- See Also:
- Constant Field Values
-
PROXY_NONE
public static final String PROXY_NONE
Force the use of no proxy, ie. a direct connection.- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public static String getVersion()
Get the version number.- Returns:
- the version number.
-
escapeXML10
public static String escapeXML10(String s)
Escape the string for inclusion in XML 1.0.- Parameters:
s
- the string.- Returns:
- the escaped string.
-
createSOAPRequest
public static SOAPRequest createSOAPRequest()
Create a SOAP request that is not tied to a job.- Returns:
- a SOAP request.
-
formatXML
public static String formatXML(String xml) throws TransformerException, IOException
Format an XML document- Parameters:
xml
- the input XML.- Returns:
- the formatted XML
- Throws:
TransformerException
IOException
-
createSOAPRequestFromJob
public static SOAPRequest createSOAPRequestFromJob()
Create a SOAP request that is tied to a job. Parameter HandlingTying the SOAP request to the job enables handling of job parameters:
If the parameter is present, its value is used for the following purpose:- SOAP_URL - the SOAP URL
- SOAP_Action - the SOAPAction HTTP header
- JCS_USER - Use username for authentication
- JCS_PASSWORD - Use password for authentication
- SOAP_Header_X - Set header X
If neither JCS_USER nor JCS_PASSWORD is present, no authentication is attempted.
If JCS_USER is present and JCS_PASSWORD is present, they are used for HTTP Basic authentication.
If JCS_USER is present and JCS_PASSWORD is not present, then credentials are used for HTTP Basic authentication. In this case, if JCS_USER is {virtual}:user then the user is looked up as a virtual user, otherwise it is looked up as a real user. The protocol is always SOAP, and the end point is the host name in the URL.
Note that it is the presence of the parameters that determines behavior, not the values.
- Returns:
- a SOAP request.
-
queryJob
public static SOAPQueryJobResult queryJob(String wsURL, Long jobId, int waitForFinal) throws IOException, SAXException
Query the state of a remote Job- Parameters:
wsURL
- the URL of the queryJob2 Web ServicejobId
- the id of the job to checkwaitForFinal
- how long (in seconds) to wait for the job to be in a final state- Returns:
- the result of the request
- Throws:
SAXException
IOException
SOAPFaultException
HTTPException
-
prepareRemoteJob
public static SOAPRemoteJob prepareRemoteJob(String wsdlURL)
Submit a job via SOAP on the remote server- Parameters:
wsdlURL
- the url of the submit request- Returns:
- the result of the request
-
-