Package ca.uhn.hl7v2.protocol.impl

Examples of ca.uhn.hl7v2.protocol.impl.AppRoutingDataImpl


    @Converter
    public static Message toMessage(String body) throws HL7Exception {
        // replace \n with \r as HL7 uses 0x0d = \r as segment terminators and HAPI only parses with \r
        body = body.replace('\n', '\r');

        Parser parser = new PipeParser();
        Message message = parser.parse(body);
        return message;
    }
View Full Code Here


        }

        // convert to string
        String body;
        if (message instanceof Message) {
            Parser parser = new PipeParser();
            body = parser.encode((Message)message);
        } else if (message instanceof String) {
            body = (String)message;
        } else if (message instanceof byte[]) {
            body = new String((byte[])message);
        } else {
View Full Code Here

    Validate.propertySet(myRelayListener, "listener");
    Validate.propertySet(myRelaySender, "sender");

    ourLog.info("Binding sender[{}] to listener[{}] for messages with profile[MsgType:{} / MsgTrigger:{} / Version:{} / Processing:{}]", new Object[] { myRelaySender.getBeanName(), myRelayListener.getBeanName(), myMessageType, myTriggerEvent, myVersionId, myProcessingId });

    AppRoutingDataImpl appRoutingData = new AppRoutingDataImpl(myMessageType, myTriggerEvent, myProcessingId, myVersionId);
    myRelayListener.registerApplication(appRoutingData, myRelaySender);
  }
View Full Code Here

    Validate.propertySet(myRelayListener, "listener");
    Validate.propertySet(myRelaySender, "sender");

    ourLog.info("Binding sender[{}] to listener[{}] for messages with profile[MsgType:{} / MsgTrigger:{} / Version:{} / Processing:{}]", new Object[] { myRelaySender.getBeanName(), myRelayListener.getBeanName(), myMessageType, myTriggerEvent, myVersionId, myProcessingId });

    AppRoutingDataImpl appRoutingData = new AppRoutingDataImpl(myMessageType, myTriggerEvent, myProcessingId, myVersionId);
    myRelayListener.registerApplication(appRoutingData, myRelaySender);
  }
View Full Code Here

   * This method should not be called if {@link #setApplicationRouter(ApplicationRouter)} has been called
   * </p>
   */
  public void setApplication(ReceivingApplication theApplication) {
    myApplicationRouter = new ApplicationRouterImpl();
    myApplicationRouter.bindApplication(new AppRoutingDataImpl("*", "*", "*", "*"), theApplication);
  }
View Full Code Here

   * or triggerEvent means any type or event, respectively.
   */
  public synchronized void registerApplication(String messageType,
      String triggerEvent, Application handler) {
    ReceivingApplication handlerWrapper = new AppWrapper(handler);
    applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handlerWrapper);
  }
View Full Code Here

   * registration for a particular combination of type and trigger event
   * over-writes the previous one. Note that the wildcard "*" for messageType
   * or triggerEvent means any type or event, respectively.
   */
  public void registerApplication(String messageType, String triggerEvent, ReceivingApplication handler) {
    applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handler);
  }
View Full Code Here

  /**
   * Registers the given application to handle messages corresponding to ALL
   * message types and trigger events.
   */
  public synchronized void registerApplication(ReceivingApplication application) {
    registerApplication(new AppRoutingDataImpl("*", "*", "*", "*"), application);
  }
View Full Code Here

   * or triggerEvent means any type or event, respectively.
   */
  public synchronized void registerApplication(String messageType,
      String triggerEvent, Application handler) {
    ReceivingApplication handlerWrapper = new AppWrapper(handler);
    applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handlerWrapper);
  }
View Full Code Here

   * registration for a particular combination of type and trigger event
   * over-writes the previous one. Note that the wildcard "*" for messageType
   * or triggerEvent means any type or event, respectively.
   */
  public void registerApplication(String messageType, String triggerEvent, ReceivingApplication handler) {
    applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handler);
  }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.protocol.impl.AppRoutingDataImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.