Package ca.uhn.hl7v2.llp

Examples of ca.uhn.hl7v2.llp.LowerLayerProtocol


  public Connection attach(String host, int outboundPort, int inboundPort,
      Parser parser, Class<? extends LowerLayerProtocol> llpClass,
      boolean tls) throws HL7Exception {
    try {
      LowerLayerProtocol llp = llpClass.newInstance();
      return attach(host, outboundPort, inboundPort, parser, llp, tls);
    } catch (InstantiationException e) {
      throw new HL7Exception("Cannot open connection to " + host + ":"
          + outboundPort, e);
    } catch (IllegalAccessException e) {
View Full Code Here


      // set up connection to server
      String host = args[0];
      int port = Integer.parseInt(args[1]);

      final Parser parser = new PipeParser();
      LowerLayerProtocol llp = new MinLowerLayerProtocol();
      Connection connection = new Connection(parser, llp, new Socket(
          host, port));
      final Initiator initiator = connection.getInitiator();
      connection.activate();
      final String outText = "MSH|^~\\&|||||||ACK^^ACK|||R|2.4|\rMSA|AA";
View Full Code Here

  /**
   * @since 2.0
   */
  public Connection attach(String host, int outboundPort, int inboundPort, Parser parser,
    Class<? extends LowerLayerProtocol> llpClass, boolean tls) throws HL7Exception {
    LowerLayerProtocol llp = ReflectionUtil.instantiate(llpClass);
    return attach(host, outboundPort, inboundPort, parser, llp, tls);
  }
View Full Code Here

           
            try {
                if (args.length > 0) {
                    HL7Service service = null;
                    GenericParser parser = new GenericParser();
                    LowerLayerProtocol llp = LowerLayerProtocol.makeLLP();
                    int inPort = Integer.parseInt(args[0]);
                    if (args.length > 1) {
                        int outPort = Integer.parseInt(args[1]);
                        service = new TwoPortService(panel.getParser(), llp, inPort, outPort);
                    } else {
View Full Code Here

            //set up connection to server
            String host = args[0];
            int port = Integer.parseInt(args[1]);

            final Parser parser = new PipeParser();
            LowerLayerProtocol llp = LowerLayerProtocol.makeLLP();
            Connection connection = new Connection(parser, llp, new Socket(host, port));
            final Initiator initiator = connection.getInitiator();
            final String outText = "MSH|^~\\&|||||||ACK^^ACK|||R|2.4|\rMSA|AA";

            //get a bunch of threads to send messages
View Full Code Here

        }
       
        if (conn == null) {
            try {
                //Parser p = (Parser) parserClass.newInstance();
                LowerLayerProtocol llp = llpClass.newInstance();
                conn = connect(host, port, parser, llp);
            } catch (ClassCastException e) {
                //Log.tryToLog(cce, "Problem opening new connection to " + host + " port " + port);
                throw new HL7Exception( "ClassCastException - need a LowerLayerProtocol class to get an Inititator",
                                        HL7Exception.APPLICATION_INTERNAL_ERROR,
View Full Code Here

      // set up connection to server
      String host = args[0];
      int port = Integer.parseInt(args[1]);

      final Parser parser = new PipeParser();
      LowerLayerProtocol llp = new MinLowerLayerProtocol();
      Connection connection = new ActiveConnection(parser, llp, new Socket(
          host, port));
      final Initiator initiator = connection.getInitiator();
      connection.activate();
      final String outText = "MSH|^~\\&|||||||ACK^^ACK|||R|2.4|\rMSA|AA";
View Full Code Here

  /**
   * @since 2.0
   */
  public Connection attach(String host, int outboundPort, int inboundPort, Parser parser,
    Class<? extends LowerLayerProtocol> llpClass, boolean tls) throws HL7Exception {
    LowerLayerProtocol llp = ReflectionUtil.instantiate(llpClass);
    return attach(host, outboundPort, inboundPort, parser, llp, tls);
  }
View Full Code Here

    return attach(host, outboundPort, inboundPort, parser, llp, tls);
  }

    public Connection attachLazily(String host, int outboundPort, int inboundPort, Parser parser,
                             Class<? extends LowerLayerProtocol> llpClass, boolean tls) throws HL7Exception {
        LowerLayerProtocol llp = ReflectionUtil.instantiate(llpClass);
        return attachLazily(host, outboundPort, inboundPort, parser, llp, tls);
    }
View Full Code Here

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            Message input = exchange.getIn().getBody(Message.class);

                            assertEquals("2.4", input.getVersion());
                            QRD qrd = (QRD)input.get("QRD");
                            assertEquals("0101701234", qrd.getWhoSubjectFilter(0).getIDNumber().getValue());

                            Message response = createHL7AsMessage();
                            exchange.getOut().setBody(response);
                        }
                    })
                    .to("mock:result");
            }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.llp.LowerLayerProtocol

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.