com.tibbo.aggregate.common.context

## Interface Context<C extends Context>

- All Superinterfaces:
    java.lang.Comparable<C>, EvaluationPoint
  All Known Subinterfaces:
    DeviceContext<C>, GroupContext<C>, ServerContext<C>
  All Known Implementing Classes:
    AbstractContext, AgentContext, ProxyContext

      public interface Context<C extends Context>
      extends java.lang.Comparable<C>, EvaluationPoint

  Context interface is used to provide a unified way to access any object in AggreGate. It may be some server object (e.g. alert or event filters storage), hardware device or widget component. When server contexts are accessed remotely, so-called proxy contexts are created for operating server-side objects through the same interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(ContextVisitor visitor)` Accepts context visitor, i.e. calls visitor.visit(this).
    `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` | `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.
    `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.
    `void` | `destroy(boolean moving)` Permanently destroys this context.
    `void` | `destroyChild(C child, boolean moving)` Permanently destroys child of current context.
    `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, DataTable data)` Fires context event.
    `Event` | `fireEvent(java.lang.String name, java.lang.Object... data)` Fires context event.
    `C` | `get(java.lang.String path)` Returns context with the selected path.
    `C` | `get(java.lang.String path, 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.
    `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`.
    `Permissions` | `getChildrenViewPermissions()` Returns permissions required to access children of this context.
    `ContextManager` | `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.
    `java.lang.String` | `getDescription()` Returns context description.
    `EventData` | `getEventData(java.lang.String name)` Returns `EventData` of event with specified name.
    `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.
    `FunctionData` | `getFunctionData(java.lang.String name)` Returns data of function with specified name.
    `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.
    `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` | `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.
    `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`.
    `java.lang.Object` | `getVariableObject(java.lang.String name, CallerController caller)` Returns value of variable as bean or list of beans.
    `java.util.List<C>` | `getVisibleChildren()` Returns list of visible children contexts.
    `java.util.List<C>` | `getVisibleChildren(CallerController caller)` Returns list of visible children contexts.
    `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.
    `boolean` | `isContainer()` Returns true if context is container.
    `boolean` | `isDistributed()` Returns true if context has a remote peer in the distributed architecture.
    `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 installableItemName)` 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` | `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.
    `void` | `move(C newParent, java.lang.String newName)` Moves and/or renames the context.
    `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` | `removeFunctionDefinition(java.lang.String name)` Removes function definition from this context.
    `void` | `removeVariableDefinition(java.lang.String name)` Removes variable definition from this context.
    `void` | `setParent(C parent)`
    `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` | `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`.
    `default boolean` | `setVariableField(java.lang.String variable, java.lang.String field, int record, java.lang.Object value, CallerController cc)` Gets variable, updates field value in the specified record, and sets variable.
    `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.
    `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.util.List<EventDefinition>` | `updateEventDefinitions(java.util.Map<java.lang.String,EventDefinition> eventDefinitionMap, java.lang.String baseGroup, boolean skipRemoval, java.lang.Object owner)`
    `java.util.List<FunctionDefinition>` | `updateFunctionDefinitions(java.util.Map<java.lang.String,Pair<FunctionDefinition,java.lang.Boolean>> functionDefinitionMap, 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> variableDefinitionMap, java.lang.String baseGroup, boolean skipRemoval, boolean onDestroy, java.lang.Object owner)`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

    - ### Methods inherited from interface com.tibbo.aggregate.common.expression.EvaluationPoint

      `isDebuggingEvaluations, processEvaluation, processEvaluationError`

