psdi.server.event

Class EventTopicTree

  • java.lang.Object
    • psdi.server.event.EventTopicTree
    • Constructor Detail

      • EventTopicTree

        public EventTopicTree()
        Default constructor
      • EventTopicTree

        public EventTopicTree(EventTopicTree gEventTopicTree)
        gEventTopicTree global event topic tree
    • Method Detail

      • setActive

        public void setActive(boolean value)
      • isActive

        public boolean isActive()
        Identifies whether this EventTopicTree is active.
        Returns:
        Value of isActive
      • getEventTopics

        public java.util.Hashtable getEventTopics()
        getEventTopics
      • findEventTopic

        public EventTopic findEventTopic(java.lang.String subject)
                                  throws MXException
        findEventTopic finds the eventTopic in the global tree. It searches the entire event topic tree for an eventTopic. If found returns an EventTopic, if not return null. If tree is inactive, return null.
        Parameters:
        subject - Subject of the Event to find.
        Throws:
        MXException
      • findEventTopic

        public EventTopic findEventTopic(java.lang.String subject,
                                         boolean isTenant)
                                  throws MXException
        findEventTopic searches the entire event topic tree for an eventTopic. If found returns an EventTopic, if not return null. If tree is inactive, return null.
        Parameters:
        subject - Subject of the Event to find.
        isTenant - Searches in Tenant tree when true. searches in the Global tree when false.
        Throws:
        MXException
      • getEventTopic

        public EventTopic getEventTopic(java.lang.String subject)
                                 throws MXException
        Gets the event topic from global tree. It searches the event topic tree for the given subject, If found returns the node, if not found, it creates the new event topic node and returns the node. If tree is inactive, return null.
        Parameters:
        subject - Subject of the Event to find.
        Throws:
        MXException
      • getEventTopic

        public EventTopic getEventTopic(java.lang.String subject,
                                        boolean isTenant)
                                 throws MXException
        Gets the event topic from global tree. It searches the event topic tree for the given subject, If found returns the node, if not found, it creates the new event topic node and returns the node. If tree is inactive, return null.
        Parameters:
        subject - Subject of the Event to find.
        isTenant - Searches in Tenant tree when true. searches in the Global tree when false.
        Throws:
        MXException
      • dumpEventTopicTree

        public java.util.Map dumpEventTopicTree(boolean isTenant)
                                         throws MXException
        Throws:
        MXException
      • printEventTopicTree

        public java.lang.String printEventTopicTree(boolean isTenant)
                                             throws MXException
        Returns the event topic tree. Used for debugging purpose.
        Parameters:
        isTenant - Searches in Tenant tree when true. searches in the Global tree when false.
        Throws:
        MXException
      • eventValidate

        public void eventValidate(java.lang.String subject,
                                  EventMessage msg,
                                  EventTopic topic)
                           throws MXException
        event validation method. The overloaded form Checks to see whether the event can be processed
        Throws:
        MXException
      • eventValidate

        public void eventValidate(java.lang.String subject,
                                  EventMessage msg)
                           throws MXException
        event validation method. Checks to see whether the event can be processed.
        Throws:
        MXException
      • eventAction

        public void eventAction(java.lang.String subject,
                                EventMessage msg,
                                EventTopic topic)
                         throws MXException
        event action method. Overloaded form. Action to be taken on the giving event topic. called only for valid subscriptions.
        Throws:
        MXException
      • eventAction

        public void eventAction(java.lang.String subject,
                                EventMessage msg)
                         throws MXException
        event action method. Action to be taken on the event. called only for valid subscriptions.
        Throws:
        MXException
      • preSaveEventAction

        public void preSaveEventAction(java.lang.String subject,
                                       EventMessage msg,
                                       EventTopic et)
                                throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • preSaveEventAction

        public void preSaveEventAction(java.lang.String subject,
                                       EventMessage msg)
                                throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • preSaveInternalEventAction

        public void preSaveInternalEventAction(java.lang.String subject,
                                               EventMessage msg,
                                               EventTopic et)
                                        throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • preSaveInternalEventAction

        public void preSaveInternalEventAction(java.lang.String subject,
                                               EventMessage msg)
                                        throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • postSaveInternalEventAction

        public void postSaveInternalEventAction(java.lang.String subject,
                                                EventMessage msg,
                                                EventTopic et)
                                         throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • postSaveInternalEventAction

        public void postSaveInternalEventAction(java.lang.String subject,
                                                EventMessage msg)
                                         throws MXException
        Pre Save event action method. Action to be taken on the event before writing to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • postCommitEventAction

        public void postCommitEventAction(java.lang.String subject,
                                          EventMessage msg)
                                   throws MXException
        Post Commit event action method. Action to be taken on the event after commiting to the database. Action is taken only for valid subscriptions.
        Throws:
        MXException
      • register

        public int register(java.lang.String topic,
                            EventListener evt)
                     throws MXException
        Registers the events on the global topic tree.
        Parameters:
        topic - Subject of the Event to register.
        evt - The event
        Throws:
        MXException
      • register

        public int register(java.lang.String topic,
                            EventListener evt,
                            boolean isTenant)
                     throws MXException
        Registers the events on the global topic tree.
        Parameters:
        topic - Subject of the Event to register.
        evt - The event
        isTenant - Register in Tenant tree when true, Register in the Global tree when false.
        Throws:
        MXException
      • unregister

        public void unregister(java.lang.String topic,
                               int id)
                        throws MXException
        method that unregisters the events on the global topic tree.
        Throws:
        MXException
      • unregister

        public void unregister(java.lang.String topic,
                               int id,
                               boolean isTenant)
                        throws MXException
        Unregister the events on the topic tree.
        Parameters:
        topic - Subject of the Event to unregister.
        evt - The event
        isTenant - Unregister in Tenant tree when true, Unregister in the Global tree when false.
        Throws:
        MXException
      • registerExtendsTopic

        public void registerExtendsTopic(java.lang.String topic,
                                         EventTopic et,
                                         EventListener evt,
                                         int parentId)
                                  throws MXException
        Register all extended objects for the main object
        Parameters:
        topic -
        et -
        evt -
        parentId -
        Throws:
        MXException
      • getEventTopicId

        public int getEventTopicId(java.lang.String topic,
                                   EventListener evt)
                            throws MXException
        Returns the subscription id of the event listener class.
        Parameters:
        topic - Event topic
        evt - Registered Event listener class
        Returns:
        returns the positive subscription id or -1 if not found.
        Throws:
        MXException
      • setTenantList

        public void setTenantList(java.util.List tenantList)