Package ca.uhn.hl7v2.llp

Examples of ca.uhn.hl7v2.llp.LLPException


    e.setPath(myProtocol.getUriPath());
    DataOutputStream dos = new DataOutputStream(myOutputStream);
    try {
      e.encodeToOutputStream(dos);
    } catch (EncodeException e1) {
      throw new LLPException("Failed to encode message", e1);
    }

    dos.flush();

  }
View Full Code Here


    e.setUri(myProtocol.getUriPath());
    DataOutputStream dos = new DataOutputStream(myOutputStream);
    try {
      e.encodeToOutputStream(dos);
    } catch (EncodeException e1) {
      throw new LLPException("Failed to encode message", e1);
    }

    dos.flush();

  }
View Full Code Here

   
    try {
      decoder.readHeadersAndContentsFromInputStreamAndDecode(myInputStream);
    } catch (DecodeException e) {
      if (myProtocol.getRole() == ServerRoleEnum.CLIENT) {
        throw new LLPException("Failed to process response", e);
      } else {
        ourLog.info("Failed to read contents", e);
        HTTPUtils.write400BadRequest(myWriter.getOutputStream(), e.getMessage());

        myInputStream.close();
        myWriter.getOutputStream().close();

        throw new LLPException("Failed to read message", e);
      }
    } catch (NoMessageReceivedException e) {
      return null;
    } catch (SignatureVerificationException e) {
      throw new LLPException("Failed to verify message signature", e);
    }
   
    if (myProtocol.getRole() == ServerRoleEnum.SERVER) {
      Charset charset = decoder.getCharset();
      myWriter.setCharsetForNextMessage(charset);
     
      IAuthorizationServerCallback authorizationCallback = myProtocol.getAuthorizationServerCallback();
      if (authorizationCallback != null) {
        boolean auth = authorizationCallback.authorize(decoder.getUri(), decoder.getUsername(), decoder.getPassword());
        if (!auth) {
          HTTPUtils.write401Unauthorized(myWriter.getOutputStream());
          throw new LLPException("Authorization at URI[" + decoder.getUri() + "] failed for user[" + decoder.getUsername() + "]");
        }
      }
    }

    return decoder.getMessage();
View Full Code Here

public class HL7Server {

    private SimpleServer server;

    public HL7Server(int port) {
        LowerLayerProtocol llp = LowerLayerProtocol.makeLLP(); // The transport protocol
        PipeParser parser = new PipeParser();
        server = new SimpleServer(port, llp, parser);
    }
View Full Code Here

        return new HL7Endpoint();
    }

    @Override
    protected void startEndpoint(HL7Endpoint endpoint) throws AxisFault {
        LowerLayerProtocol llp = LowerLayerProtocol.makeLLP();
        PipeParser parser = new PipeParser();
        SimpleServer server = new SimpleServer(endpoint.getPort(), llp, parser);
        Application callback = new HL7MessageProcessor(endpoint);
        server.registerApplication("*", "*", callback);
        server.start();
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

TOP

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

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.