- - ### Method Detail

    - #### 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. Note, that default implementation of this method in AbstractContext calls tree methods: setupPermissions(), setupMyself() and setupChildren(). These methods should provide initialization logic in inherited classes instead of overridden setup() method.
      Parameters:
        `contextManager` - ContextManager heading current context tree

    - #### teardown

          void teardown()

      This method is called when the context is being removed from context tree..

    - #### isSetupComplete

          boolean isSetupComplete()

      This method should return true if the context has already been initialized and setupMyself() finished execution. Its default implementation in AbstractContext should not be overridden.
      Returns:
        true if setupMyself() has already been completed.

    - #### isInitializedStatus

          boolean isInitializedStatus()

      This method should return true if the context status has already been initialized.
      Returns:
        true if basic context status has been initialized.

    - #### isInitializedInfo

          boolean isInitializedInfo()

      This method should return true if the context has already been initialized its basic information (description, type, etc).
      Returns:
        true if basic context information has been initialized.

    - #### isInitializedChildren

          boolean isInitializedChildren()

      This method should return true if the context has already been initialized its children.
      Returns:
        true if context children have been initialized.

    - #### isInitializedVariables

          boolean isInitializedVariables()

      This method should return true if the context has already been initialized its variables.
      Returns:
        true if context variables have been initialized.

    - #### isInitializedFunctions

          boolean isInitializedFunctions()

      This method should return true if the context has already been initialized its functions.
      Returns:
        true if context functions have been initialized.

    - #### isInitializedEvents

          boolean isInitializedEvents()

      This method should return true if the context has already been initialized its events.
      Returns:
        true if context events have been initialized.

    - #### start

          void start()

      This method is called when context tree is being started after its initialization. All contexts in the tree should be available at the moment of call.

    - #### stop

          void stop()

      This method is called when context tree is being stopped before its de-initialization. All contexts in the tree should be available at the moment of call.

    - #### isStarted

          boolean isStarted()

      Returns true if context was started but not yet stopped.

    - #### getName

          java.lang.String getName()

      Returns context name.

    - #### getPath

          java.lang.String getPath()

      Returns context path (full name).

    - #### getLocalRoot

          java.lang.String getLocalRoot(boolean withParent)

      Returns path of the root context. In distributed environment, returns path of the root context in remote (mounted) subtree.

    - #### getPeerPath

          java.lang.String getPeerPath()

      In distributed environment, returns path of the context on the server immediately connected to current server (current server's peer).

    - #### getPeerRoot

          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. If current context doesn't have a remote peer, this method returns null.

    - #### getRemotePath

          java.lang.String getRemotePath()

      In distributed environment, returns path of the context on the server where it's actually defined.

    - #### getRemoteRoot

          java.lang.String getRemoteRoot()

      Returns path of remote server's root context within a distributed connection.

    - #### getLocalPrimaryRoot

          java.lang.String getLocalPrimaryRoot()

      In distributed environment, returns path of the primary mount context in local tree.

    - #### isProxy

          boolean isProxy()

      Returns true if context is a remote context's proxy.

    - #### isDistributed

          boolean isDistributed()

      Returns true if context has a remote peer in the distributed architecture.

    - #### isContainer

          boolean isContainer()

      Returns true if context is container.

    - #### toDetailedString

          java.lang.String toDetailedString()

      Returns context detailed description that includes description and path.

    - #### getDescription

          java.lang.String getDescription()

      Returns context description.

    - #### getType

          java.lang.String getType()

      Returns context type.

    - #### getGroup

          java.lang.String getGroup()

      Returns context group name of NULL if context does not belong to a group.

    - #### getIndex

          java.lang.Integer getIndex()

      Returns context comparison index or NULL if index is not defined.

    - #### getIconId

          java.lang.String getIconId()

      Returns context icon ID.

    - #### getStatus

          ContextStatus getStatus()

      Returns context status or null if status is not enabled;

    - #### getContextManager

          ContextManager getContextManager()

      Returns context manager those context tree contains this context.

    - #### getChildren

          java.util.List<C> getChildren(CallerController caller)

      Returns list of children contexts that are accessible by the specified `CallerController`.

    - #### getChildren

          java.util.List<C> getChildren()

      Returns list of children contexts.

    - #### getVisibleChildren

          java.util.List<C> getVisibleChildren(CallerController caller)

      Returns list of visible children contexts.

    - #### getVisibleChildren

          java.util.List<C> getVisibleChildren()

      Returns list of visible children contexts.

    - #### hasVisibleChild

          boolean hasVisibleChild(java.lang.String name,
                                  CallerController caller)
                           throws ContextException

      Check if the visible child of the context is available.
      Throws:
        `ContextException`

    - #### isMapped

          boolean isMapped()

      Returns true if context's visible children are mapped (e.g. for group and aggregation contexts).

    - #### getMappedChildren

          java.util.List<C> getMappedChildren(CallerController caller)

      Returns list of mapped children contexts.

    - #### getMappedChildren

          java.util.List<C> getMappedChildren()

      Returns list of mapped children contexts.

    - #### getRoot

          C getRoot()

      Returns root context of the context tree containing this context.

    - #### get

          C get(java.lang.String path,
                CallerController caller)

      Returns context with the selected path. `path` argument may be absolute of relative to this context. This method uses provided `CallerController` for permission checking.

    - #### get

          C get(java.lang.String path)

      Returns context with the selected path. `path` 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.

    - #### getChild

          C getChild(java.lang.String name,
                     CallerController caller)

      Returns child of this context with the specified name. `path` 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.

    - #### getChild

          C getChild(java.lang.String name)

      Returns child of this context with the specified name.

    - #### hasMappedChild

          boolean hasMappedChild(java.lang.String contextName,
                                 CallerController callerController)

      Check if the mapped child of this context is available.

    - #### addChild

          void addChild(C child)

      Adds new child to the current context.

    - #### removeChild

          void removeChild(C child)

      Removes child of current context.

    - #### removeChild

          void removeChild(java.lang.String name)

      Removes child with specified name.

    - #### destroyChild

          void destroyChild(C child,
                            boolean moving)

      Permanently destroys child of current context.

    - #### destroy

          void destroy(boolean moving)

      Permanently destroys this context.

    - #### updatePrepare

          void updatePrepare()

      Prepare context to update.

    - #### move

          void move(C newParent,
                    java.lang.String newName)
             throws ContextException

      Moves and/or renames the context.
      Throws:
        `ContextException`

    - #### getParent

          C getParent()

      Returns parent of this context.

    - #### setParent

          void setParent(C parent)

    - #### hasParent

          boolean hasParent(C parentContext)

      Returns true if parentContext is a parent of this context or some of its parents.

    - #### addVariableDefinition

          void addVariableDefinition(VariableDefinition def)

      Adds variable definition to this context.

    - #### removeVariableDefinition

          void removeVariableDefinition(java.lang.String name)

      Removes variable definition from this context.

    - #### getVariableData

          VariableData getVariableData(java.lang.String name)

      Returns data of variable with specified name.

    - #### addAlias

          void addAlias(int entityType,
                        java.lang.String aliasName,
                        java.lang.String name)

    - #### getVariableDefinition

          VariableDefinition getVariableDefinition(java.lang.String name)

      Returns definition of variable with specified name.

    - #### getVariableDefinition

          VariableDefinition getVariableDefinition(java.lang.String name,
                                                   CallerController caller)

      Returns definition of variable with specified name if it's accessible by caller controller.

    - #### getVariableDefinitions

          java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller)

      Returns list of variables available for specified `CallerController`.

    - #### getVariableDefinitions

          java.util.List<VariableDefinition> getVariableDefinitions()

      Returns list of variables.

    - #### getVariableDefinitions

          java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller,
                                                                    java.lang.String group)

      Returns list of variables belonging to `group` that are available for specified `CallerController`.

    - #### getVariableDefinitions

          java.util.List<VariableDefinition> getVariableDefinitions(java.lang.String group)

      Returns list of variables belonging to `group`.

    - #### getVariableDefinitions

          java.util.List<VariableDefinition> getVariableDefinitions(CallerController caller,
                                                                    boolean includeHidden)

      Returns list of variables.

    - #### addFunctionDefinition

          void addFunctionDefinition(FunctionDefinition def)

      Adds function definition to this context.

    - #### removeFunctionDefinition

          void removeFunctionDefinition(java.lang.String name)

      Removes function definition from this context.

    - #### getFunctionData

          FunctionData getFunctionData(java.lang.String name)

      Returns data of function with specified name.

    - #### getFunctionDefinition

          FunctionDefinition getFunctionDefinition(java.lang.String name)

      Returns definition of function with specified name.

    - #### getFunctionDefinition

          FunctionDefinition getFunctionDefinition(java.lang.String name,
                                                   CallerController caller)

      Returns definition of function with specified name if it's accessible by caller controller.

    - #### getFunctionDefinitions

          java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller)

      Returns list of functions available for specified `CallerController`.

    - #### getFunctionDefinitions

          java.util.List<FunctionDefinition> getFunctionDefinitions()

      Returns list of functions.

    - #### getFunctionDefinitions

          java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller,
                                                                    java.lang.String group)

      Returns list of functions belonging to `group` that are available for specified `CallerController`.

    - #### getFunctionDefinitions

          java.util.List<FunctionDefinition> getFunctionDefinitions(java.lang.String group)

      Returns list of functions belonging to `group`.

    - #### getFunctionDefinitions

          java.util.List<FunctionDefinition> getFunctionDefinitions(CallerController caller,
                                                                    boolean includeHidden)

      Returns list of functions.

    - #### addEventDefinition

          void addEventDefinition(EventDefinition def)

      Adds event definition to this context.

    - #### removeEventDefinition

          void removeEventDefinition(java.lang.String name)

      Removes event definition from this context.

    - #### getEventDefinition

          EventDefinition getEventDefinition(java.lang.String name)

      Returns definition of event with specified name.

    - #### getEventDefinition

          EventDefinition getEventDefinition(java.lang.String name,
                                             CallerController caller)

      Returns definition of event with specified name if it's accessible by caller controller.

    - #### getEventData

          EventData getEventData(java.lang.String name)

      Returns `EventData` of event with specified name.

    - #### getEventDefinitions

          java.util.List<EventDefinition> getEventDefinitions(CallerController caller)

      Returns list of events available for specified `CallerController`.

    - #### getEventDefinitions

          java.util.List<EventDefinition> getEventDefinitions()

      Returns list of events.

    - #### getEventDefinitions

          java.util.List<EventDefinition> getEventDefinitions(CallerController caller,
                                                              java.lang.String group)

      Returns list of events belonging to `group` that are available for specified `CallerController`.

    - #### getEventDefinitions

          java.util.List<EventDefinition> getEventDefinitions(java.lang.String group)

      Returns list of events belonging to `group`.

    - #### getEventDefinitions

          java.util.List<EventDefinition> getEventDefinitions(CallerController caller,
                                                              boolean includeHidden)

      Returns list of events.

    - #### getVariable

          DataTable getVariable(java.lang.String name,
                                CallerController caller,
                                RequestController request)
                         throws ContextException

      Gets variable from context and returns its value. The value is immutable and will generate `IllegalStateException` on every change.
      Throws:
        `ContextException`

    - #### getVariable

          DataTable getVariable(java.lang.String name,
                                CallerController caller)
                         throws ContextException

      Gets variable from context and returns its value. The value is immutable and will generate `IllegalStateException` on every change.
      Throws:
        `ContextException`

    - #### getVariable

          DataTable getVariable(java.lang.String name)
                         throws ContextException

      Gets variable from context and returns its value. The value is immutable and will generate `IllegalStateException` on every change.
      Throws:
        `ContextException`

    - #### getVariableClone

          DataTable getVariableClone(java.lang.String name,
                                     CallerController caller)
                              throws ContextException

      Gets variable from context and returns its value. The value is mutable. Method has lower performance comparing to 'getVariable'.
      Throws:
        `ContextException`

    - #### getVariableObject

          java.lang.Object getVariableObject(java.lang.String name,
                                             CallerController caller)

      Returns value of variable as bean or list of beans.

    - #### setVariable

          void setVariable(java.lang.String name,
                           CallerController caller,
                           DataTable value)
                    throws ContextException

      Sets context variable to specified `value`.
      Throws:
        `ContextException`

    - #### setVariable

          void setVariable(java.lang.String name,
                           CallerController caller,
                           RequestController request,
                           DataTable value)
                    throws ContextException

      Sets context variable to specified `value`.
      Throws:
        `ContextException`

    - #### setVariable

          void setVariable(java.lang.String name,
                           CallerController caller,
                           java.lang.Object... value)
                    throws ContextException

      Sets context variable to specified `value`.
      Throws:
        `ContextException`

    - #### setVariable

          void setVariable(java.lang.String name,
                           DataTable value)
                    throws ContextException

      Sets context variable to specified `value`.
      Throws:
        `ContextException`

    - #### setVariable

          void setVariable(java.lang.String name,
                           java.lang.Object... value)
                    throws ContextException

      Sets context variable to specified `value`.
      Throws:
        `ContextException`

    - #### setVariableField

          boolean setVariableField(java.lang.String variable,
                                   java.lang.String field,
                                   java.lang.Object value,
                                   CallerController cc)
                            throws ContextException

      Gets variable, updates field value in the first record, and sets variable.
      Throws:
        `ContextException`

    - #### setVariableField

          default boolean setVariableField(java.lang.String variable,
                                           java.lang.String field,
                                           int record,
                                           java.lang.Object value,
                                           CallerController cc)
                                    throws ContextException

      Gets variable, updates field value in the specified record, and sets variable.
      Throws:
        `ContextException`

    - #### setVariableField

          boolean setVariableField(java.lang.String variable,
                                   java.lang.String field,
                                   int record,
                                   java.lang.Object value,
                                   CallerController cc,
                                   @Nullable
                                   RequestController request)
                            throws ContextException

      Throws:
        `ContextException`

    - #### setVariableField

          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

      Gets variable, updates field value in the records for those value of compareField equals compareValue, and sets variable.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 CallerController caller,
                                 DataTable parameters)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 DataTable parameters)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 CallerController caller,
                                 RequestController request,
                                 DataTable parameters)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 CallerController caller,
                                 java.lang.Object... parameters)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 java.lang.Object... parameters)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### callFunction

          DataTable callFunction(java.lang.String name,
                                 CallerController caller)
                          throws ContextException

      Executes context function with specified `parameters` and returns its output.
      Throws:
        `ContextException`

    - #### fireEvent

          Event fireEvent(java.lang.String name)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          CallerController caller)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          DataTable data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          CallerController caller,
                          DataTable data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          int level,
                          DataTable data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          int level,
                          CallerController caller,
                          DataTable data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          int level,
                          CallerController caller,
                          FireEventRequestController request,
                          DataTable data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          java.lang.Object... data)

      Fires context event.
      Returns:
        Event object or null if event was suppressed by context.

    - #### fireEvent

          Event fireEvent(java.lang.String name,
                          FireEventRequestController request,
                          java.lang.Object... data)

    - #### fireEvent

          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.
      Returns:
        Event object or null if event was suppressed by context.

    - #### addActionDefinition

          void addActionDefinition(ActionDefinition def)

      Add a new action definition to the context.
      Parameters:
        `def` - ActionDefinition to add

    - #### removeActionDefinition

          void removeActionDefinition(java.lang.String name)

      Remove an action definition from the context.
      Parameters:
        `name` - Name of action to remove

    - #### getActionDefinition

          ActionDefinition getActionDefinition(java.lang.String name)

      Returns action definition by name.
      Parameters:
        `name` - Name of action

    - #### getActionDefinition

          ActionDefinition getActionDefinition(java.lang.String name,
                                               CallerController caller)

      Returns action definition by name.
      Parameters:
        `name` - Name of action
        `caller` - Caller controller

    - #### getDefaultActionDefinition

          ActionDefinition getDefaultActionDefinition(CallerController caller)

      Returns default action definition or NULL if there is no default action or it's not available to the caller.
      Parameters:
        `caller` - Caller controller

    - #### getActionDefinitions

          java.util.List<ActionDefinition> getActionDefinitions()

      Returns action definitions.

    - #### getActionDefinitions

          java.util.List<ActionDefinition> getActionDefinitions(CallerController caller)

      Returns action definitions that are accessible for the caller.
      Parameters:
        `caller` - Caller controller

    - #### getActionDefinitions

          java.util.List<ActionDefinition> getActionDefinitions(CallerController caller,
                                                                boolean includeHidden)

      Returns action definitions.

    - #### getPermissions

          Permissions getPermissions()

      Returns context permissions.

    - #### getChildrenViewPermissions

          Permissions getChildrenViewPermissions()

      Returns permissions required to access children of this context.

    - #### addEventListener

          boolean addEventListener(java.lang.String name,
                                   ContextEventListener listener)

      Adds listener of event with specified name.

    - #### addEventListener

          boolean addEventListener(java.lang.String name,
                                   ContextEventListener listener,
                                   boolean weak)

      Adds listener of event with specified name. This method allows to add auto-cleaned listeners by setting weak flag to true.

    - #### removeEventListener

          boolean removeEventListener(java.lang.String name,
                                      ContextEventListener listener)

      Removes listener of event with specified name.

    - #### getEventHistory

          java.util.List<Event> getEventHistory(java.lang.String name)

      Returns in-memory event history.

    - #### accept

          void accept(ContextVisitor visitor)
               throws ContextException

      Accepts context visitor, i.e. calls visitor.visit(this).
      Throws:
        `ContextException`

    - #### isInstallationAllowed

          boolean isInstallationAllowed(java.lang.String installableItemName)

      Check if an installation is permitted.

    - #### updateVariableDefinitions

          java.util.List<VariableDefinition> updateVariableDefinitions(java.util.Map<java.lang.String,VariableDefinition> variableDefinitionMap,
                                                                       java.lang.String baseGroup,
                                                                       boolean skipRemoval,
                                                                       boolean onDestroy,
                                                                       java.lang.Object owner)

    - #### updateFunctionDefinitions

          java.util.List<FunctionDefinition> updateFunctionDefinitions(java.util.Map<java.lang.String,Pair<FunctionDefinition,java.lang.Boolean>> functionDefinitionMap,
                                                                       java.lang.String baseGroup,
                                                                       boolean skipRemoval,
                                                                       java.lang.Object owner)

    - #### updateEventDefinitions

          java.util.List<EventDefinition> updateEventDefinitions(java.util.Map<java.lang.String,EventDefinition> eventDefinitionMap,
                                                                 java.lang.String baseGroup,
                                                                 boolean skipRemoval,
                                                                 java.lang.Object owner)