Interface EventContext

    • Method Detail

      • getArguments

        Object[] getArguments()
        Gets event data. More objects can be associated with an event.

        For this reason an array of objects is returned. This array is usually representing the arguments of the operation that raised the event.

        Returns:
        the event data
      • getProperties

        Map<String,​Serializable> getProperties()
        Gets the events properties.

        Event properties are used to attach random information to an event context and can be set by the event source or by any listener that is processing the event. These properties usually serves to share data between the source and the listeners.

        Returns:
        the event properties
      • setProperties

        void setProperties​(Map<String,​Serializable> properties)
        Replaces all properties with the given ones. The given map is set as is - no copy occurs.
        Parameters:
        properties - the properties to use
      • setProperty

        void setProperty​(String key,
                         Serializable value)
        Sets a event context property
        Parameters:
        key - the property key
        value - the property value
      • getProperty

        Serializable getProperty​(String key)
        Gets the named property from this context or null if not exists.
        Parameters:
        key - the property key
        Returns:
        the property, or null if it does not exist
      • hasProperty

        boolean hasProperty​(String key)
        Tests whether or not the given property exists.
        Parameters:
        key - the property to test
        Returns:
        true if the named property was set, false otherwise
      • getCoreSession

        CoreSession getCoreSession()
        Gets the current core session if any.
        Returns:
        the core session, or null if none
      • getPrincipal

        NuxeoPrincipal getPrincipal()
        Gets the current principal.
        Returns:
        the principal. Cannot be null.
      • setCoreSession

        void setCoreSession​(CoreSession session)
        Sets the core session.
      • setPrincipal

        void setPrincipal​(NuxeoPrincipal principal)
        Sets the principal.
      • newEvent

        Event newEvent​(String name)
        Creates a new event in that context given the event name. The default flags for the event will be used.
        Parameters:
        name - the event name
        Returns:
        the event
        See Also:
        newEvent(String, int)
      • newEvent

        Event newEvent​(String name,
                       int flags)
        Creates a new event in that context given the event name. The given flags will be applied on the event.
        Parameters:
        name - the event name
        flags - the event flags to use
        Returns:
        the event
      • getRepositoryName

        String getRepositoryName()
        Returns the repository name associated to the event context, if any.
        Returns:
        the repository name
      • setRepositoryName

        void setRepositoryName​(String repositoryName)
        Sets the repository name. Only used if no CoreSession is available.
        Parameters:
        repositoryName - the repository name, or null