Interface ExecutorContext
-
public interface ExecutorContextThe executor context describes what started this execution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutorOrigingetOrigin()Get the origin of the execution.SchedulerEntitygetOriginEntity(SchedulerSession session)For origins that are based on a SchdulerEntity (Extension Point, Job etc.) this method will return the Object that is associated with that execution.StringgetOriginEntityKey()Returns the error name key of the entity that would be returned by getOriginEntity.ExecutorContextgetParentExecutorContext()Some executions are triggered by another execution (like a trigger) and this method provides the ExecutorContext of that execution.StringgetServletName()IfExecutorOriginisExecutorOrigin.SERVLETthis method return the name of the servlet that the request came in on.longgetStartTime()Get the time in millis when this executor context was startedSubjectgetUser(SchedulerSession session)Get the Subject that started this execution.StringgetUserName()the name of the user.
-
-
-
Method Detail
-
getOrigin
ExecutorOrigin getOrigin()
Get the origin of the execution.- Returns:
- the origin of the execution
-
getOriginEntityKey
String getOriginEntityKey()
Returns the error name key of the entity that would be returned by getOriginEntity. This can be used if the current user does not have access to the entity.- Returns:
- the error name key of the entity if there is one.
-
getOriginEntity
SchedulerEntity getOriginEntity(SchedulerSession session)
For origins that are based on a SchdulerEntity (Extension Point, Job etc.) this method will return the Object that is associated with that execution. The object will be retrieved from the passed in session, and can return null when the session is not allowed to view the object.- Parameters:
session- to use to retrieve the entity- Returns:
- the entity if applicable and the passed in session is allowed to see the entity.
-
getServletName
String getServletName()
IfExecutorOriginisExecutorOrigin.SERVLETthis method return the name of the servlet that the request came in on.- Returns:
- the name if the Servlet, null if this is not a
ExecutorOrigin.SERVLETorigin.
-
getUser
Subject getUser(SchedulerSession session)
Get the Subject that started this execution. This does not need to be the subject that the execution runs at, since f.e. an action subject can be set.- Parameters:
session-- Returns:
- the subject that started this execution
-
getUserName
String getUserName()
the name of the user. SeegetUser(SchedulerSession)for a description about the user.- Returns:
- the name of the origin user.
-
getParentExecutorContext
ExecutorContext getParentExecutorContext()
Some executions are triggered by another execution (like a trigger) and this method provides the ExecutorContext of that execution. All executions that originated from outside the system will have be or have a parent that isExecutorOrigin.SERVLETwithgetServletName()set to the servlet receiving the outside request.- Returns:
- the ExecutorContext that triggered this Execution, or null if there is none
-
getStartTime
long getStartTime()
Get the time in millis when this executor context was started- Returns:
- the time in millis since Epoch
-
-