psdi.server.event

Class EventTopic

  • java.lang.Object
    • psdi.server.event.EventTopic
    • Field Detail

      • subject

        protected java.lang.String subject
    • Constructor Detail

      • EventTopic

        public EventTopic(java.lang.String subject)
    • Method Detail

      • setExtendedSubIds

        public void setExtendedSubIds(java.util.Map idMap)
      • getExtendedSubIds

        public java.util.Map getExtendedSubIds()
      • getSubject

        public java.lang.String getSubject()
        Returns event topic name.
      • getSubTopicTree

        public EventTopicTree getSubTopicTree()
        Returns the sub topic tree from this node.
      • setActive

        public void setActive(boolean value)
        Used by AdminModeManager to activate and inactivate the EventTopic.
        Parameters:
        value - True to set Active, False to set Inactive.
      • isActive

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

        public void eventValidate(EventMessage msg)
                           throws MXException
        Runs through all the subscriptons to see if there are any vetoable exceptions. If any subscription throws vetoable exceptions, then the transaction is rolled back, if there are none, then the action is done on all the successfully evaluated subscriptions.
        Throws:
        MXException
      • eventAction

        public void eventAction(EventMessage msg)
                         throws MXException
        action is taken on all subscriptions that returned validate. The action is called only if there was no vetoable exception.
        Throws:
        MXException
      • preSaveEventAction

        public void preSaveEventAction(EventMessage msg)
                                throws MXException
        The action is taken before writing to the database on all subscriptions that returned successful validate. The action is called only if there was no vetoable exception.
        Throws:
        MXException
      • preSaveInternalEventAction

        public void preSaveInternalEventAction(EventMessage msg)
                                        throws MXException
        The action is taken before writing to the database on all subscriptions that returned successful validate. The action is called only if there was no vetoable exception.
        Throws:
        MXException
      • postSaveInternalEventAction

        public void postSaveInternalEventAction(EventMessage msg)
                                         throws MXException
        The action is taken after writing to the database on all subscriptions The action is called only if there was no vetoable exception.
        Throws:
        MXException
      • postCommitEventAction

        public void postCommitEventAction(EventMessage msg)
                                   throws MXException
        The action is taken after commiting to the database on all subscriptions that returned successful validate. If the transaction reaches to commit stage, all the listeners of the event will be fired, disregard whether the validation has been successful for the listener. The listerner is responsible to remember the validate result if needed.
        Throws:
        MXException
      • getEventTopic

        public EventTopic getEventTopic(java.lang.String subject)
                                 throws MXException
        getEventTopic searches the whole event topic tree for an eventTopic. If found returns the EventTopic, if not returns null.
        Throws:
        MXException
      • getListeners

        public java.util.Map getListeners()
      • getListenerCount

        public int getListenerCount()
      • getSubscriptionId

        public int getSubscriptionId(EventListener evt)
        Returns the subscription id for the event listener object.
        Parameters:
        EventListener - evt - The listener class that was registered.
        Returns:
        id of the class or -1 if not found.
      • getSubscriptionIdByClassName

        public int getSubscriptionIdByClassName(EventListener evt)
        Returns the subscription id for the event listener class.
        Parameters:
        EventListener - evt - The listener class that was registered.
        Returns:
        id of the class or -1 if not found.