Interface ApplicationRouter

All Known Implementing Classes:
ApplicationRouterImpl

public interface ApplicationRouter
Routes messages to the appropriate application.
Author:
Bryan Tripp
  • Field Details

  • Method Details

    • processMessage

      Attempts to route the given message to the associated Application and obtain a response.
      Parameters:
      theMessage - the message to route
      Returns:
      the response message (this may be null, for example if the given message doesn't require an application ACK)
      Throws:
      HL7Exception
    • hasActiveBinding

      Parameters:
      theRoutingData - message fields used in determining the appropriate destination
      Returns:
      true if there is a destination application for messages with the given characteristics
    • bindApplication

      void bindApplication(ApplicationRouter.AppRoutingData theRoutingData, ReceivingApplication<? extends Message> theApplication)

      Associates the given application with the given message parameters, so that messages with matching parameters will be sent there. Only one application can be registered for a given set of parameters: repeated registration for a particular combination over-writes the previous one.

      Because of wildcards, there may be multiple registrations that match a given message. In this case, the first registered wins.

      Parameters:
      theRoutingData - message fields used in determining the appropriate destination
      theApplication - the application to which messages with these parameters should be sent
    • unbindApplication

      Removes the binding for the given message parameters
      Parameters:
      theRoutingData -
      Returns:
      true if an application was unbound, false otherwise
    • unbindApplication

      boolean unbindApplication(ReceivingApplication<? extends Message> theApplication)
      Removes the binding for the given message parameters
      Parameters:
      theApplication -
      Returns:
      true if an application was unbound, false otherwise
    • disableBinding

      Temporarily deactivates the binding on the given field data, if present.
      Parameters:
      theRoutingData - the fields that define a set of messages that are bound to some Application
    • enableBinding

      Undoes disableBinding(AppRoutingData theRoutingData).
      Parameters:
      theRoutingData - the fields that define a set of messages that are bound to some Application
    • getParser

      Returns:
      the Parser that is used to parse inbound messages and encode outbound ones. It may be of interest to set certain parameters of this parser.
    • setExceptionHandler

      Sets an exception handler which will be invoked in the event of a failure during parsing, processing, or encoding of an incoming message or its response.