Package com.redwood.scheduler.api.model
Interface JobLock
- 
- All Superinterfaces:
- ApplicationObject,- BusinessKeyObject,- JobLockComp,- NamedRootObject,- NamedRootObjectComp,- PartitionableObject,- PartitionableObjectComp,- Readable,- Root,- SchedulerEntity,- SchedulerEntityComp,- UniqueNamedApplicationObject
 
 public interface JobLock extends JobLockComp, UniqueNamedApplicationObject, Readable Locks define which jobs can and cannot run together To prevent jobs running concurrently - for example, when two or more jobs need access to the same system resource, such as a tape unit, you can define job locks. A job requests a job lock before the job is able to start; that is, before the job status can change from QUEUED to RUNNING. The job status becomes LOCKWAIT when a lock is already obtained by another job that has the status RUNNING, WAITING or CONSOLE, and the requesting job must wait. The status of the requesting job changes to RUNNING when the other job releases the lock and the requesting job gets the lock. Multiple locks can be defined for a script. Multiple locks can be used to help define which jobs can and cannot run together. For example, you have 3 jobs. Job 1 runs at 02:00. Job 2 and 3 must wait for incoming files and the completion of Job 1. You can define multiple locks on Jobs 2 and 3 so that they run only when the two conditions are met.
- 
- 
Field SummaryFields Modifier and Type Field Description static LongALLValue that implies that the job requires an exclusive run.static StringOBJECT_TYPEString that will be returned fromSchedulerEntity.getObjectType()for "JobLock" objects.static StringSEC_PRIV_CONTROLThis privilege can be granted at a group level.static StringSEC_PRIV_CREATEThis privilege can be granted at a group level.static StringSEC_PRIV_DELETEThis privilege can be granted at a group level.static StringSEC_PRIV_EDITThis privilege can be granted at a group level.static StringSEC_PRIV_VIEWThis privilege can be granted at a group level.static StringSEC_RANK_ALLThis rank is made of the following privileges: create , view , edit , control , deletestatic StringSEC_RANK_CREATEThis rank is made of the following privileges: createstatic StringSEC_RANK_DELETEThis rank is made of the following privileges: create , view , delete , controlstatic StringSEC_RANK_EDITThis rank is made of the following privileges: create , view , edit , controlstatic StringSEC_RANK_LOCKADMINISTRATORThis rank is made of the following privileges: view , controlstatic StringSEC_RANK_NONEThis rank has no privileges assigned to it.static StringSEC_RANK_VIEWThis rank is made of the following privileges: viewstatic QueryObjectType<JobLock>TYPEType that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...).static LongUNLIMITEDValue for JobLock.MaxCount that implies that only jobs requiring JobLock.All will run exclusively.- 
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntityACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description RequiredPermissioncheckControlPrivilege()Check whether or not the control action can be performed on this object.RequiredPermissioncheckCreatePrivilege()Check whether or not the create action can be performed on this object.RequiredPermissioncheckDeletePrivilege()Check whether or not the delete action can be performed on this object.RequiredPermissioncheckEditPrivilege()Check whether or not the edit action can be performed on this object.RequiredPermissioncheckViewPrivilege()Check whether or not the view action can be performed on this object.JobChainCallJobLockcreateJobChainCallJobLock(JobChainCall newJobChainCall)Create a newJobChainCallJobLocklinked to this object.JobDefinitionJobLockcreateJobDefinitionJobLock(JobDefinition newJobDefinition)Create a newJobDefinitionJobLocklinked to this object.JobJobLockcreateJobJobLock(Job newJob)Create a newJobJobLocklinked to this object.LonggetDeprecated1()Get the value for Deprecated1.LonggetDeprecated2()Get the value for Deprecated2.JobgetHeldByJob()Get the value for HeldByJob.JobChainCallJobLockgetJobChainCallJobLockByJobChainCall(JobChainCall jobChainCall)Get the JobChainCallJobLock by JobChainCallJobLock.RWIterable<JobChainCallJobLock>getJobChainCallJobLocks()Get anRWIterableover an ordered collection ofJobChainCallJobLocks.JobDefinitionJobLockgetJobDefinitionJobLockByJobDefinition(JobDefinition jobDefinition)Get the JobDefinitionJobLock by JobDefinitionJobLock.RWIterable<JobDefinitionJobLock>getJobDefinitionJobLocks()Get anRWIterableover an ordered collection ofJobDefinitionJobLocks.RWIterable<JobJobLock>getJobJobLocks()Get anRWIterableover an ordered collection ofJobJobLocks.LockTypegetLockType()Get the value for LockType.LonggetMaxCount()Get the value for MaxCount.LonggetTotalInUseCount()Get the value for TotalInUseCount.voidhold()Hold the lock.booleanisHeld()Get the value for Held.booleanisHeldByNotVisibleJob()Get the value for HeldByNotVisibleJob.voidrelease()Release the lock, such that can continue to run.voidsetHeld(boolean newHeld)Set the value for Held.voidsetHeldByJob(Job newHeldByJob)Set the value for HeldByJob.voidsetLockType(LockType newLockType)Set the value for LockType.voidsetMaxCount(Long newMaxCount)Set the value for MaxCount.- 
Methods inherited from interface com.redwood.scheduler.api.model.ApplicationObjectgetParentApplication, setParentApplication
 - 
