com.adobe.idp.jobmanager.client
Class JobManager

java.lang.Object
  extended by com.adobe.idp.jobmanager.client.JobManagerServiceClient
      extended by com.adobe.idp.jobmanager.client.JobManager
All Implemented Interfaces:
JobManager

public class JobManager
extends com.adobe.idp.jobmanager.client.JobManagerServiceClient
implements JobManager

The JobManager class is the primary class for interacting with the Job Manager service. For example, you can use a this class when invoking a long-lived process, you get back an identifier value that is used to obtain the status of the long-lived process. To obtain the status of an long-lived process, you must use this class. For information about invoking a long-lived process, see Invoking Adobe Experience Manager forms.

See Also:
JobManager

Field Summary
 
Fields inherited from interface com.adobe.idp.jobmanager.service.JobManager
SERVICE_NAME
 
Constructor Summary
JobManager(ServiceClientFactory serviceClientFactory)
          Creates a JobManager object using the provided ServiceClientFactory object.
 
Method Summary
 void completeJob(JobId jobId, InvocationResponse response)
          Completes an existing job using the specified InvocationResponse object.
 JobId createJob(InvocationRequest request, boolean persistent)
          For internal use only.
 void disposeJob(JobId jobId)
          Dispose of the job identified by the specified job identifier, and reclaim all of its associated resources.
 void faultJob(JobId jobId, com.adobe.idp.dsc.FaultResponse faultResponse)
          Fails an existing job using the specified FaultResponse object.
 com.adobe.idp.dsc.FaultResponse getFaultResponse(JobId jobId)
          Returns a FaultResponse object of a failed job that is specified by the job identifier.
 java.util.List getJobInstances(com.adobe.idp.dsc.filter.PagingFilter aPagingFilter)
          Return a list of JobInstance in the system.
 InvocationResponse getResponse(JobId jobId)
          Returns the InvocationResponse object of a completed job identified by the specified job identifier.
 JobStatus getStatus(JobId jobId)
          Returns the current status of the job that is specified by the specified job identifier value.
 void resumeJob(JobId jobId)
          Resume a suspended job identified by the specified job identifier.
 void suspendJob(JobId jobId)
          Suspends an existing job identified by the specified job identifier.
 void terminateJob(JobId jobId)
          Terminates an existing job specified by the specified job identifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobManager

public JobManager(ServiceClientFactory serviceClientFactory)
Creates a JobManager object using the provided ServiceClientFactory object.

Parameters:
serviceClientFactory - A valid ServiceClientFactory object.
Method Detail

createJob

public JobId createJob(InvocationRequest request,
                       boolean persistent)
                throws JobManagerException
For internal use only. Do not use.

Creates a new asynchronous job using the specified InvocationRequest object.

Specified by:
createJob in interface JobManager
Parameters:
request - A valid InvocationRequest object.
persistent - A Boolean value where the value false results in the job instance not being persisted.
Returns:
A JobId object that represents the unique job identifier of the request.
Throws:
JobManagerException - if an error occurs during this request.

getStatus

public JobStatus getStatus(JobId jobId)
                    throws JobManagerException
Returns the current status of the job that is specified by the specified job identifier value.

Specified by:
getStatus in interface JobManager
Parameters:
A - JobId object that represents the job identifier value.
Returns:
A JobStatus object that corresponds to the job identifier value.
Throws:
JobNotFoundException - if the job specified by specified job identifier value does not exist.
JobManagerException - if an error occurs during this request.

getResponse

public InvocationResponse getResponse(JobId jobId)
                               throws JobManagerException
Returns the InvocationResponse object of a completed job identified by the specified job identifier.

Specified by:
getResponse in interface JobManager
Parameters:
A - JobId that represents the completed job.
Returns:
An InvocationResponse object that corresponds to the request.
Throws:
JobNotFoundException - if the job specified by job identifier does not exist.
JobManagerException - if an error occurs during this request.

getFaultResponse

public com.adobe.idp.dsc.FaultResponse getFaultResponse(JobId jobId)
                                                 throws JobManagerException
Returns a FaultResponse object of a failed job that is specified by the job identifier.

Specified by:
getFaultResponse in interface JobManager
Parameters:
jobId - A JobId that specifies the identifer of the failed job.
Returns:
A FaultResponse object of a failed job.
Throws:
JobManagerException - if an error occurs during this request.

faultJob

public void faultJob(JobId jobId,
                     com.adobe.idp.dsc.FaultResponse faultResponse)
              throws JobManagerException
Fails an existing job using the specified FaultResponse object.

Specified by:
faultJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the identifer of the failed job.
faultResponse - A FaultResponse object of a failed job.
Throws:
JobManagerException - if an error occurs during this request.

completeJob

public void completeJob(JobId jobId,
                        InvocationResponse response)
                 throws JobManagerException
Completes an existing job using the specified InvocationResponse object.

Specified by:
completeJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the job to complete.
response - A InvocationResponse object.
Throws:
JobManagerException - if an error occurs during this request.

terminateJob

public void terminateJob(JobId jobId)
                  throws JobManagerException
Terminates an existing job specified by the specified job identifier.

Specified by:
terminateJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the job to terminate.
Throws:
JobManagerException - if an error occurs during this request.

suspendJob

public void suspendJob(JobId jobId)
                throws JobManagerException
Suspends an existing job identified by the specified job identifier.

Specified by:
suspendJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the job to suspend.
Throws:
JobManagerException - if an error occurs during this request.

resumeJob

public void resumeJob(JobId jobId)
               throws JobManagerException
Resume a suspended job identified by the specified job identifier.

Specified by:
resumeJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the job to resume
Throws:
JobManagerException - if an error occurs during this request.

disposeJob

public void disposeJob(JobId jobId)
                throws JobManagerException
Dispose of the job identified by the specified job identifier, and reclaim all of its associated resources.

Specified by:
disposeJob in interface JobManager
Parameters:
jobId - A JobId object that specifies the job to dispose
Throws:
JobManagerException - if an error occurs during this request.

getJobInstances

public java.util.List getJobInstances(com.adobe.idp.dsc.filter.PagingFilter aPagingFilter)
                               throws JobManagerException
Return a list of JobInstance in the system.

Specified by:
getJobInstances in interface JobManager
Parameters:
aPagingFilter - a result set filter which defines the start offset, the max size, and the sorted order of the return list.
Throws:
JobManagerException - if an error occurs during this request.
See Also:
JobInstance