Package org.serviceconnector.scmp

Examples of org.serviceconnector.scmp.SCMPKeepAlive


   * Expectation: passes
   */
  @Test
  public void t11_EncodeKRSTest() {
    this.headKey = SCMPHeaderKey.KRS;
    this.encodeScmp = new SCMPKeepAlive();
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPKeepAlive());

    String expectedString = this.headKey.name() + " 0000000 00000 " + SCMPVersion.CURRENT + "\n";

    OutputStream os = new ByteArrayOutputStream();
    try {
View Full Code Here


  /** {@inheritDoc} */
  @Override
  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

      scmpMsg = new SCMPMessage(receivedVersion);
      scmpMsg.setIsReqCompleteAfterMarshallingPart(true);
      break;
    case KRS:
    case KRQ:
      scmpMsg = new SCMPKeepAlive(receivedVersion);
      return scmpMsg;
    case PRQ:
      // no poll request
      scmpMsg = new SCMPPart(receivedVersion, false);
      scmpMsg.setIsReply(false);
View Full Code Here

        }
      }
      this.usedConnections.add(connection);
    }
    // send a keep alive message - SCMP version current
    SCMPKeepAlive keepAliveMessage = new SCMPKeepAlive(SCMPVersion.LOWEST);
    connection.incrementNrOfIdles();
    try {
      ConnectionPoolCallback callback = new ConnectionPoolCallback(true);
      connection.send(keepAliveMessage, callback);
      SCMPMessage reply = callback.getMessageSync(this.keepAliveOTIMillis);
View Full Code Here

TOP

Related Classes of org.serviceconnector.scmp.SCMPKeepAlive

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.