Methods inherited from interface com.redwood.scheduler.api.model.BusinessKeyObjectgetBusinessKey
 - 
Methods inherited from interface com.redwood.scheduler.api.model.NamedRootObjectcreateObjectReference, getComment, getDescription, getLinkedObjectReferenceByLinkedObject, getLinkedObjectReferenceByName, getLinkedObjectReferences, getName, getSearchName, getSourceObjectReferences, isHidden, setComment, setDescription, setName
 - 
Methods inherited from interface com.redwood.scheduler.api.model.PartitionableObjectcreateObjectTag, getEditablePartitions, getObjectTagByObjectTagDefinition, getObjectTags, getPartition, setPartition
 - 
Methods inherited from interface com.redwood.scheduler.api.model.RootgetCreationTime, getLastModificationTime, getLastModifierSubject
 - 
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntitycanPerform, createSubjectObjectPrivilegeGrant, deleteObject, getAuditTrail, getAuditTrailSize, getBehavior, getEffectiveBehavior, getErrorNameEN, getErrorNameKey, getLLPVersion, getLOV, getLOVSupport, getObjectType, getParentSchedulerEntities, getRuntime, getSubjectObjectPrivilegeGrantBySubject, getSubjectObjectPrivilegeGrants, getUniqueId, getUrl, getUrl, isCreated, isDeletable, isDeleted, isModifiable, isModified, isSelectVersioned, processRelatedObjects, processRelatedObjects, processRelatedObjects, refreshObject, resetObject, resetObject, resetValuesToDefault, selectForRead
 
- 
 
- 
- 
- 
Field Detail- 
OBJECT_TYPEstatic final String OBJECT_TYPE String that will be returned fromSchedulerEntity.getObjectType()for "JobLock" objects.- See Also:
- Constant Field Values
 
 - 
TYPEstatic final QueryObjectType<JobLock> TYPE Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...).
 - 
ALLstatic final Long ALL Value that implies that the job requires an exclusive run.
 - 
UNLIMITEDstatic final Long UNLIMITED Value for JobLock.MaxCount that implies that only jobs requiring JobLock.All will run exclusively.
 - 
SEC_PRIV_CREATEstatic final String SEC_PRIV_CREATE This privilege can be granted at a group level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_VIEWstatic final String SEC_PRIV_VIEW This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_EDITstatic final String SEC_PRIV_EDIT This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_CONTROLstatic final String SEC_PRIV_CONTROL This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_DELETEstatic final String SEC_PRIV_DELETE This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_RANK_NONEstatic final String SEC_RANK_NONE This rank has no privileges assigned to it.- See Also:
- Constant Field Values
 
 - 
SEC_RANK_CREATEstatic final String SEC_RANK_CREATE This rank is made of the following privileges: create- See Also:
- Constant Field Values
 
 - 
SEC_RANK_VIEWstatic final String SEC_RANK_VIEW This rank is made of the following privileges: view- See Also:
- Constant Field Values
 
 - 
SEC_RANK_LOCKADMINISTRATORstatic final String SEC_RANK_LOCKADMINISTRATOR This rank is made of the following privileges: view , control- See Also:
- Constant Field Values
 
 - 
SEC_RANK_EDITstatic final String SEC_RANK_EDIT This rank is made of the following privileges: create , view , edit , control- See Also:
- Constant Field Values
 
 - 
SEC_RANK_DELETEstatic final String SEC_RANK_DELETE This rank is made of the following privileges: create , view , delete , control- See Also:
- Constant Field Values
 
 - 
