Package org.serviceconnector.scmp

Examples of org.serviceconnector.scmp.SCMPHeaderKey


    SCMPMessage.SCMP_VERSION.isSupported(version);
    is.skip(1); // read LF

    SCMPMessage scmpMsg = null;
    // evaluating header key and creating corresponding SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.getKeyByHeadline(headline);
    switch (headerKey) {
    case KRS:
    case KRQ:
      scmpMsg = new SCMPKeepAlive();
      return scmpMsg;
View Full Code Here


   *             the exception
   */
  public static int parseFrameSize(byte[] buffer) throws FrameDecoderException {
    try {
      // check headerKey
      SCMPHeaderKey headerKey = SCMPHeaderKey.getKeyByHeadline(buffer);
      if (headerKey == SCMPHeaderKey.UNDEF) {
        throw new FrameDecoderException("invalid scmp header line:" + new String(buffer, 0, Constants.SCMP_HEADLINE_SIZE));
      }
      // parse frame size
      int scmpLength = SCMPFrameDecoder.parseMessageSize(buffer);
View Full Code Here

      // status already set
      scmpMsg.setInternalStatus(SCMPInternalStatus.NONE);
    }

    // evaluate right headline key from SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.UNDEF;
    if (scmpMsg.isReply()) {
      if (scmpMsg.isFault()) {
        headerKey = SCMPHeaderKey.EXC;
      } else {
        if (scmpMsg.isPart()) {
View Full Code Here

  public void encode(OutputStream os, Object obj) throws Exception {
    OutputStreamWriter osw = new OutputStreamWriter(os, Constants.SC_CHARACTER_SET);
    BufferedWriter bw = new BufferedWriter(osw);
    SCMPKeepAlive keepAlive = (SCMPKeepAlive) obj;
    if (keepAlive.isReply()) {
      SCMPHeaderKey headerKey = SCMPHeaderKey.KRS;
      writeHeadLine(bw, headerKey, 0, 0);
    } else {
      SCMPHeaderKey headerKey = SCMPHeaderKey.KRQ;
      writeHeadLine(bw, headerKey, 0, 0);
    }
    return;
  }
View Full Code Here

      // status already set
      scmpMsg.setInternalStatus(SCMPInternalStatus.NONE);
    }

    // evaluate right headline key from SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.UNDEF;
    if (scmpMsg.isReply()) {
      headerKey = SCMPHeaderKey.RES;
      if (scmpMsg.isFault()) {
        headerKey = SCMPHeaderKey.EXC;
      }
View Full Code Here

    OutputStreamWriter osw = new OutputStreamWriter(os, Constants.SC_CHARACTER_SET);
    BufferedWriter bw = new BufferedWriter(osw);
    SCMPMessage scmpMsg = (SCMPMessage) obj;

    // evaluate right headline key from SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.UNDEF;
    if (scmpMsg.isReply()) {
      if (scmpMsg.isFault()) {
        headerKey = SCMPHeaderKey.EXC;
      } else {
        if (scmpMsg.isPart()) {
View Full Code Here

  public void encode(OutputStream os, Object obj) throws Exception {
    OutputStreamWriter osw = new OutputStreamWriter(os, Constants.SC_CHARACTER_SET);
    BufferedWriter bw = new BufferedWriter(osw);
    SCMPKeepAlive keepAlive = (SCMPKeepAlive) obj;
    if (keepAlive.isReply()) {
      SCMPHeaderKey headerKey = SCMPHeaderKey.KRS;
      this.writeHeadLine(keepAlive.getSCMPVersion(), bw, headerKey, 0, 0);
    } else {
      SCMPHeaderKey headerKey = SCMPHeaderKey.KRQ;
      this.writeHeadLine(keepAlive.getSCMPVersion(), bw, headerKey, 0, 0);
    }
    return;
  }
View Full Code Here

    OutputStreamWriter osw = new OutputStreamWriter(os, Constants.SC_CHARACTER_SET);
    BufferedWriter bw = new BufferedWriter(osw);
    SCMPMessage scmpMsg = (SCMPMessage) obj;

    // evaluate right headline key from SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.UNDEF;
    if (scmpMsg.isReply()) {
      headerKey = SCMPHeaderKey.RES;
      if (scmpMsg.isFault()) {
        headerKey = SCMPHeaderKey.EXC;
      }
View Full Code Here

    SCMPVersion receivedVersion = SCMPVersion.getSCMPVersionByByteArray(version);
    is.skip(1); // read LF

    SCMPMessage scmpMsg = null;
    // evaluating header key and creating corresponding SCMP type
    SCMPHeaderKey headerKey = SCMPHeaderKey.getKeyByHeadline(headline);
    switch (headerKey) {
    case RES:
      scmpMsg = new SCMPMessage(receivedVersion);
      scmpMsg.setIsReply(true);
      scmpMsg.setIsReqCompleteAfterMarshallingPart(true);
View Full Code Here

TOP

Related Classes of org.serviceconnector.scmp.SCMPHeaderKey

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.