Job
-
public abstract class
Job
This is a Job.
Fields
Methods
appendJob
-
protected ScheduledJob
appendJob
(Class<? extends Job> clazz)
appendJob
-
protected ScheduledJob
appendJob
(EntityInterface entity, Class<? extends Job> clazz)
getContainer
-
protected TransactionContainer
getContainer
()
getEntity
-
public EntityInterface
getEntity
()
getEntityById
-
protected EntityInterface
getEntityById
(EntityID id)
getEntityByName
-
protected EntityInterface
getEntityByName
(String name)
getFailureSeverity
-
protected final JobFailureSeverity
getFailureSeverity
()
getJob
-
public static Job
getJob
(String job, JobFailureSeverity severiy, EntityInterface entity, Transaction<? extends TransactionContainer> transaction) Create a Job object with the given parameters.
This static method is used by other classes to create Job objects, instead of the private constructor.
Returns: The generated Job object.
getTransaction
-
public Transaction<? extends TransactionContainer>
getTransaction
()
getTransactionStage
-
public TransactionStage
getTransactionStage
()
init
-
public final Job
init
(JobFailureSeverity severity, EntityInterface entity, Transaction<? extends TransactionContainer> transaction)
isSubType
-
protected final boolean
isSubType
(EntityInterface child, EntityInterface targetParent) Check if an entity (‘child’) is a direct or indirect child of another entity (‘targetParent’).
This assumes that the parent has either an id (persistent or temporary) or a name.
If the targetParent is not in the set of parents of the child, this method iterates through the direct parents of the child.
If both entities are part of this transaction, they are resolved within this transaction. Otherwise they are fetched from the database backend or the whole evaluation takes place in the backend (if both have persistent ids and are not part of this transaction).
If both entities have the same id or name, the return value is true without any further checks.
Parameters: - child – the child entity
- targetParent – the parent entity
Throws: - Message –
Returns: true iff targetParent is a direct or indirect parent of the child or when the ids or names match.
isValidSubTypeNoCache
loadDataTypeSpecificJobs
-
public List<Job>
loadDataTypeSpecificJobs
(EntityInterface entity, Transaction<? extends TransactionContainer> transaction)
loadJobs
-
public List<Job>
loadJobs
(EntityInterface entity, Transaction<? extends TransactionContainer> transaction)
loadPermanentContainerJobs
-
public static List<Job>
loadPermanentContainerJobs
(Transaction<?> transaction) Return those matching jobs which are annotated with the “loadAlways” attribute.
Returns: A list with the jobs.
loadStandardJobs
-
public List<Job>
loadStandardJobs
(EntityInterface entity, Transaction<? extends TransactionContainer> transaction)
resolve
-
protected EntityInterface
resolve
(EntityInterface entity) Resolve an entity (which might only be specified by it’s name or id) to its full representation (with properties, parents and all).
Parameters: - entity – the entity to be resolved.
Throws: - EntityWasNotUniqueException – if the resolution failed due to ambuiguity of the name.
Returns: the resolved entity.
retrieveParentsOfValidEntity
-
protected EntityInterface
retrieveParentsOfValidEntity
(EntityInterface entity)
retrieveValidEntity
-
protected final EntityInterface
retrieveValidEntity
(EntityID id)
retrieveValidSparseEntityById
-
protected final EntityInterface
retrieveValidSparseEntityById
(EntityID id, String version)
retrieveValidSparseEntityByName
-
protected final EntityInterface
retrieveValidSparseEntityByName
(String name)
runJobFromSchedule
-
protected void
runJobFromSchedule
(EntityInterface entity, Class<? extends Job> jobclass)
setFailureSeverity
-
protected final void
setFailureSeverity
(JobFailureSeverity severiy)