Job Class

Definition

Represents a command running in background. A job object can internally contain many child job objects.

public abstract class Job : IDisposable
Inheritance
Job
Derived
Implements

Constructors

Job()

Default constructor

Job(String)

Creates an instance of this class

Job(String, String)

Creates an instance of this class

Job(String, String, IList<Job>)

Creates an instance of this class

Job(String, String, Guid)

Creates an instance of this class

Job(String, String, JobIdentifier)

Creates an instance of this class

Properties

ChildJobs

List of child jobs contained within this job

Command

Command Invoked by this Job

Debug

Gets or sets the debug buffer. Debug output of Job is written to this buffer. Cannot set to a null value.

Error

Gets or sets the error buffer. Errors of job are written into this buffer.

Finished

Wait Handle which is signaled when job is finished. This is set when state of the job is set to Completed, Stopped or Failied.

HasMoreData

Indicates that more data is available in this result object for reading.

Id

Short identifier for this result which will be recycled and used within a process

Information
InstanceId

unique identifier for this job

JobStateInfo

Status of the command execution.

Location

Indicates a location where this job is running

Name

Name for identifying this job object

Output

Gets or sets the output buffer. Output of job is written into this buffer.

Progress

Gets or sets the progress buffer. Progress of job is written into this buffer.

PSBeginTime

Time job was started.

PSEndTime

Time job stopped.

PSJobTypeName

Job type name.

StatusMessage

Success status of the command execution.

Verbose

Gets or sets the verbose buffer. Verbose output of job is written to this stream.

Warning

Gets or sets the warning buffer. Warnings of job are written to this buffer

Methods

AutoGenerateJobName()

Automatically generate a job name if the user does not supply one

Dispose()

Dispose all managed resources. This will suppress finalizer on the object from getting called by calling System.GC.SuppressFinalize(this).

Dispose(Boolean)

Release all the resources.

DoLoadJobStreams()

This method is introduce for delaying the loading of streams for a particular job.

DoUnloadJobStreams()

Unloads job streams information. Enables jobs to clear stream information from memory

LoadJobStreams()

Load the required job streams

SetJobState(JobState)

Sets Job State.

StopJob()

Stop this job object. If job contains child job, this should stop child job objects also.

UnloadJobStreams()

Unload the required job streams

Events

StateChanged

Event raised when state of the job changes