Class MessageHandlerManager


  • public class MessageHandlerManager
    extends java.lang.Object
    • Constructor Detail

      • MessageHandlerManager

        public MessageHandlerManager​(java.lang.String projectName,
                                     ScriptManager manager,
                                     IScriptsEnabled scriptsEnabled,
                                     java.util.Map<MessageHandlerKey,​java.lang.String> messageHandlerScripts)
        Parameters:
        messageHandlerScripts - %lt;MessageHandlerKey, String scriptCode>
    • Method Detail

      • processMessage

        public void processMessage​(java.lang.String handlerName,
                                   org.python.core.PyDictionary messagePayload,
                                   java.util.Properties filterParams)
                            throws MessageHandlerException
        Runs the Jython script that is defined in the specified message handler of this client/gateway. If the message handler cannot be found, an error is thrown.
        Parameters:
        handlerName - is required. An exception is thrown if the message handler name is null or the specified handler does not exist.
        messagePayload - is required. Pass an empty dictionary if there are no parameters.
        filterParams - may be null. Used to transport zone/roles of originator
        Throws:
        MessageHandlerException - if message handler does not exist or required permissions not met.
      • processRequest

        public void processRequest​(@Nonnull
                                   java.lang.String handlerName,
                                   @Nonnull
                                   org.python.core.PyDictionary messagePayload,
                                   @Nullable
                                   MessageResultHandler resultHandler,
                                   @Nullable
                                   java.util.Properties filterParams)
                            throws MessageHandlerException
        Runs the Jython script that is defined in the specified message handler of this client/gateway. If the request handler cannot be found, an error is thrown.
        Parameters:
        handlerName - is required. An exception is thrown if the message handler name is null or the specified handler does not exist.
        messagePayload - is required. Pass an empty dictionary if there are no parameters.
        resultHandler - may be null. Handles the request result.
        filterParams - may be null. Used to transport zone/roles of originator
        Throws:
        MessageHandlerException - if message handler does not exist or required permissions not met.
      • shutdown

        public void shutdown()
      • reportExecution

        public void reportExecution​(MessageHandlerKey key,
                                    ScriptExecutionReport report)
        Called by MessageHanderRunnables every time one starts executing. By doing this, the user can later see the status of each handler.
      • getScriptExecutionReports

        public java.util.List<ScriptExecutionReport> getScriptExecutionReports()
        Returns a list of ScriptExecution reports, which gives the status of the last known state of all the message handlers.