Interface ConstraintContext
-
- All Superinterfaces:
Serializable
public interface ConstraintContext extends Serializable
The context in which constraints are executed.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNO_OBJECTS_FOUNDstatic StringTOO_MANY_OBJECTS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyRouting(boolean isQueueInherited)Do the constraints allow routing to be used in a chain for this entity?booleanconstraintsSatisfied()Are all constraints satisfied? Only valid after a call to execute().voidexecute()Execute all constraints.ConstraintEntitygetConstraintEntity()Get a representation of the entity to use for constraint evaluation.List<ConstraintViolatedException>getConstraintViolations()Get a list of constraint violations.StringgetDisplayValue(String parameterName, Object value)Calculate the display value for the given internal value.StringgetInternalValue(String parameterName, String query)Find the internal value for the given search string for a display value.StringgetIsolationGroup()Get the isolation group for this constraint context.LOVCollectiongetLOV(Locale locale, String parameterName, String query, int startAt, int fetchSize)Get an LOV for the specified parameter.LOVSupportgetLOVSupport(String parameterName)Does this constraint provide LOV support for the specified parameter?SchedulerSessiongetSchedulerSession()Get a scheduler session.ConstraintViolatedExceptiongetViolationException()Get the first constraint violation.booleanisAllowedForcedProcessServer(ProcessServer processServer)Do the constraints allow this process server to be used for this entity?booleanisAllowedQueue(Queue queue)Do the constraints allow this queue to be used for this entity?voidupdate(String parameterName, String changedParameterName)Notifies constraint about parameter changes.
-
-
-
Field Detail
-
NO_OBJECTS_FOUND
static final String NO_OBJECTS_FOUND
- See Also:
- Constant Field Values
-
TOO_MANY_OBJECTS
static final String TOO_MANY_OBJECTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
constraintsSatisfied
boolean constraintsSatisfied()
Are all constraints satisfied? Only valid after a call to execute().- Returns:
- true if all constraints are satisfied, false otherwise.
-
getConstraintViolations
List<ConstraintViolatedException> getConstraintViolations()
Get a list of constraint violations. Will return an empty list if there are no violations. Only valid after a call to execute().- Returns:
- a list of
ConstraintViolatedExceptionobjects representing violations or an empty list for no violations.
-
getViolationException
ConstraintViolatedException getViolationException()
Get the first constraint violation. Only valid after a call to execute().- Returns:
- the first violation, or null if there are no violations.
-
getLOV
LOVCollection getLOV(Locale locale, String parameterName, String query, int startAt, int fetchSize)
Get an LOV for the specified parameter.- Parameters:
locale- the locale for the LOV.parameterName- the name of the parameter for which an LOV is required.query- a user specified query.startAt- the starting position for the query results.fetchSize- the fetch size for the query results.- Returns:
- an
LOVCollectionrepresenting the results.
-
getLOVSupport
LOVSupport getLOVSupport(String parameterName)
Does this constraint provide LOV support for the specified parameter?- Parameters:
parameterName- the name of the parameter for which an LOV is required.- Returns:
- an
LOVSupportobject representing the level of LOV support provided by this constraint for the specified parameter.
-
execute
void execute()
Execute all constraints. The results of the execution are available in various forms fromconstraintsSatisfied(),getViolationException(), orgetConstraintViolations().
-
getConstraintEntity
ConstraintEntity getConstraintEntity()
Get a representation of the entity to use for constraint evaluation. This representation may wrap:- a real
Job - a
JobChainCallif the constraint is being evaluated in the job chain editor - a row in a
Tableif the constraint is being evaluated in the context of a table
- Returns:
- a representation of the entity to use for constraint evaluation.
- a real
-
getSchedulerSession
SchedulerSession getSchedulerSession()
Get a scheduler session. The locale of this session will be set to the locale last passed togetLOV(Locale, String, String, int, int).- Returns:
- the scheduler session.
-
isAllowedQueue
boolean isAllowedQueue(Queue queue)
Do the constraints allow this queue to be used for this entity?- Parameters:
queue- the queue in question- Returns:
- true if the queue is allowed, false otherwise.
-
isAllowedForcedProcessServer
boolean isAllowedForcedProcessServer(ProcessServer processServer)
Do the constraints allow this process server to be used for this entity?- Parameters:
processServer- the process server in question- Returns:
- true if the process server is allowed, false otherwise.
-
applyRouting
void applyRouting(boolean isQueueInherited)
Do the constraints allow routing to be used in a chain for this entity?- Parameters:
isQueueInherited- is the queue set by the user or inherited from it's parent
-
getIsolationGroup
String getIsolationGroup()
Get the isolation group for this constraint context.- Returns:
- the isolation group of the session for this constraint context.
-
getDisplayValue
String getDisplayValue(String parameterName, Object value)
Calculate the display value for the given internal value.- Parameters:
parameterName-value-- Returns:
- String
-
getInternalValue
String getInternalValue(String parameterName, String query)
Find the internal value for the given search string for a display value. Only returns the internal value if there is only one match. It does not need to be an exact match. If there are no matches, the constant string NO_OBJECTS_FOUND is returned. If there is more than one match, the constant string TOO_MANY_OBJECTS is returned.- Parameters:
parameterName- for which the internal value is requestedquery- is a search string for the display value- Returns:
- the internal value of the object that matches the query, or a fixed string if the query does not match a single object
-
-