Package org.serviceconnector.scmp

Examples of org.serviceconnector.scmp.SCMPPart


    // reply to server
    SCMPMessage reply = null;
    if (message.isPart()) {
      // incoming message is of type part - outgoing must be part too, poll request
      reply = new SCMPPart(true);

    } else {
      reply = new SCMPMessage();
    }
    reply.setMessageType(this.getKey());
View Full Code Here


    LOGGER.debug("CRP message found in queue subscriptionId " + subscriptionId);
    // message found in subscription queue set up reply
    SCMPMessage reply = new SCMPMessage();
    if (message.isPart()) {
      // message from queue is of type part - outgoing must be part too, no poll request
      reply = new SCMPPart(false);
    }
    reply.setServiceName(reqMessage.getServiceName());
    reply.setSessionId(reqMessage.getSessionId());
    reply.setMessageType(reqMessage.getMessageType());
    reply.setIsReply(true);
View Full Code Here

      scmpMsg = new SCMPKeepAlive();
      return scmpMsg;
    case PRQ:
    case PRS:
      // no poll request
      scmpMsg = new SCMPPart(false);
      break;
    case PAC:
      // poll request
      scmpMsg = new SCMPPart(true);
      break;
    case EXC:
      scmpMsg = new SCMPMessageFault();
      break;
    case UNDEF:
View Full Code Here

        this.parentCall.invoke(callback, timeoutMillis);
        return;
      }
      if (callSCMP.isPart() == false) {
        // callSCMP is small and not part but inside a group only parts are allowed
        SCMPPart scmpPart = new SCMPPart();
        scmpPart.setHeader(callSCMP);
        scmpPart.setBody(callSCMP.getBody());
        scmpPart.setIsPollRequest(callSCMP.isPollRequest());
        SCMPCallAdapter.this.requestMessage = scmpPart; // SCMPCallAdapter.this points to this.parentCall
        callSCMP = null;
      }
      this.parentCall.invoke(callback, timeoutMillis);
      return;
View Full Code Here

              + subscriptionId);
          // set up reply
          SCMPMessage reply = null;
          if (message.isPart()) {
            // message from queue is of type part - outgoing must be part too, no poll request
            reply = new SCMPPart(false);
          } else {
            reply = new SCMPMessage();
          }
          reply.setServiceName(reqMsg.getHeader(SCMPHeaderAttributeKey.SERVICE_NAME));
          reply.setSessionId(subscriptionId);
View Full Code Here

    SCMPMessage scmpReply = null;
    if (scmpReq.isPart()) {
      // received message part - request not complete yet
      largeRequest.incomplete();
      // set up poll response
      scmpReply = new SCMPPart(true);
      scmpReply.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.incrementAndGetMsgSequenceNr());
      scmpReply.setIsReply(true);
      scmpReply.setMessageType(scmpReq.getMessageType());
    } else {
      // last message of a chunk message received - request complete now
View Full Code Here

      httpCon.disconnect();
      session.stopStreaming();
      reply = new SCMPMessage();
    } else {
      // set up poll request
      reply = new SCMPPart(true);
    }
    return reply;
  }
View Full Code Here

      session.getHttpURLConnection().disconnect();
      session.stopStreaming();
      return reply;
    }
    // set up part request, no poll request
    reply = new SCMPPart(false);
    reply.setBody(fullBuffer, 0, readBytes);
    return reply;
  }
View Full Code Here

   * Description: Encode PRS test<br>
   * Expectation: passes
   */
  @Test
  public void t24_EncodePRSTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    this.headKey = SCMPHeaderKey.PRS;
    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);

    SCMPMessage encodeRes = new SCMPPart();
    encodeRes.setIsReply(true);
    encodeRes.setHeader(encodeScmp);
    encodeRes.setBody(body.getBytes());

    OutputStream os = new ByteArrayOutputStream();
    try {
      coder.encode(os, encodeRes);
    } catch (Exception e) {
View Full Code Here

   * Description: Encode body types test<br>
   * Expectation: passes
   */
  @Test
  public void t25_EncodeBodyTypesTest() {
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    String header = "msn=" + msgSequenceNr + "\n" + "bty=" + bodyType.getValue() + "\n" + "mty=" + msgType.getValue() + "\n";

    String expectedString = TestUtil.getSCMPString(headKey, header, body);

View Full Code Here

TOP

Related Classes of org.serviceconnector.scmp.SCMPPart

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.