public abstract class AbstractContext<C extends Context> extends java.lang.Object implements Context<C>
| Constructor and Description |
|---|
AbstractContext(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ContextVisitor visitor)
Accepts context visitor, i.e. calls visitor.visit(this).
|
ActionDefinition |
actDefFromDataRecord(DataRecord rec) |
DataRecord |
actDefToDataRecord(ActionDefinition def) |
void |
addActionDefinition(ActionDefinition def)
Add a new action definition to the context.
|
void |
addAlias(int entityType,
java.lang.String aliasName,
java.lang.String name) |
void |
addChild(C child)
Adds new child to the current context.
|
void |
addChild(C child,
DataTable childInfo) |
void |
addChild(C child,
java.lang.Integer index) |
void |
addChild(C child,
java.lang.Integer index,
DataTable childInfo) |
void |
addEventDefinition(EventDefinition def)
Adds event definition to this context.
|
boolean |
addEventListener(java.lang.String name,
ContextEventListener listener)
Adds listener of event with specified name.
|
boolean |
addEventListener(java.lang.String name,
ContextEventListener listener,
boolean weak)
Adds listener of event with specified name.
|
void |
addFunctionDefinition(FunctionDefinition def)
Adds function definition to this context.
|
void |
addVariableDefinition(VariableDefinition def)
Adds variable definition to this context.
|
void |
addVariableRecord(java.lang.String variable,
CallerController cc,
DataRecord record) |
void |
addVariableRecord(java.lang.String variable,
CallerController cc,
java.lang.Object... recordData) |
protected void |
applyCachedFormat(java.util.function.Supplier<TableFormat> formatGetter,
java.util.function.Consumer<TableFormat> formatSetter)
Extracts table format with given getter and puts it into current format cache.
|
AbstractContext |
awaitInitialized() |
DataTable |
callFcopy(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFcopyToChildren(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFfireContextEvent(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFgetAliases(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFgetCopyData(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
protected DataTable |
callFunction(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFunction(java.lang.String name)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
CallerController caller)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
CallerController caller,
DataTable parameters)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
CallerController caller,
java.lang.Object... parameters)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
CallerController caller,
RequestController request,
DataTable parameters)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
DataTable parameters)
Executes context function with specified
parameters and returns its output. |
DataTable |
callFunction(java.lang.String name,
java.lang.Object... parameters)
Executes context function with specified
parameters and returns its output. |
protected DataTable |
callFunctionImpl(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
DataTable |
callFupdateVariable(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters) |
boolean |
checkPermissions(Permissions needPermissions,
CallerController caller,
Context accessedContext,
EntityDefinition accessedEntityDefinition) |
protected void |
checkPermissions(Permissions needPermissions,
CallerController caller,
EntityDefinition accessedEntityDefinition) |
protected void |
clearVariableStatuses() |
int |
compareTo(Context context) |
protected DataTable |
copyTo(FunctionDefinition def,
CallerController caller,
RequestController request,
DataTable parameters,
java.util.List<C> children) |
protected DataTable |
createContextInfoTable() |
protected TableFormat |
decodeFormat(java.lang.String source,
CallerController caller) |
void |
destroy(boolean moving)
Permanently destroys this context.
|
void |
destroyChild(C child,
boolean moving)
Permanently destroys child of current context.
|
protected void |
destroyChildren(boolean moving) |
protected void |
enableStatus() |
protected void |
enableVariableStatuses(boolean persistent) |
protected java.lang.String |
encodeFormat(TableFormat format,
CallerController caller) |
protected void |
ensureVariableStatuses() |
boolean |
equals(java.lang.Object obj) |
EventDefinition |
evtDefFromDataRecord(DataRecord rec) |
DataRecord |
evtDefToDataRecord(EventDefinition ed) |
protected DataRecord |
evtDefToDataRecord(EventDefinition ed,
CallerController caller) |
DataTable |
executeDefaultGetter(java.lang.String name,
CallerController caller) |
DataTable |
executeDefaultGetter(java.lang.String name,
CallerController caller,
boolean check) |
DataTable |
executeDefaultGetter(java.lang.String name,
CallerController caller,
boolean check,
boolean createDefault) |
protected DataTable |
executeDefaultGetterImpl(VariableDefinition vd,
CallerController caller) |
void |
executeDefaultSetter(java.lang.String name,
CallerController caller,
DataTable value) |
void |
executeDefaultSetter(VariableDefinition def,
CallerController caller,
DataTable value) |
protected void |
executeDefaultSetterImpl(VariableDefinition vd,
CallerController caller,
DataTable value) |
protected void |
executeTasks(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks) |
protected void |
executeTasks(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks,
double loadFactor) |
protected void |
executeTasksConcurrently(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks,
double loadFactor)
Tries to utilize underlying
ContextOperationExecutor as much as possible but without occupying 100% of
its threads. |
protected DataTable |
fetchVariableStatuses() |
void |
fireChangeEvent(VariableDefinition def,
CallerController caller,
java.util.Date timestamp,
DataTable value) |
protected Event |
fireEvent(Event event) |
protected Event |
fireEvent(EventDefinition ed,
DataTable data,
int level,
java.lang.Long id,
java.util.Date creationtime,
java.lang.Integer listener,
CallerController caller,
FireEventRequestController request,
Permissions permissions) |
protected Event |
fireEvent(EventDefinition ed,
Event event,
java.lang.Integer listener,
CallerController caller,
FireEventRequestController request) |
Event |
fireEvent(java.lang.String name)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
CallerController caller)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
CallerController caller,
DataTable data)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
DataTable data)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
DataTable data,
int level,
java.lang.Long id,
java.util.Date creationtime,
java.lang.Integer listener,
CallerController caller,
FireEventRequestController request)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
FireEventRequestController request,
java.lang.Object... data) |
Event |
fireEvent(java.lang.String name,
int level,
CallerController caller,
DataTable data)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
int level,
CallerController caller,
FireEventRequestController request,
DataTable data)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
int level,
CallerController caller,
FireEventRequestController request,
Permissions permissions,
DataTable data) |
Event |
fireEvent(java.lang.String name,
int level,
DataTable data)
Fires context event.
|
Event |
fireEvent(java.lang.String name,
java.lang.Object... data)
Fires context event.
|
protected void |
fireEventAdded(EventDefinition def) |
protected void |
fireFunctionAdded(FunctionDefinition def) |
protected void |
fireStatusChanged(int status,
java.lang.String comment,
int oldStatus) |
protected void |
fireUpdatedEvent(VariableDefinition def,
CallerController caller,
RequestController request,
DataTable value,
DataTable valueOld) |
protected void |
fireVariableAdded(VariableDefinition def) |
FunctionDefinition |
funcDefFromDataRecord(DataRecord rec) |
DataRecord |
funcDefToDataRecord(FunctionDefinition fd) |
protected DataRecord |
funcDefToDataRecord(FunctionDefinition fd,
CallerController caller) |
C |
get(java.lang.String contextName)
Returns context with the selected path.
|
C |
get(java.lang.String contextPath,
CallerController caller)
Returns context with the selected path.
|
ActionDefinition |
getActionDefinition(java.lang.String name)
Returns action definition by name.
|
ActionDefinition |
getActionDefinition(java.lang.String name,
CallerController caller)
Returns action definition by name.
|
java.util.List<ActionDefinition> |
getActionDefinitions()
Returns action definitions.
|
java.util.List<ActionDefinition> |
getActionDefinitions(CallerController caller)
Returns action definitions that are accessible for the caller.
|
java.util.List<ActionDefinition> |
getActionDefinitions(CallerController caller,
boolean includeHidden)
Returns action definitions.
|
protected EventDefinition |
getChangeEventDefinition() |
C |
getChild(java.lang.String name)
Returns child of this context with the specified name.
|
C |
getChild(java.lang.String name,
CallerController caller)
Returns child of this context with the specified name.
|
java.util.List<C> |
getChildren()
Returns list of children contexts.
|
java.util.List<C> |
getChildren(CallerController caller)
Returns list of children contexts that are accessible by the specified
CallerController. |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
getChildrenLock() |
Permissions |
getChildrenViewPermissions()
Returns permissions required to access children of this context.
|
ContextManager<C> |
getContextManager()
Returns context manager those context tree contains this context.
|
ActionDefinition |
getDefaultActionDefinition(CallerController caller)
Returns default action definition or NULL if there is no default action or it's not available to the caller.
|
DataTable |
getDefaultValue(VariableDefinition def) |
java.lang.String |
getDescription()
Returns context description.
|
EventData |
getEventData(java.lang.String name)
Returns
EventData of event with specified name. |
protected java.util.Map<java.lang.String,EventData> |
getEventDataView() |
EventDefinition |
getEventDefinition(java.lang.String name)
Returns definition of event with specified name.
|
EventDefinition |
getEventDefinition(java.lang.String name,
CallerController caller)
Returns definition of event with specified name if it's accessible by caller controller.
|
java.util.List<EventDefinition> |
getEventDefinitions()
Returns list of events.
|
java.util.List<EventDefinition> |
getEventDefinitions(CallerController caller)
Returns list of events available for specified
CallerController. |
java.util.List<EventDefinition> |
getEventDefinitions(CallerController caller,
boolean includeHidden)
Returns list of events.
|
java.util.List<EventDefinition> |
getEventDefinitions(CallerController caller,
java.lang.String group)
Returns list of events belonging to
group that are available for specified CallerController. |
java.util.List<EventDefinition> |
getEventDefinitions(java.lang.String group)
Returns list of events belonging to
group. |
java.util.List<Event> |
getEventHistory(java.lang.String name)
Returns in-memory event history.
|
protected CallerController |
getEventProcessingCallerController() |
protected EventProcessingRule |
getEventProcessingRule(Event event) |
FunctionData |
getFunctionData(java.lang.String name)
Returns data of function with specified name.
|
protected java.util.Map<java.lang.String,FunctionData> |
getFunctionDataView() |
FunctionDefinition |
getFunctionDefinition(java.lang.String name)
Returns definition of function with specified name.
|
FunctionDefinition |
getFunctionDefinition(java.lang.String name,
CallerController caller)
Returns definition of function with specified name if it's accessible by caller controller.
|
java.util.List<FunctionDefinition> |
getFunctionDefinitions()
Returns list of functions.
|
java.util.List<FunctionDefinition> |
getFunctionDefinitions(CallerController caller)
Returns list of functions available for specified
CallerController. |
java.util.List<FunctionDefinition> |
getFunctionDefinitions(CallerController caller,
boolean includeHidden)
Returns list of functions.
|
java.util.List<FunctionDefinition> |
getFunctionDefinitions(CallerController caller,
java.lang.String group)
Returns list of functions belonging to
group that are available for specified CallerController. |
java.util.List<FunctionDefinition> |
getFunctionDefinitions(java.lang.String group)
Returns list of functions belonging to
group. |
java.lang.String |
getGroup()
Returns context group name of NULL if context does not belong to a group.
|
java.lang.String |
getIconId()
Returns context icon ID.
|
java.lang.Integer |
getIndex()
Returns context comparison index or NULL if index is not defined.
|
java.lang.String |
getLocalPrimaryRoot()
In distributed environment, returns path of the primary mount context in local tree.
|
java.lang.String |
getLocalRoot(boolean withParent)
Returns path of the root context.
|
java.util.List<C> |
getMappedChildren()
Returns list of mapped children contexts.
|
java.util.List<C> |
getMappedChildren(CallerController caller)
Returns list of mapped children contexts.
|
java.lang.String |
getName()
Returns context name.
|
C |
getParent()
Returns parent of this context.
|
java.lang.String |
getPath()
Returns context path (full name).
|
java.lang.String |
getPeerPath()
In distributed environment, returns path of the context on the server immediately connected to current server (current server's peer).
|
java.lang.String |
getPeerRoot()
When a certain context subtree from one server is connected to another server, this method will return the remote path of this subtree's root context.
|
PermissionChecker |
getPermissionChecker() |
Permissions |
getPermissions()
Returns context permissions.
|
java.lang.String |
getRemotePath()
In distributed environment, returns path of the context on the server where it's actually defined.
|
java.lang.String |
getRemoteRoot()
Returns path of remote server's root context within a distributed connection.
|
C |
getRoot()
Returns root context of the context tree containing this context.
|
ContextStatus |
getStatus()
Returns context status or null if status is not enabled;
|
java.lang.String |
getType()
Returns context type.
|
DataTable |
getVactions(VariableDefinition def,
CallerController caller,
RequestController request) |
DataTable |
getVariable(java.lang.String name)
Gets variable from context and returns its value.
|
DataTable |
getVariable(java.lang.String name,
CallerController caller)
Gets variable from context and returns its value.
|
DataTable |
getVariable(java.lang.String name,
CallerController caller,
RequestController request)
Gets variable from context and returns its value.
|
DataTable |
getVariableClone(java.lang.String name,
CallerController caller)
Gets variable from context and returns its value.
|
VariableData |
getVariableData(java.lang.String name)
Returns data of variable with specified name.
|
protected java.util.Map<java.lang.String,VariableData> |
getVariableDataView() |
VariableDefinition |
getVariableDefinition(java.lang.String name)
Returns definition of variable with specified name.
|
VariableDefinition |
getVariableDefinition(java.lang.String name,
CallerController caller)
Returns definition of variable with specified name if it's accessible by caller controller.
|
java.util.List<VariableDefinition> |
getVariableDefinitions()
Returns list of variables.
|
java.util.List<VariableDefinition> |
getVariableDefinitions(CallerController caller)
Returns list of variables available for specified
CallerController. |
java.util.List<VariableDefinition> |
getVariableDefinitions(CallerController caller,
boolean includeHidden)
Returns list of variables.
|
java.util.List<VariableDefinition> |
getVariableDefinitions(CallerController caller,
java.lang.String group)
Returns list of variables belonging to
group that are available for specified CallerController. |
java.util.List<VariableDefinition> |
getVariableDefinitions(java.lang.String group)
Returns list of variables belonging to
group. |
protected DataTable |
getVariableImpl(VariableDefinition def,
CallerController caller,
RequestController request) |
java.lang.Object |
getVariableObject(java.lang.String name,
CallerController caller)
Returns value of variable as bean or list of beans.
|
VariableStatus |
getVariableStatus(VariableDefinition variableDefinition) |
DataTable |
getVchildren(VariableDefinition def,
CallerController caller,
RequestController request) |
DataTable |
getVevents(VariableDefinition def,
CallerController caller,
RequestController request) |
DataTable |
getVfunctions(VariableDefinition def,
CallerController caller,
RequestController request) |
DataTable |
getVinfo(VariableDefinition def,
CallerController caller,
RequestController request) |
java.util.List<C> |
getVisibleChildren()
Returns list of visible children contexts.
|
java.util.List<C> |
getVisibleChildren(CallerController caller)
Returns list of visible children contexts.
|
DataTable |
getVvariables(VariableDefinition def,
CallerController caller,
RequestController request) |
int |
hashCode() |
boolean |
hasMappedChild(java.lang.String contextName,
CallerController callerController)
Check if the mapped child of this context is available.
|
boolean |
hasParent(C parentContext)
Returns true if parentContext is a parent of this context or some of its parents.
|
boolean |
hasVisibleChild(java.lang.String name,
CallerController caller)
Check if the visible child of the context is available.
|
protected boolean |
isAllowSetterExecution(VariableDefinition data,
RequestController request,
DataTable value) |
protected boolean |
isAllowUpdatedEvents(VariableDefinition def) |
protected boolean |
isBelongedToTheGroup(java.lang.String targetGroup,
java.lang.String entityGroup) |
boolean |
isChildrenConcurrencyEnabled() |
boolean |
isChildrenSortingEnabled() |
boolean |
isContainer()
Returns true if context is container.
|
boolean |
isDebuggingEvaluations() |
boolean |
isDistributed()
Returns true if context has a remote peer in the distributed architecture.
|
boolean |
isEntityProtected(EntityDefinition ed) |
protected boolean |
isFireUpdateEvents() |
boolean |
isInitializedChildren()
This method should return true if the context has already been initialized its children.
|
boolean |
isInitializedEvents()
This method should return true if the context has already been initialized its events.
|
boolean |
isInitializedFunctions()
This method should return true if the context has already been initialized its functions.
|
boolean |
isInitializedInfo()
This method should return true if the context has already been initialized its basic information (description, type, etc).
|
boolean |
isInitializedStatus()
This method should return true if the context status has already been initialized.
|
boolean |
isInitializedVariables()
This method should return true if the context has already been initialized its variables.
|
boolean |
isInstallationAllowed(java.lang.String installableName)
Check if an installation is permitted.
|
boolean |
isMapped()
Returns true if context's visible children are mapped (e.g. for group and aggregation contexts).
|
boolean |
isPermissionCheckingEnabled() |
boolean |
isProtected() |
boolean |
isProxy()
Returns true if context is a remote context's proxy.
|
boolean |
isSetupComplete()
This method should return true if the context has already been initialized and setupMyself() finished execution.
|
boolean |
isStarted()
Returns true if context was started but not yet stopped.
|
boolean |
isStopped() |
protected void |
logAsyncSessionExecutionAction(CallerController caller,
RequestController requestController,
ContextOperationType operationType,
java.lang.String entityName,
DataTable parameters,
DataTable output,
long duration) |
void |
move(C newParent,
java.lang.String newName)
Moves and/or renames the context.
|
protected void |
moveFinalize(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName) |
protected void |
moveInternal(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName) |
protected void |
movePrepare(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName) |
protected java.util.Optional<FormatCache> |
obtainFormatCache() |
protected void |
onIllegalDefinitionUpdated(java.lang.String definitionName) |
protected void |
persistVariableStatuses(DataTable statuses) |
protected void |
postEvent(Event ev,
EventDefinition ed,
CallerController caller,
FireEventRequestController request) |
protected void |
processBindings(Event event) |
void |
processEvaluation(Evaluator evaluator,
Expression expression,
Reference holder,
java.lang.Object result,
NodeEvaluationDetails details) |
void |
processEvaluationError(Evaluator evaluator,
Expression expression,
Reference holder,
java.lang.Exception error,
NodeEvaluationDetails details) |
void |
removeActionDefinition(java.lang.String name)
Remove an action definition from the context.
|
void |
removeChild(C child)
Removes child of current context.
|
void |
removeChild(java.lang.String name)
Removes child with specified name.
|
void |
removeEventDefinition(java.lang.String name)
Removes event definition from this context.
|
boolean |
removeEventListener(java.lang.String name,
ContextEventListener listener)
Removes listener of event with specified name.
|
void |
removeFromParent() |
void |
removeFunctionDefinition(java.lang.String name)
Removes function definition from this context.
|
protected void |
removeValues(VariableDefinition vd) |
void |
removeVariableDefinition(java.lang.String name)
Removes variable definition from this context.
|
void |
removeVariableRecords(java.lang.String variable,
CallerController cc,
java.lang.String field,
java.lang.Object value) |
protected void |
reorderChild(C child,
int index) |
java.util.Set<java.lang.String> |
replicateVariableOnCopy(java.lang.String variableName,
DataTable variableValue,
DataTable targetValue,
java.util.List<java.lang.String> fields,
CallerController caller) |
protected void |
saveVariableStatuses() |
protected void |
setChildrenConcurrencyEnabled(boolean childrenConcurrencyEnabled) |
protected void |
setChildrenSortingEnabled(boolean childrenSortingEnabled) |
protected void |
setChildrenViewPermissions(Permissions childrenViewPermissions) |
protected void |
setContextManager(ContextManager contextManager) |
void |
setDescription(java.lang.String description) |
protected void |
setFireUpdateEvents(boolean fireUpdateEvents) |
void |
setGroup(java.lang.String group) |
protected void |
setIconId(java.lang.String iconId) |
void |
setIndex(java.lang.Integer index)
Deprecated.
Use ContextSortingHelper class for set tree context hierarchy
|
protected void |
setName(java.lang.String name) |
void |
setParent(C parent) |
protected void |
setPermissionChecker(PermissionChecker permissionChecker) |
protected void |
setPermissionCheckingEnabled(boolean permissionCheckingEnabled) |
protected void |
setPermissions(Permissions permissions) |
void |
setStatus(int status,
java.lang.String comment) |
void |
setType(java.lang.String type) |
protected void |
setup() |
void |
setup(ContextManager contextManager)
This method is called after the context has been added to a context tree and it became aware of its full path.
|
void |
setupChildren() |
protected void |
setupEvents() |
protected void |
setupFunctions() |
void |
setupMyself() |
void |
setupPermissions() |
protected void |
setupVariables() |
protected void |
setValueCheckingEnabled(boolean valueCheckingEnabled) |
void |
setVariable(java.lang.String name,
CallerController caller,
DataTable value)
Sets context variable to specified
value. |
void |
setVariable(java.lang.String name,
CallerController caller,
java.lang.Object... value)
Sets context variable to specified
value. |
void |
setVariable(java.lang.String name,
CallerController caller,
RequestController request,
DataTable value)
Sets context variable to specified
value. |
void |
setVariable(java.lang.String name,
DataTable value)
Sets context variable to specified
value. |
void |
setVariable(java.lang.String name,
java.lang.Object... value)
Sets context variable to specified
value. |
boolean |
setVariableField(java.lang.String variable,
java.lang.String field,
int record,
java.lang.Object value,
CallerController cc,
RequestController request) |
boolean |
setVariableField(java.lang.String variable,
java.lang.String field,
java.lang.Object value,
CallerController cc)
Gets variable, updates field value in the first record, and sets variable.
|
void |
setVariableField(java.lang.String variable,
java.lang.String field,
java.lang.Object value,
java.lang.String compareField,
java.lang.Object compareValue,
CallerController cc)
Gets variable, updates field value in the records for those value of compareField equals compareValue, and sets variable.
|
protected boolean |
setVariableImpl(VariableDefinition def,
CallerController caller,
RequestController request,
DataTable value) |
protected boolean |
shouldSeeChild(CallerController caller,
Context<C> cur) |
void |
start()
This method is called when context tree is being started after its initialization.
|
void |
stop()
This method is called when context tree is being stopped before its de-initialization.
|
void |
teardown()
This method is called when the context is being removed from context tree..
|
java.lang.String |
toDetailedString()
Returns context detailed description that includes description and path.
|
java.lang.String |
toString() |
protected void |
updateEvent(Event ev,
EventDefinition ed,
CallerController caller,
FireEventRequestController request) |
java.util.List<EventDefinition> |
updateEventDefinitions(java.util.Map<java.lang.String,EventDefinition> source,
java.lang.String baseGroup,
boolean skipRemoval,
java.lang.Object owner) |
protected boolean |
updateFunctionAndAction(FunctionDefinition fd,
boolean processAction,
java.lang.Object owner) |
java.util.List<FunctionDefinition> |
updateFunctionDefinitions(java.util.Map<java.lang.String,Pair<FunctionDefinition,java.lang.Boolean>> source,
java.lang.String baseGroup,
boolean skipRemoval,
java.lang.Object owner) |
void |
updatePrepare()
Prepare context to update.
|
java.util.List<VariableDefinition> |
updateVariableDefinitions(java.util.Map<java.lang.String,VariableDefinition> source,
java.lang.String baseGroup,
boolean skipRemoval,
boolean removeValues,
java.lang.Object owner) |
void |
updateVariableStatus(java.lang.String variable,
VariableStatus status,
boolean persistent) |
protected void |
validateVariableValueToSet(VariableDefinition variableDefinition,
DataTable value) |
VariableDefinition |
varDefFromDataRecord(DataRecord rec) |
DataRecord |
varDefToDataRecord(VariableDefinition vd) |
protected DataRecord |
varDefToDataRecord(VariableDefinition vd,
CallerController caller) |
protected void |
variableUpdated(VariableDefinition def,
CallerController caller,
RequestController request,
DataTable value,
DataTable valueOld) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitsetVariableFieldpublic static final int EXECUTOR_THREADS_PERCENT_FOR_VISITORS
public static final java.lang.String V_INFO
public static final java.lang.String V_CHILDREN
public static final java.lang.String V_VARIABLES
public static final java.lang.String V_FUNCTIONS
public static final java.lang.String V_EVENTS
public static final java.lang.String V_ACTIONS
public static final java.lang.String V_VARIABLE_STATUSES
public static final java.lang.String F_GET_COPY_DATA
public static final java.lang.String F_COPY
public static final java.lang.String F_COPY_TO_CHILDREN
public static final java.lang.String F_UPDATE_VARIABLE
public static final java.lang.String F_GET_VARIABLE_STATUS
public static final java.lang.String F_LOCKED_BY
public static final java.lang.String F_LOCK
public static final java.lang.String F_UNLOCK
public static final java.lang.String F_BREAK_LOCK
public static final java.lang.String F_GET_ALIASES
public static final java.lang.String F_FIRE_CONTEXT_EVENT
public static final java.lang.String E_INFO
public static final java.lang.String E_UPDATED
public static final java.lang.String E_CHANGE
public static final java.lang.String E_DESTROYED
public static final java.lang.String E_INFO_CHANGED
public static final java.lang.String E_VARIABLE_ADDED
public static final java.lang.String E_VARIABLE_REMOVED
public static final java.lang.String E_FUNCTION_ADDED
public static final java.lang.String E_FUNCTION_REMOVED
public static final java.lang.String E_EVENT_ADDED
public static final java.lang.String E_EVENT_REMOVED
public static final java.lang.String E_ACTION_ADDED
public static final java.lang.String E_ACTION_REMOVED
public static final java.lang.String E_ACTION_STATE_CHANGED
public static final java.lang.String E_CHILD_REMOVED
public static final java.lang.String E_CHILD_ADDED
public static final java.lang.String E_VARIABLE_STATUS_CHANGED
public static final java.lang.String VF_INFO_DESCRIPTION
public static final java.lang.String VF_INFO_TYPE
public static final java.lang.String VF_INFO_GROUP
public static final java.lang.String VF_INFO_ICON
public static final java.lang.String VF_INFO_LOCAL_ROOT
public static final java.lang.String VF_INFO_PEER_ROOT
public static final java.lang.String VF_INFO_PEER_PRIMARY_ROOT
public static final java.lang.String VF_INFO_REMOTE_ROOT
public static final java.lang.String VF_INFO_REMOTE_PATH
public static final java.lang.String VF_INFO_MAPPED
public static final java.lang.String VF_CHILDREN_NAME
public static final java.lang.String VF_CHILDREN_IS_CONTAINER
public static final java.lang.String VF_VARIABLE_STATUSES_COMMENT
public static final java.lang.String VF_VARIABLE_STATUSES_STATUS
public static final java.lang.String VF_VARIABLE_STATUSES_NAME
public static final java.lang.String FIF_COPY_DATA_RECIPIENTS
public static final java.lang.String FIF_COPY_DATA_GROUP
public static final java.lang.String FOF_COPY_DATA_NAME
public static final java.lang.String FOF_COPY_DATA_DESCRIPTION
public static final java.lang.String FOF_COPY_DATA_REPLICATE
public static final java.lang.String FOF_COPY_DATA_FIELDS
public static final java.lang.String FOF_COPY_DATA_VALUE
public static final java.lang.String FIF_REPLICATE_FIELDS_NAME
public static final java.lang.String FIF_REPLICATE_FIELDS_DESCRIPTION
public static final java.lang.String FIF_REPLICATE_FIELDS_REPLICATE
public static final java.lang.String FIF_COPY_DATA_RECIPIENTS_RECIPIENT
public static final java.lang.String FIF_LOCK_PROPERTIES_EDITOR_UUID
public static final java.lang.String FIF_UNLOCK_PROPERTIES_EDITOR_UUID
public static final java.lang.String FIF_VISIBLE_CHILDREN_FILTER_EXPRESSION
public static final java.lang.String FIF_VISIBLE_CHILDREN_CONTEXT_MASK
public static final java.lang.String FIF_VISIBLE_CHILDREN_PROPERTY_FILTERS
public static final java.lang.String FIF_VISIBLE_CHILDREN_GLOBAL_FILTER
public static final java.lang.String FIF_VISIBLE_CHILDREN_OFFSET
public static final java.lang.String FIF_VISIBLE_CHILDREN_COUNT
public static final java.lang.String FIF_VISIBLE_CHILDREN_SMART_FILTER_EXPRESSION
public static final java.lang.String FIF_FIRE_EVENT_LEVEL
public static final java.lang.String FIF_FIRE_EVENT_EVENT
public static final java.lang.String FIF_FIRE_EVENT_DATA
public static final java.lang.String FOF_FIRE_EVENT_ID
public static final java.lang.String VF_VISIBLE_CHILDREN_PROPERTY_FILTERS_PROPERTY_NAME
public static final java.lang.String VF_VISIBLE_CHILDREN_PROPERTY_FILTERS_PROPERTY_VALUE
public static final java.lang.String FOF_LOCKED_BY_OWNER_NAME
public static final java.lang.String FOF_LOCK_OWNER_NAME
public static final java.lang.String FOF_UNLOCK_UNLOCKED
public static final java.lang.String FOF_VISIBLE_CHILDREN_BATCH
public static final java.lang.String FOF_VISIBLE_CHILDREN_TOTAL_COUNT
public static final java.lang.String FOF_GET_ALIASES_ENTITY_TYPE
public static final java.lang.String FOF_GET_ALIASES_ALIAS_NAME
public static final java.lang.String FOF_GET_ALIASES_NAME
public static final java.lang.String EF_INFO_INFO
public static final java.lang.String EF_EVENT_REMOVED_NAME
public static final java.lang.String EF_FUNCTION_REMOVED_NAME
public static final java.lang.String EF_VARIABLE_REMOVED_NAME
public static final java.lang.String EF_ACTION_REMOVED_NAME
public static final java.lang.String EF_CHILD_REMOVED_CHILD
public static final java.lang.String EF_CHILD_ADDED_CHILD
public static final java.lang.String FIELD_REPLICATE_VARIABLE
public static final java.lang.String FIELD_REPLICATE_SUCCESSFUL
public static final java.lang.String FIELD_REPLICATE_ERRORS
public static final java.lang.String V_UPDATE_VARIABLE
public static final java.lang.String V_UPDATE_VARIABLE_EXPRESSION
public static final java.lang.String V_VARIABLE_NAME
public static final java.lang.String EF_UPDATED_VARIABLE
public static final java.lang.String EF_UPDATED_VALUE
public static final java.lang.String EF_UPDATED_VALUE_OLD
public static final java.lang.String EF_UPDATED_USER
public static final java.lang.String EF_UPDATED_VARIABLE_STATUS
public static final java.lang.String EF_UPDATED_UPDATE_ORIGINATOR
public static final java.lang.String EF_CHANGE_VARIABLE
public static final java.lang.String EF_CHANGE_VALUE
public static final java.lang.String EF_CHANGE_DATA
public static final java.lang.String EF_CHANGE_FORMAT
public static final java.lang.String FIELD_VD_NAME
public static final java.lang.String FIELD_VD_FORMAT
public static final java.lang.String FIELD_VD_DESCRIPTION
public static final java.lang.String FIELD_VD_READABLE
public static final java.lang.String FIELD_VD_WRITABLE
public static final java.lang.String FIELD_VD_HELP
public static final java.lang.String FIELD_VD_GROUP
public static final java.lang.String FIELD_VD_ICON_ID
public static final java.lang.String FIELD_VD_HELP_ID
public static final java.lang.String FIELD_VD_CACHE_TIME
public static final java.lang.String FIELD_VD_SERVER_CACHING_MODE
public static final java.lang.String FIELD_VD_ADD_PREVIOUS_VALUE_TO_VARIABLE_UPDATE_EVENT
public static final java.lang.String FIELD_FD_NAME
public static final java.lang.String FIELD_FD_INPUTFORMAT
public static final java.lang.String FIELD_FD_OUTPUTFORMAT
public static final java.lang.String FIELD_FD_DESCRIPTION
public static final java.lang.String FIELD_FD_HELP
public static final java.lang.String FIELD_FD_GROUP
public static final java.lang.String FIELD_FD_ICON_ID
public static final java.lang.String FIELD_FD_CONCURRENT
public static final java.lang.String FIELD_FD_PERMISSIONS
public static final java.lang.String FIELD_ED_NAME
public static final java.lang.String FIELD_ED_FORMAT
public static final java.lang.String FIELD_ED_DESCRIPTION
public static final java.lang.String FIELD_ED_HELP
public static final java.lang.String FIELD_ED_LEVEL
public static final java.lang.String FIELD_ED_GROUP
public static final java.lang.String FIELD_ED_ICON_ID
public static final int DEFAULT_EVENT_LEVEL
public static final TableFormat VARIABLE_DEFINITION_FORMAT
public static final TableFormat VFT_VISIBLE_CHILDREN
public static final TableFormat FUNCTION_DEFINITION_FORMAT
public static final TableFormat EF_FUNCTION_ADDED
public static final TableFormat EVENT_DEFINITION_FORMAT
public static final TableFormat EF_EVENT_ADDED
protected static final TableFormat VFT_CHILDREN
public static final TableFormat INFO_DEFINITION_FORMAT
public static final TableFormat ACTION_DEF_FORMAT
public static final TableFormat RESOURCE_MASKS_FORMAT
public static final TableFormat FIFT_GET_COPY_DATA
public static final TableFormat FIFT_GET_COPY_DATA_RECIPIENTS
public static final TableFormat REPLICATE_INPUT_FORMAT
public static final TableFormat FIFT_REPLICATE_FIELDS
public static final TableFormat REPLICATE_OUTPUT_FORMAT
protected static final TableFormat REPLICATE_TO_CHILDREN_OUTPUT_FORMAT
public static final TableFormat FIFT_UPDATE_VARIABLE
public static final TableFormat FIFT_GET_VARIABLE_STATUS
public static final TableFormat FIFT_LOCK
public static final TableFormat FIFT_UNLOCK
public static final TableFormat FIFT_VISIBLE_CHILDREN
public static final TableFormat FOFT_LOCKED_BY
public static final TableFormat FOFT_LOCK
public static final TableFormat FOFT_UNLOCK
public static final TableFormat FOFT_VISIBLE_CHILDREN
public static final TableFormat FOFT_GET_ALIASES
public static final TableFormat FIFT_FIRE_CONTEXT_EVENT
public static final TableFormat FOFT_FIRE_CONTEXT_EVENT
public static final TableFormat EF_UPDATED
public static final TableFormat EF_CHANGE
public static final TableFormat EFT_INFO
public static final TableFormat EFT_VARIABLE_REMOVED
public static final TableFormat EFT_EVENT_REMOVED
public static final TableFormat EFT_FUNCTION_REMOVED
public static final TableFormat EFT_CHILD_REMOVED
public static final TableFormat EFT_CHILD_ADDED
public static final TableFormat EFT_ACTION_REMOVED
public static final VariableDefinition VD_INFO
public static final VariableDefinition VD_VARIABLES
public static final VariableDefinition VD_FUNCTIONS
public static final VariableDefinition VD_EVENTS
public static final VariableDefinition VD_ACTIONS
public static final VariableDefinition VD_CHILDREN
protected static final FunctionDefinition FD_GET_COPY_DATA
protected static final FunctionDefinition FD_COPY
protected static final FunctionDefinition FD_COPY_TO_CHILDREN
protected static final FunctionDefinition FD_UPDATE_VARIABLE
protected static final FunctionDefinition FD_GET_ALIASES
protected static final FunctionDefinition FD_FIRE_CONTEXT_EVENT
public static final EventDefinition ED_INFO
public static final EventDefinition ED_CHILD_ADDED
public static final EventDefinition ED_CHILD_REMOVED
public static final EventDefinition ED_VARIABLE_ADDED
public static final EventDefinition ED_VARIABLE_REMOVED
public static final EventDefinition ED_FUNCTION_ADDED
public static final EventDefinition ED_FUNCTION_REMOVED
public static final EventDefinition ED_EVENT_ADDED
public static final EventDefinition ED_EVENT_REMOVED
public static final EventDefinition ED_ACTION_ADDED
public static final EventDefinition ED_ACTION_REMOVED
public static final EventDefinition ED_ACTION_STATE_CHANGED
public static final EventDefinition ED_INFO_CHANGED
public static final EventDefinition ED_UPDATED
public static final EventDefinition ED_CHANGE
public static final EventDefinition ED_DESTROYED
public static final java.lang.String CALLER_CONTROLLER_PROPERTY_DEBUG
public static final java.lang.String CALLER_CONTROLLER_PROPERTY_NO_UPDATED_EVENTS
public static final java.lang.String CALLER_CONTROLLER_PROPERTY_NO_CHANGE_EVENTS
public static final java.lang.String CALLER_CONTROLLER_PROPERTY_NO_STATISTICS
public static final java.lang.String CALLER_CONTROLLER_PROPERTY_NO_VALIDATION
public static final int INDEX_HIGHEST
public static final int INDEX_VERY_HIGH
public static final int INDEX_HIGH
public static final int INDEX_HIGHER
public static final int INDEX_NORMAL
public static final int INDEX_LOWER
public static final int INDEX_LOW
public static final int INDEX_VERY_LOW
public static final int INDEX_LOWEST
protected static final int SORT_THRESHOLD
protected static final java.lang.ThreadLocal<Pinpoint> currentSource
public final void setup(ContextManager contextManager)
Contextprotected final void setup()
public void setupPermissions()
public void setupMyself()
throws ContextException
ContextExceptionpublic void setupChildren()
throws ContextException
ContextExceptionpublic void teardown()
Contextpublic void start()
Contextpublic void stop()
Contextpublic int compareTo(Context context)
public java.util.List<C> getChildren(CallerController caller)
ContextCallerController.getChildren in interface Context<C extends Context>protected boolean shouldSeeChild(CallerController caller, Context<C> cur)
public java.util.List<C> getChildren()
ContextgetChildren in interface Context<C extends Context>public java.util.List<C> getVisibleChildren(CallerController caller)
ContextgetVisibleChildren in interface Context<C extends Context>public boolean hasVisibleChild(java.lang.String name,
CallerController caller)
ContexthasVisibleChild in interface Context<C extends Context>public java.util.List<C> getVisibleChildren()
ContextgetVisibleChildren in interface Context<C extends Context>public boolean isMapped()
Contextpublic java.util.List<C> getMappedChildren(CallerController caller)
ContextgetMappedChildren in interface Context<C extends Context>public java.util.List<C> getMappedChildren()
ContextgetMappedChildren in interface Context<C extends Context>public boolean hasMappedChild(java.lang.String contextName,
CallerController callerController)
ContexthasMappedChild in interface Context<C extends Context>public java.lang.String getName()
Contextpublic java.lang.String getDescription()
ContextgetDescription in interface Context<C extends Context>public void setDescription(java.lang.String description)
public C getParent()
Contextpublic boolean hasParent(C parentContext)
Contextpublic C getRoot()
Contextpublic C get(java.lang.String contextPath, CallerController caller)
Contextpath argument may be absolute of relative to this context. This method uses provided CallerController for permission checking.public C get(java.lang.String contextName)
Contextpath argument may be absolute of relative to this context.
Note: if this Context is a part of distributed context tree and path argument is not relative, the method will return local context matching its remote "peer" with given path. To get the local
context with the given path, use ContextManager.get(String) instead.public Permissions getPermissions()
ContextgetPermissions in interface Context<C extends Context>public AbstractContext awaitInitialized() throws ContextException
ContextExceptionprotected void setName(java.lang.String name)
public void setParent(C parent)
protected void setPermissions(Permissions permissions)
protected void setPermissionChecker(PermissionChecker permissionChecker)
protected void setFireUpdateEvents(boolean fireUpdateEvents)
protected boolean isFireUpdateEvents()
protected void setContextManager(ContextManager contextManager)
protected void setChildrenViewPermissions(Permissions childrenViewPermissions)
protected void setChildrenSortingEnabled(boolean childrenSortingEnabled)
public boolean isChildrenSortingEnabled()
protected void setValueCheckingEnabled(boolean valueCheckingEnabled)
public boolean isChildrenConcurrencyEnabled()
protected void setChildrenConcurrencyEnabled(boolean childrenConcurrencyEnabled)
protected void checkPermissions(Permissions needPermissions, CallerController caller, EntityDefinition accessedEntityDefinition) throws ContextSecurityException
ContextSecurityExceptionpublic boolean checkPermissions(Permissions needPermissions, CallerController caller, Context accessedContext, EntityDefinition accessedEntityDefinition)
public void addChild(C child)
Contextpublic void addChild(C child, java.lang.Integer index)
public void removeFromParent()
public void destroy(boolean moving)
Contextprotected void destroyChildren(boolean moving)
public void removeChild(C child)
ContextremoveChild in interface Context<C extends Context>public void removeChild(java.lang.String name)
ContextremoveChild in interface Context<C extends Context>protected void reorderChild(C child, int index)
public void destroyChild(C child, boolean moving)
ContextdestroyChild in interface Context<C extends Context>public void updatePrepare()
ContextupdatePrepare in interface Context<C extends Context>protected void movePrepare(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName)
throws ContextException
ContextExceptionprotected void moveInternal(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName)
throws ContextException
ContextExceptionprotected void moveFinalize(java.lang.String oldPath,
java.lang.String oldName,
java.lang.String newPath,
java.lang.String newName)
throws ContextException
ContextExceptionpublic void move(C newParent, java.lang.String newName) throws ContextException
Contextmove in interface Context<C extends Context>ContextExceptionpublic C getChild(java.lang.String name, CallerController caller)
Contextpath argument may be absolute of relative to this context.
Note: if this Context is a part of distributed context tree and path argument is not relative, the method will return local context matching its remote "peer" with given path. To get the local
context with the given path, use ContextManager.get(String, CallerController) instead.
This method uses provided CallerController for permission checking.public C getChild(java.lang.String name)
Contextpublic java.lang.String getPath()
Contextpublic boolean addEventListener(java.lang.String name,
ContextEventListener listener)
ContextaddEventListener in interface Context<C extends Context>public boolean addEventListener(java.lang.String name,
ContextEventListener listener,
boolean weak)
ContextaddEventListener in interface Context<C extends Context>public boolean removeEventListener(java.lang.String name,
ContextEventListener listener)
ContextremoveEventListener in interface Context<C extends Context>public java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller)
ContextCallerController.getVariableDefinitions in interface Context<C extends Context>public java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller, boolean includeHidden)
ContextgetVariableDefinitions in interface Context<C extends Context>public java.util.List<VariableDefinition> getVariableDefinitions()
ContextgetVariableDefinitions in interface Context<C extends Context>public java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller, java.lang.String group)
Contextgroup that are available for specified CallerController.getVariableDefinitions in interface Context<C extends Context>public java.util.List<VariableDefinition> getVariableDefinitions(java.lang.String group)
Contextgroup.getVariableDefinitions in interface Context<C extends Context>public PermissionChecker getPermissionChecker()
public Permissions getChildrenViewPermissions()
ContextgetChildrenViewPermissions in interface Context<C extends Context>public ContextManager<C> getContextManager()
ContextgetContextManager in interface Context<C extends Context>public boolean isSetupComplete()
ContextisSetupComplete in interface Context<C extends Context>public boolean isStarted()
Contextpublic boolean isStopped()
public boolean isProtected()
public boolean isEntityProtected(EntityDefinition ed)
public boolean isInitializedStatus()
ContextisInitializedStatus in interface Context<C extends Context>public boolean isInitializedInfo()
ContextisInitializedInfo in interface Context<C extends Context>public boolean isInitializedChildren()
ContextisInitializedChildren in interface Context<C extends Context>public boolean isInitializedVariables()
ContextisInitializedVariables in interface Context<C extends Context>public boolean isInitializedFunctions()
ContextisInitializedFunctions in interface Context<C extends Context>public boolean isInitializedEvents()
ContextisInitializedEvents in interface Context<C extends Context>public java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller)
ContextCallerController.getFunctionDefinitions in interface Context<C extends Context>public java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller, boolean includeHidden)
ContextgetFunctionDefinitions in interface Context<C extends Context>public java.util.List<FunctionDefinition> getFunctionDefinitions()
ContextgetFunctionDefinitions in interface Context<C extends Context>public java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller, java.lang.String group)
Contextgroup that are available for specified CallerController.getFunctionDefinitions in interface Context<C extends Context>public java.util.List<FunctionDefinition> getFunctionDefinitions(java.lang.String group)
Contextgroup.getFunctionDefinitions in interface Context<C extends Context>protected java.util.concurrent.locks.ReentrantReadWriteLock getChildrenLock()
public java.lang.String getType()
Contextpublic boolean isPermissionCheckingEnabled()
public java.lang.String getIconId()
Contextpublic java.lang.Integer getIndex()
Contextpublic java.lang.String getGroup()
Contextpublic java.lang.String getLocalRoot(boolean withParent)
ContextgetLocalRoot in interface Context<C extends Context>public boolean isProxy()
Contextpublic boolean isDistributed()
ContextisDistributed in interface Context<C extends Context>public boolean isContainer()
ContextisContainer in interface Context<C extends Context>public java.lang.String getPeerRoot()
ContextgetPeerRoot in interface Context<C extends Context>public java.lang.String getRemoteRoot()
ContextgetRemoteRoot in interface Context<C extends Context>public java.lang.String getRemotePath()
ContextgetRemotePath in interface Context<C extends Context>public java.lang.String getPeerPath()
ContextgetPeerPath in interface Context<C extends Context>public java.lang.String getLocalPrimaryRoot()
ContextgetLocalPrimaryRoot in interface Context<C extends Context>public void setType(java.lang.String type)
protected void setPermissionCheckingEnabled(boolean permissionCheckingEnabled)
protected void setIconId(java.lang.String iconId)
@Deprecated public void setIndex(java.lang.Integer index)
public void setGroup(java.lang.String group)
public java.util.List<EventDefinition> getEventDefinitions(CallerController caller)
ContextCallerController.getEventDefinitions in interface Context<C extends Context>public java.util.List<EventDefinition> getEventDefinitions(CallerController caller, boolean includeHidden)
ContextgetEventDefinitions in interface Context<C extends Context>public java.util.List<EventDefinition> getEventDefinitions()
ContextgetEventDefinitions in interface Context<C extends Context>public java.util.List<EventDefinition> getEventDefinitions(CallerController caller, java.lang.String group)
Contextgroup that are available for specified CallerController.getEventDefinitions in interface Context<C extends Context>public java.util.List<EventDefinition> getEventDefinitions(java.lang.String group)
Contextgroup.getEventDefinitions in interface Context<C extends Context>public ActionDefinition getActionDefinition(java.lang.String name)
ContextgetActionDefinition in interface Context<C extends Context>name - Name of actionpublic ActionDefinition getActionDefinition(java.lang.String name, CallerController caller)
ContextgetActionDefinition in interface Context<C extends Context>name - Name of actioncaller - Caller controllerpublic ActionDefinition getDefaultActionDefinition(CallerController caller)
ContextgetDefaultActionDefinition in interface Context<C extends Context>caller - Caller controllerpublic java.util.List<ActionDefinition> getActionDefinitions(CallerController caller)
ContextgetActionDefinitions in interface Context<C extends Context>caller - Caller controllerpublic void addActionDefinition(ActionDefinition def)
ContextaddActionDefinition in interface Context<C extends Context>def - ActionDefinition to addpublic java.util.List<ActionDefinition> getActionDefinitions(CallerController caller, boolean includeHidden)
ContextgetActionDefinitions in interface Context<C extends Context>public java.util.List<ActionDefinition> getActionDefinitions()
ContextgetActionDefinitions in interface Context<C extends Context>protected void applyCachedFormat(java.util.function.Supplier<TableFormat> formatGetter, java.util.function.Consumer<TableFormat> formatSetter)
formatGetter - a method link to extract the format (like VariableDefinition.getFormat())formatSetter - a method link to replace the format (like VariableDefinition.setFormat(com.tibbo.aggregate.common.datatable.TableFormat))public void removeActionDefinition(java.lang.String name)
ContextremoveActionDefinition in interface Context<C extends Context>name - Name of action to removepublic ActionDefinition actDefFromDataRecord(DataRecord rec)
public DataTable executeDefaultGetter(java.lang.String name, CallerController caller) throws ContextException
ContextExceptionpublic DataTable executeDefaultGetter(java.lang.String name, CallerController caller, boolean check) throws ContextException
ContextExceptionpublic DataTable executeDefaultGetter(java.lang.String name, CallerController caller, boolean check, boolean createDefault) throws ContextException
ContextExceptionprotected DataTable executeDefaultGetterImpl(VariableDefinition vd, CallerController caller) throws ContextException
ContextExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic DataTable getVariable(java.lang.String name, CallerController caller, RequestController request) throws ContextException
ContextIllegalStateException on every change.getVariable in interface Context<C extends Context>ContextExceptionpublic DataTable getVariable(java.lang.String name, CallerController caller) throws ContextException
ContextIllegalStateException on every change.getVariable in interface Context<C extends Context>ContextExceptionpublic DataTable getVariable(java.lang.String name) throws ContextException
ContextIllegalStateException on every change.getVariable in interface Context<C extends Context>ContextExceptionpublic DataTable getVariableClone(java.lang.String name, CallerController caller) throws ContextException
ContextgetVariableClone in interface Context<C extends Context>ContextExceptionprotected DataTable getVariableImpl(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionpublic java.lang.Object getVariableObject(java.lang.String name,
CallerController caller)
ContextgetVariableObject in interface Context<C extends Context>protected void variableUpdated(VariableDefinition def, CallerController caller, RequestController request, DataTable value, DataTable valueOld) throws ContextException
ContextExceptionprotected void fireUpdatedEvent(VariableDefinition def, CallerController caller, RequestController request, DataTable value, DataTable valueOld) throws ContextException
ContextExceptionpublic void fireChangeEvent(VariableDefinition def, CallerController caller, java.util.Date timestamp, DataTable value)
protected boolean isAllowUpdatedEvents(VariableDefinition def)
protected void setupVariables()
throws ContextException
ContextExceptionpublic DataTable getDefaultValue(VariableDefinition def)
public void executeDefaultSetter(java.lang.String name,
CallerController caller,
DataTable value)
throws ContextException
ContextExceptionpublic void executeDefaultSetter(VariableDefinition def, CallerController caller, DataTable value) throws ContextException
ContextExceptionprotected void executeDefaultSetterImpl(VariableDefinition vd, CallerController caller, DataTable value) throws ContextException
ContextExceptionpublic void setVariable(java.lang.String name,
CallerController caller,
RequestController request,
DataTable value)
throws ContextException
Contextvalue.setVariable in interface Context<C extends Context>ContextExceptionpublic void setVariable(java.lang.String name,
CallerController caller,
DataTable value)
throws ContextException
Contextvalue.setVariable in interface Context<C extends Context>ContextExceptionpublic void setVariable(java.lang.String name,
DataTable value)
throws ContextException
Contextvalue.setVariable in interface Context<C extends Context>ContextExceptionpublic void setVariable(java.lang.String name,
CallerController caller,
java.lang.Object... value)
throws ContextException
Contextvalue.setVariable in interface Context<C extends Context>ContextExceptionpublic void setVariable(java.lang.String name,
java.lang.Object... value)
throws ContextException
Contextvalue.setVariable in interface Context<C extends Context>ContextExceptionprotected boolean setVariableImpl(VariableDefinition def, CallerController caller, RequestController request, DataTable value) throws ContextException
ContextExceptionprotected boolean isAllowSetterExecution(VariableDefinition data, RequestController request, DataTable value) throws ContextException
ContextExceptionpublic boolean setVariableField(java.lang.String variable,
java.lang.String field,
java.lang.Object value,
CallerController cc)
throws ContextException
ContextsetVariableField in interface Context<C extends Context>ContextExceptionpublic boolean setVariableField(java.lang.String variable,
java.lang.String field,
int record,
java.lang.Object value,
CallerController cc,
RequestController request)
throws ContextException
setVariableField in interface Context<C extends Context>ContextExceptionpublic void setVariableField(java.lang.String variable,
java.lang.String field,
java.lang.Object value,
java.lang.String compareField,
java.lang.Object compareValue,
CallerController cc)
throws ContextException
ContextsetVariableField in interface Context<C extends Context>ContextExceptionpublic void addVariableRecord(java.lang.String variable,
CallerController cc,
DataRecord record)
throws ContextException
ContextExceptionpublic void addVariableRecord(java.lang.String variable,
CallerController cc,
java.lang.Object... recordData)
throws ContextException
ContextExceptionpublic void removeVariableRecords(java.lang.String variable,
CallerController cc,
java.lang.String field,
java.lang.Object value)
throws ContextException
ContextExceptionprotected DataTable callFunction(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionprotected void setupFunctions()
throws ContextException
ContextExceptionpublic DataTable callFunction(java.lang.String name, CallerController caller, RequestController request, DataTable parameters) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name, CallerController caller, DataTable parameters) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name, DataTable parameters) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name, CallerController caller) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name, CallerController caller, java.lang.Object... parameters) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionpublic DataTable callFunction(java.lang.String name, java.lang.Object... parameters) throws ContextException
Contextparameters and returns its output.callFunction in interface Context<C extends Context>ContextExceptionprotected DataTable callFunctionImpl(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic void addVariableDefinition(VariableDefinition def)
ContextaddVariableDefinition in interface Context<C extends Context>protected void fireVariableAdded(VariableDefinition def)
public void removeVariableDefinition(java.lang.String name)
ContextremoveVariableDefinition in interface Context<C extends Context>public java.util.List<VariableDefinition> updateVariableDefinitions(java.util.Map<java.lang.String,VariableDefinition> source, java.lang.String baseGroup, boolean skipRemoval, boolean removeValues, java.lang.Object owner)
updateVariableDefinitions in interface Context<C extends Context>protected void removeValues(VariableDefinition vd)
protected void onIllegalDefinitionUpdated(java.lang.String definitionName)
public void addFunctionDefinition(FunctionDefinition def)
ContextaddFunctionDefinition in interface Context<C extends Context>protected void fireFunctionAdded(FunctionDefinition def)
public void removeFunctionDefinition(java.lang.String name)
ContextremoveFunctionDefinition in interface Context<C extends Context>public java.util.List<FunctionDefinition> updateFunctionDefinitions(java.util.Map<java.lang.String,Pair<FunctionDefinition,java.lang.Boolean>> source, java.lang.String baseGroup, boolean skipRemoval, java.lang.Object owner)
updateFunctionDefinitions in interface Context<C extends Context>public void addEventDefinition(EventDefinition def)
ContextaddEventDefinition in interface Context<C extends Context>protected boolean updateFunctionAndAction(FunctionDefinition fd, boolean processAction, java.lang.Object owner)
public java.util.List<EventDefinition> updateEventDefinitions(java.util.Map<java.lang.String,EventDefinition> source, java.lang.String baseGroup, boolean skipRemoval, java.lang.Object owner)
updateEventDefinitions in interface Context<C extends Context>protected void fireEventAdded(EventDefinition def)
public void removeEventDefinition(java.lang.String name)
ContextremoveEventDefinition in interface Context<C extends Context>public VariableData getVariableData(java.lang.String name)
ContextgetVariableData in interface Context<C extends Context>public void addAlias(int entityType,
java.lang.String aliasName,
java.lang.String name)
public VariableDefinition getVariableDefinition(java.lang.String name)
ContextgetVariableDefinition in interface Context<C extends Context>public VariableDefinition getVariableDefinition(java.lang.String name, CallerController caller)
ContextgetVariableDefinition in interface Context<C extends Context>public FunctionData getFunctionData(java.lang.String name)
ContextgetFunctionData in interface Context<C extends Context>public FunctionDefinition getFunctionDefinition(java.lang.String name)
ContextgetFunctionDefinition in interface Context<C extends Context>public FunctionDefinition getFunctionDefinition(java.lang.String name, CallerController caller)
ContextgetFunctionDefinition in interface Context<C extends Context>public EventData getEventData(java.lang.String name)
ContextEventData of event with specified name.getEventData in interface Context<C extends Context>public EventDefinition getEventDefinition(java.lang.String name)
ContextgetEventDefinition in interface Context<C extends Context>public EventDefinition getEventDefinition(java.lang.String name, CallerController caller)
ContextgetEventDefinition in interface Context<C extends Context>protected void setupEvents()
protected void postEvent(Event ev, EventDefinition ed, CallerController caller, FireEventRequestController request) throws ContextException
ContextExceptionprotected void updateEvent(Event ev, EventDefinition ed, CallerController caller, FireEventRequestController request) throws ContextException
ContextExceptionprotected Event fireEvent(EventDefinition ed, DataTable data, int level, java.lang.Long id, java.util.Date creationtime, java.lang.Integer listener, CallerController caller, FireEventRequestController request, Permissions permissions)
public Event fireEvent(java.lang.String name, FireEventRequestController request, java.lang.Object... data)
protected Event fireEvent(EventDefinition ed, Event event, java.lang.Integer listener, CallerController caller, FireEventRequestController request)
public Event fireEvent(java.lang.String name, int level, CallerController caller, FireEventRequestController request, Permissions permissions, DataTable data)
public Event fireEvent(java.lang.String name, DataTable data, int level, java.lang.Long id, java.util.Date creationtime, java.lang.Integer listener, CallerController caller, FireEventRequestController request)
Contextpublic Event fireEvent(java.lang.String name, DataTable data)
Contextpublic Event fireEvent(java.lang.String name, CallerController caller, DataTable data)
Contextpublic Event fireEvent(java.lang.String name, int level, DataTable data)
Contextpublic Event fireEvent(java.lang.String name, int level, CallerController caller, DataTable data)
Contextpublic Event fireEvent(java.lang.String name, int level, CallerController caller, FireEventRequestController request, DataTable data)
Contextpublic Event fireEvent(java.lang.String name)
Contextpublic Event fireEvent(java.lang.String name, CallerController caller)
Contextpublic Event fireEvent(java.lang.String name, java.lang.Object... data)
Contextprotected EventProcessingRule getEventProcessingRule(Event event)
protected void processBindings(Event event)
protected CallerController getEventProcessingCallerController()
public java.util.List<Event> getEventHistory(java.lang.String name)
ContextgetEventHistory in interface Context<C extends Context>public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toDetailedString()
ContexttoDetailedString in interface Context<C extends Context>public void accept(ContextVisitor visitor) throws ContextException
Contextaccept in interface Context<C extends Context>ContextExceptionprotected EventDefinition getChangeEventDefinition()
public DataTable getVvariables(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionprotected java.lang.String encodeFormat(TableFormat format, CallerController caller)
protected TableFormat decodeFormat(java.lang.String source, CallerController caller)
protected java.util.Optional<FormatCache> obtainFormatCache()
contextManagerpublic DataRecord varDefToDataRecord(VariableDefinition vd)
protected DataRecord varDefToDataRecord(VariableDefinition vd, CallerController caller)
public VariableDefinition varDefFromDataRecord(DataRecord rec)
public DataTable getVfunctions(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionpublic DataRecord funcDefToDataRecord(FunctionDefinition fd)
protected DataRecord funcDefToDataRecord(FunctionDefinition fd, CallerController caller)
public FunctionDefinition funcDefFromDataRecord(DataRecord rec)
public DataTable getVevents(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionpublic DataRecord evtDefToDataRecord(EventDefinition ed)
protected DataRecord evtDefToDataRecord(EventDefinition ed, CallerController caller)
public EventDefinition evtDefFromDataRecord(DataRecord rec)
public DataTable getVactions(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionpublic DataRecord actDefToDataRecord(ActionDefinition def)
protected void executeTasks(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks)
protected void executeTasks(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks,
double loadFactor)
protected void executeTasksConcurrently(java.util.List<java.util.concurrent.Callable<java.lang.Object>> tasks,
double loadFactor)
throws java.lang.Exception
ContextOperationExecutor as much as possible but without occupying 100% of
its threads. This is important to prevent deadlocks which may arise if some tasks being executed need to wait
for other children tasks that cannot be finished due to pool overwhelming. The method prevents it by always
leaving some part of the threads free (depending on their number and loadFactor value) and executing
separate tasks (not bunches) right in the current thread.tasks - a list of tasks to be executedloadFactor - a ratio of threads that can be utilized by this invocation, should be between 0.1 and 0.9java.lang.Exception - when concurrent execution is interrupted or single task invocation failsprotected void enableStatus()
throws ContextException
ContextExceptionpublic ContextStatus getStatus()
Contextpublic void setStatus(int status,
java.lang.String comment)
protected void fireStatusChanged(int status,
java.lang.String comment,
int oldStatus)
protected void enableVariableStatuses(boolean persistent)
protected void ensureVariableStatuses()
throws ContextException
ContextExceptionprotected boolean isBelongedToTheGroup(java.lang.String targetGroup,
java.lang.String entityGroup)
protected DataTable fetchVariableStatuses() throws ContextException
ContextExceptionpublic void updateVariableStatus(java.lang.String variable,
VariableStatus status,
boolean persistent)
throws ContextException
ContextExceptionprotected void clearVariableStatuses()
throws ContextException
ContextExceptionprotected void saveVariableStatuses()
throws ContextException
ContextExceptionprotected void persistVariableStatuses(DataTable statuses) throws ContextException
ContextExceptionpublic VariableStatus getVariableStatus(VariableDefinition variableDefinition) throws ContextException
ContextExceptionpublic DataTable getVchildren(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionpublic DataTable getVinfo(VariableDefinition def, CallerController caller, RequestController request) throws ContextException
ContextExceptionprotected DataTable createContextInfoTable()
public DataTable callFgetCopyData(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic DataTable callFcopy(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic DataTable callFupdateVariable(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic java.util.Set<java.lang.String> replicateVariableOnCopy(java.lang.String variableName,
DataTable variableValue,
DataTable targetValue,
java.util.List<java.lang.String> fields,
CallerController caller)
public DataTable callFcopyToChildren(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionprotected DataTable copyTo(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters, java.util.List<C> children)
public DataTable callFgetAliases(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic DataTable callFfireContextEvent(FunctionDefinition def, CallerController caller, RequestController request, DataTable parameters) throws ContextException
ContextExceptionpublic boolean isDebuggingEvaluations()
isDebuggingEvaluations in interface EvaluationPointpublic void processEvaluation(Evaluator evaluator, Expression expression, Reference holder, java.lang.Object result, NodeEvaluationDetails details)
processEvaluation in interface EvaluationPointpublic void processEvaluationError(Evaluator evaluator, Expression expression, Reference holder, java.lang.Exception error, NodeEvaluationDetails details)
processEvaluationError in interface EvaluationPointpublic boolean isInstallationAllowed(java.lang.String installableName)
ContextisInstallationAllowed in interface Context<C extends Context>protected void logAsyncSessionExecutionAction(CallerController caller, RequestController requestController, ContextOperationType operationType, java.lang.String entityName, DataTable parameters, DataTable output, long duration) throws ContextException
ContextExceptionprotected void validateVariableValueToSet(VariableDefinition variableDefinition, DataTable value) throws ContextException
ContextExceptionprotected java.util.Map<java.lang.String,VariableData> getVariableDataView()
protected java.util.Map<java.lang.String,FunctionData> getFunctionDataView()
protected java.util.Map<java.lang.String,EventData> getEventDataView()