public class Job extends Object
Two Job
objects are equal if their IDs are equal. Therefore two
objects with the same ID, but different job status (e.g. one older and one
up-to-date object) are still equal!
Constructor and Description |
---|
Job(String jobId,
String name,
JobStatus status,
String owner)
This constructor creates a
Job in its simplest form. |
Job(String jobId,
String name,
JobStatus status,
String owner,
Optional<String> jesClass,
OptionalInt resultCode,
Optional<String> abendCode,
JobFlag... flags)
This constructor creates a
Job allowing to set any field. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
JobOutput |
createOutput(int index,
String outputName,
int length,
Optional<String> step,
Optional<String> procedureStep,
Optional<String> outputClass)
Creates a
JobOutput and adds it to the list of job outputs. |
boolean |
equals(Object o) |
Optional<String> |
getAbendCode()
The jobs abend code
This field can be present for
JobStatus.OUTPUT (and
JobStatus.ALL ) only. |
Set<JobFlag> |
getFlags()
The jobs flags
|
String |
getId()
The jobs ID, must not be empty
|
Optional<String> |
getJesClass()
The jobs JES spool class
|
String |
getName()
The jobs name
Depending on the objects creating code this might be a filter value,
eventually containing
JesClient.FILTER_WILDCARD . |
Optional<JobOutput> |
getOutput(String name)
Returns the job output details referenced by
name or
Optional.empty() if no such job output exists. |
List<JobOutput> |
getOutputs()
List of job output details
Can be filled by
createOutput(int, String, int, Optional, Optional, Optional) and
must be empty for status other than JobStatus.OUTPUT (and
JobStatus.ALL ). |
String |
getOwner()
The jobs owner
Depending on the objects creating code this might be a filter value,
eventually containing
JesClient.FILTER_WILDCARD . |
OptionalInt |
getResultCode()
The jobs result code
This field can be present for
JobStatus.OUTPUT (and
JobStatus.ALL ) only. |
JobStatus |
getStatus()
The jobs status
|
int |
hashCode() |
String |
toString() |
public Job(String jobId, String name, JobStatus status, String owner)
Job
in its simplest form. String
parameters are trimmed and converted to upper case.jobId
- the jobs ID, must not be emptyname
- the jobs name or a name filter valuestatus
- the jobs status or JobStatus.ALL
owner
- the jobs owner or an owner filter valueJobFieldInconsistentException
- on inconsistent field valuepublic Job(String jobId, String name, JobStatus status, String owner, Optional<String> jesClass, OptionalInt resultCode, Optional<String> abendCode, JobFlag... flags)
Job
allowing to set any field. String
parameters are trimmed and converted to upper case.jobId
- the jobs ID, must not be emptyname
- the jobs name or a name filter valuestatus
- the jobs status or JobStatus.ALL
owner
- the jobs owner or an owner filter valuejesClass
- the jobs JES classresultCode
- the jobs result code, when held (finished)abendCode
- the jobs abend code, when held (finished)flags
- the jobs flagsJobFieldInconsistentException
- on inconsistent field valuepublic JobOutput createOutput(int index, String outputName, int length, Optional<String> step, Optional<String> procedureStep, Optional<String> outputClass)
JobOutput
and adds it to the list of job outputs. Creating
of job outputs for status other than JobStatus.OUTPUT
(and
JobStatus.ALL
) is prohibited. String parameters are trimmed and
converted to upper case.index
- the job outputs index inside the jobs list of outputs
(starting at 1)outputName
- the job outputs data division namelength
- the job outputs content lengthstep
- the job outputs step nameprocedureStep
- the job outputs procedure step nameoutputClass
- the output classJobFieldInconsistentException
- on inconsistent field valuepublic Optional<JobOutput> getOutput(String name)
name
or
Optional.empty()
if no such job output exists.name
- job output name to search forname
or
Optional.empty()
if no such job output existspublic List<JobOutput> getOutputs()
Can be filled by
createOutput(int, String, int, Optional, Optional, Optional)
and
must be empty for status other than JobStatus.OUTPUT
(and
JobStatus.ALL
).
public String getId()
public String getName()
Depending on the objects creating code this might be a filter value,
eventually containing JesClient.FILTER_WILDCARD
.
public JobStatus getStatus()
public String getOwner()
Depending on the objects creating code this might be a filter value,
eventually containing JesClient.FILTER_WILDCARD
.
public OptionalInt getResultCode()
This field can be present for JobStatus.OUTPUT
(and
JobStatus.ALL
) only. It cannot be present as long as
abendCode
is present.
public Optional<String> getAbendCode()
This field can be present for JobStatus.OUTPUT
(and
JobStatus.ALL
) only. It cannot be present as long as
resultCode
is present.
protected boolean canEqual(@Nullable Object other)
Copyright © 2025. All rights reserved.