LEADTOOLS Cloud (Leadtools.Services.Cloud.ServiceContracts assembly)
LEAD Technologies, Inc

AbortJob Method

Example 





A Leadtools.Services.Cloud.DataContracts.AbortJobRequest class containing information for the job to be aborted.
Aborts a job in the cloud database.
Syntax
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
AbortJobResponse AbortJob( 
   AbortJobRequest request
)
'Declaration
 
<OperationContractAttribute()>
<FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=False)>
Function AbortJob( _
   ByVal request As AbortJobRequest _
) As AbortJobResponse
'Usage
 
Dim instance As IJobService
Dim request As AbortJobRequest
Dim value As AbortJobResponse
 
value = instance.AbortJob(request)
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
AbortJobResponse AbortJob( 
   AbortJobRequest request
)
OperationContractAttribute()
FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=)
function Leadtools.Services.Cloud.ServiceContracts.IJobService.AbortJob( 
   request 
)
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
AbortJobResponse^ AbortJob( 
   AbortJobRequest^ request
) 

Parameters

request
A Leadtools.Services.Cloud.DataContracts.AbortJobRequest class containing information for the job to be aborted.

Return Value

A Leadtools.Services.Cloud.DataContracts.AbortJobResponse class that indicates if the job was successfully marked for aborting.
Remarks

Use this method to mark a job for aborting. When calling the method, the cMustAbort column for the specified job is set to 1. The worker assembly is notified to abort the job via calls to the UpdatePercentage method. The job is not actually aborted (job status is set to JobStatus.Aborted) until the worker processing this job calls the SetAbortedStatus method from the worker assembly.

For more information, refer to Creating Cloud Worker Assemblies.

Example
 
Public Sub AbortJob(ByVal jobID As String)
   Using jobServiceClient As JobServiceClient = New JobServiceClient()
      Dim abortJobRequest As AbortJobRequest = New AbortJobRequest()
      abortJobRequest.ID = jobID
      abortJobRequest.Reason = "Duplicate Job"
      Dim abortJobResponse As AbortJobResponse = jobServiceClient.AbortJob(abortJobRequest)
      If abortJobResponse.IsAborted Then
         Console.WriteLine("The job was successfully aborted.")
      Else
         Console.WriteLine("The job was not aborted.")
      End If
   End Using
End Sub
public void AbortJob(string jobID)
{
   using (JobServiceClient jobServiceClient = new JobServiceClient())
   {
      AbortJobRequest abortJobRequest = new AbortJobRequest();
      abortJobRequest.ID = jobID;
      abortJobRequest.Reason = "Duplicate Job";
      AbortJobResponse abortJobResponse = jobServiceClient.AbortJob(abortJobRequest);
      if (abortJobResponse.IsAborted)
         Console.WriteLine("The job was successfully aborted.");
      else
         Console.WriteLine("The job was not aborted.");
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IJobService Interface
IJobService Members
Programming with Leadtools Cloud SDK
Understanding The LEADTOOLS Cloud Database
Creating Cloud Worker Assemblies
SetAbortedStatus Method
UpdatePercentage Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.