416 Getting Started with Tivoli Dynamic Workload Broker Version 1.1
9.4.3 Job service
In this section we describe the job service. This service provides the following
functionality:
򐂰 Cancelling jobs
򐂰 Getting job properties
򐂰 Getting the job output
Example 9-11 contains the extract from the JobFactory.wsdl file. You can see all
of the operations defined with this Web Service.
Example 9-11 Job Web service and its operations for submitting and querying jobs
<wsdl:portType name="Job">
<wsdl:operation name="cancel">
<wsdl:input name="CancelRequest" message="jmj:CancelRequestMessage" />
<wsdl:output name="CancelResponse" message="jmj:CancelResponseMessage" />
<wsdl:fault name="OperationFailedFault" message="jmj:OperationFailedFaultMessage" />
<wsdl:fault name="InvalidArgumentsFault" message="jmj:InvalidArgumentsFaultMessage" />
<wsdl:fault name="UnknownResourceFault" message="jmj:UnknownResourceFaultMessage" />
<wsdl:fault name="IllegalStateFault" message="jmj:IllegalStateFaultMessage" />
<wsdl:fault name="ServiceUnavailableFault" message="jmj:ServiceUnavailableFaultMessage"
/>
<wsdl:fault name="UnsupportedOperationFault"
message="jmj:UnsupportedOperationFaultMessage" />
</wsdl:operation>
<wsdl:operation name="getProperties">
<wsdl:input name="GetPropertiesRequest" message="jmj:GetPropertiesRequestMessage" />
<wsdl:output name="GetPropertiesResponse" message="jmj:GetPropertiesResponseMessage" />
<wsdl:fault name="OperationFailedFault" message="jmj:OperationFailedFaultMessage" />
<wsdl:fault name="InvalidArgumentsFault" message="jmj:InvalidArgumentsFaultMessage" />
<wsdl:fault name="UnknownResourceFault" message="jmj:UnknownResourceFaultMessage" />
<wsdl:fault name="IllegalStateFault" message="jmj:IllegalStateFaultMessage" />
<wsdl:fault name="ServiceUnavailableFault" message="jmj:ServiceUnavailableFaultMessage"
/>
</wsdl:operation>
<wsdl:operation name="getExecutionLogPage">
<wsdl:input name="GetExecutionLogPageRequest"
message="jmj:GetExecutionLogPageRequestMessage" />
<wsdl:output name="GetExecutionLogPageResponse
"message="jmj:GetExecutionLogPageResponseMessage" />
<wsdl:fault name="OperationFailedFault" message="jmj:OperationFailedFaultMessage" />
<wsdl:fault name="InvalidArgumentsFault" message="jmj:InvalidArgumentsFaultMessage" />
<wsdl:fault name="UnknownResourceFault" message="jmj:UnknownResourceFaultMessage" />
<wsdl:fault name="IllegalStateFault" message="jmj:IllegalStateFaultMessage" />
Chapter 9. Interacting with Tivoli Dynamic Workload Broker using the Web services interface 417
<wsdl:fault name="ServiceUnavailableFault" message="jmj:ServiceUnavailableFaultMessage"
/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="JobFactoryService">
<wsdl:port binding="jmjf:JobFactoryBinding" name="JobFactory">
<wsdlsoap:address
location="http://localhost:9080/JobServiceWS/services/JobFactory" />
</wsdl:port>
</wsdl:service>
Canceling jobs
In this section we describe the operation for cancelling the jobs submitted to
Tivoli Dynamic Workload Broker server.
The cancel interface allows us to stop the execution of a running job or to block
the process of allocating the matching resources for a job that was not launched
yet. This operation is asynchronous: it just verifies if the job identifier exists and
then sends a cancel request to the appropriate Tivoli Dynamic Workload Broker
component.
The cancel operation must be invoked on the address contained in the Job
EndpointReferenceType (EPR) returned back from the submit operation
(submitJobFromName, submitJobFromJSDL, submitJobFromJSDLXml). The job
EPR also contains the job identifier as a reference property named "jobIdentifier"
that should set in the SOAP header when invoking this operation.
Cancel
As stated above, it is important that you invoke this operation on the address
contained in the job’s EPR. Additional parameters are not needed. When you
invoke nthe cancel operation in your application, you must invoke it on the correct
EPR instance, and you do not provide the cancel method with any argument.
This is the reason that we do not provide type definitions for the cancel operation.
There is also no response to the cancel operation. This is the reason that we do
not provide type definitions for response to the cancel operation.
Getting job properties
In this section we describe the operation for getting the properties of jobs
submitted to the Tivoli Dynamic Workload Broker server.
418 Getting Started with Tivoli Dynamic Workload Broker Version 1.1
The getProperties interface allows you to get the properties of a submitted job.
The getProperties operation must be invoked on the address in the job
EndpointReferenceType (EPR) returned back from jobSubmit. The job EPR also
contains the job identifier as reference property named “jobIdentifier” that should
be set in the SOAP header when invoking this operation.
GetProperties
As stated above, it is important for you to invoke this operation on the address
contained in the job’s EPR. Additional parameters are not needed. When you
invoke the getProperties operation in your application, you must invoke it on the
correct EPR instance, and you will not provide the getProperties method with any
argument.
This is the reason that we do not provide type definitions for the getProperites
operation.
GetPropertiesResponse
Example 9-12 contains the type definitions for the queryJobs operation.
Example 9-12 Type definitions for response to getProperties operation
<xsd:element name="getPropertiesResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:QName" minOccurs="1" maxOccurs="1" />
<xsd:element name="Alias" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="Submitter" type="xsd:string" minOccurs="0"
maxOccurs="1" />
<xsd:element name="SubmitterType" type="xsd:string" minOccurs="0"
maxOccurs="1" />
<xsd:element name="ClientNotifyEPR" type="wsa:EndpointReferenceType"
minOccurs="0" maxOccurs="1" />
<xsd:element name="JobDefinitionDocument" minOccurs="1" maxOccurs="1">
<xsd:complexType><xsd:sequence>
<xsd:element ref="jsdl:jobDefinition" minOccurs="1"
maxOccurs="1" />
</xsd:sequence></xsd:complexType>
</xsd:element>
<xsd:element name="State" type="jmt:JobStateEnumeration" minOccurs="1"
maxOccurs="1" />
<xsd:element name="LastStatusMessage" type="xsd:string" minOccurs="0"
maxOccurs="1" />
<xsd:element name="SubmittedTime" type="xsd:dateTime" minOccurs="1"
maxOccurs="1" />
<xsd:element name="StartTime" type="xsd:dateTime" minOccurs="0"
maxOccurs="1" />
<xsd:element name="EndTime" type="xsd:dateTime" minOccurs="0"
maxOccurs="1" />

Get Getting Started with Tivoli Dynamic Workload Broker Version 1.1 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.