SEC_RANK_ALLstatic final String SEC_RANK_ALL This rank is made of the following privileges: create , view , edit , control , delete- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
isHeldByNotVisibleJobboolean isHeldByNotVisibleJob() Get the value for HeldByNotVisibleJob. ( True if the lock is held by a Job that the user is not allowed to see, false otherwise. )- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getLockTypeLockType getLockType() Get the value for LockType. (The type of lock) This value is mandatory, and therefore will not benullif this object has been retrieved from the database.- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
isHeldboolean isHeld() Get the value for Held. (Blocks all jobs from running if set to true)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getMaxCountLong getMaxCount() Get the value for MaxCount. (The maximum number of jobs that can run with this lock.) This value is mandatory, and therefore will not benullif this object has been retrieved from the database.- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getDeprecated1Long getDeprecated1() Get the value for Deprecated1. (Deprecated attribute: TotalInUseCount) This value is mandatory, and therefore will not benullif this object has been retrieved from the database.- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getDeprecated2Long getDeprecated2() Get the value for Deprecated2. (Deprecated attribute: HeldByJob)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getTotalInUseCountLong getTotalInUseCount() Get the value for TotalInUseCount. (The total consumed count for the running jobs on this lock.)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getHeldByJobJob getHeldByJob() Get the value for HeldByJob. (The job holding a lock.)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setLockTypevoid setLockType(LockType newLockType) Set the value for LockType. (The type of lock) This value is mandatory.- Parameters:
- newLockType- the new value for LockType. If this is- null, then the object cannot be persisted.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setHeldvoid setHeld(boolean newHeld) Set the value for Held. (Blocks all jobs from running if set to true)- Parameters:
- newHeld- the new value for Held.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setMaxCountvoid setMaxCount(Long newMaxCount) Set the value for MaxCount. (The maximum number of jobs that can run with this lock.) This value is mandatory.- Parameters:
- newMaxCount- the new value for MaxCount. If this is- null, then the object cannot be persisted.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setHeldByJobvoid setHeldByJob(Job newHeldByJob) Set the value for HeldByJob. (The job holding a lock.) This value is optional.- Parameters:
- newHeldByJob- the new value for HeldByJob.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
holdvoid hold() Hold the lock. Jobs will remain in LockWait while the lock is held.
 - 
releasevoid release() Release the lock, such that can continue to run.
 - 
getJobDefinitionJobLocksRWIterable<JobDefinitionJobLock> getJobDefinitionJobLocks() Get anRWIterableover an ordered collection ofJobDefinitionJobLocks. If the collection is empty, an empty iterator will be returned, that is, this method will never returnnull. The lock required by a job definition.- Specified by:
- getJobDefinitionJobLocksin interface- JobLockComp
- Returns:
- An RWIterableover an ordered collection ofJobDefinitionJobLockobjects .
 
 - 
createJobDefinitionJobLockJobDefinitionJobLock createJobDefinitionJobLock(JobDefinition newJobDefinition) Create a newJobDefinitionJobLocklinked to this object.- Parameters:
- newJobDefinition- The other parent of the- JobDefinitionJobLockJobDefinitionassociation.
- Returns:
- a new JobDefinitionJobLock.
 
 - 
getJobDefinitionJobLockByJobDefinitionJobDefinitionJobLock getJobDefinitionJobLockByJobDefinition(JobDefinition jobDefinition) Get the JobDefinitionJobLock by JobDefinitionJobLock.- Parameters:
- jobDefinition-
- Returns:
- the JobDefinitionJobLock, or nullif it could not be found
 
 - 
getJobJobLocksRWIterable<JobJobLock> getJobJobLocks() Get anRWIterableover an ordered collection ofJobJobLocks. If the collection is empty, an empty iterator will be returned, that is, this method will never returnnull. The lock definitions for locks required by a job.- Specified by:
- getJobJobLocksin interface- JobLockComp
- Returns:
- An RWIterableover an ordered collection ofJobJobLockobjects .
 
 - 
createJobJobLockJobJobLock createJobJobLock(Job newJob) Create a newJobJobLocklinked to this object.- Parameters:
- newJob- The other parent of the- JobJobLockJobassociation.
- Returns:
- a new JobJobLock.
 
 - 
getJobChainCallJobLocksRWIterable<JobChainCallJobLock> getJobChainCallJobLocks() Get anRWIterableover an ordered collection ofJobChainCallJobLocks. If the collection is empty, an empty iterator will be returned, that is, this method will never returnnull. The lock required by a job chain call.- Specified by:
- getJobChainCallJobLocksin interface- JobLockComp
- Returns:
- An RWIterableover an ordered collection ofJobChainCallJobLockobjects .
 
 - 
createJobChainCallJobLockJobChainCallJobLock createJobChainCallJobLock(JobChainCall newJobChainCall) Create a newJobChainCallJobLocklinked to this object.- Parameters:
- newJobChainCall- The other parent of the- JobChainCallJobLockJobChainCallassociation.
- Returns:
- a new JobChainCallJobLock.
 
 - 
getJobChainCallJobLockByJobChainCallJobChainCallJobLock getJobChainCallJobLockByJobChainCall(JobChainCall jobChainCall) Get the JobChainCallJobLock by JobChainCallJobLock.- Parameters:
- jobChainCall-
- Returns:
- the JobChainCallJobLock, or nullif it could not be found
 
 - 
checkCreatePrivilegeRequiredPermission checkCreatePrivilege() Check whether or not the create action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkViewPrivilegeRequiredPermission checkViewPrivilege() Check whether or not the view action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkEditPrivilegeRequiredPermission checkEditPrivilege() Check whether or not the edit action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkControlPrivilegeRequiredPermission checkControlPrivilege() Check whether or not the control action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkDeletePrivilegeRequiredPermission checkDeletePrivilege() Check whether or not the delete action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 
- 
 
-