Package org.serviceconnector.net

Examples of org.serviceconnector.net.IEncoderDecoder.decode()


          ConnectionLogger.logReadBuffer(this.getClass().getSimpleName(), remoteAddress.getHostName(),
              remoteAddress.getPort(), buffer, 0, buffer.length);
        }
        ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        IEncoderDecoder encoderDecoder = AppContext.getEncoderDecoderFactory().createEncoderDecoder(buffer);
        SCMPMessage ret = (SCMPMessage) encoderDecoder.decode(bais);
        NettyHttpRequesterResponseHandler.this.scmpCallback.receive(ret);
      } catch (Throwable th) {
        LOGGER.error("receive message", th);
        if ((th instanceof Exception) == true) {
          try {
View Full Code Here


          ConnectionLogger.logReadBuffer(this.getClass().getSimpleName(), remoteAddress.getHostName(),
              remoteAddress.getPort(), buffer, 0, buffer.length);
        }
        ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        IEncoderDecoder encoderDecoder = AppContext.getEncoderDecoderFactory().createEncoderDecoder(buffer);
        ret = (SCMPMessage) encoderDecoder.decode(bais);
        NettyTcpRequesterResponseHandler.this.scmpCallback.receive(ret);
      } catch (Throwable th) {
        LOGGER.error("receive message", th);
        if ((th instanceof Exception) == false) {
          try {
View Full Code Here

        ConnectionLogger.logReadBuffer(this.getClass().getSimpleName(), request.getServerName(), request.getServerPort(),
            buffer, 0, buffer.length);
      }
      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      encoderDecoder = AppContext.getEncoderDecoderFactory().createEncoderDecoder(buffer);
      reqMessage = (SCMPMessage) encoderDecoder.decode(bais);

      if (reqMessage.isKeepAlive() == true) {
        // keep alive received, just reply nothing more to do.
        reqMessage.setIsReply(true);
        // write reply to servlet output stream
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [xxx]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [9.9]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [0.9]", e.getMessage());
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    try {
      coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
  }
View Full Code Here

    byte[] buffer = requestString.getBytes();
    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(new SCMPPart());

    try {
      coder.decode(is);
      Assert.fail("Should throw exception");
    } catch (Exception e) {
      Assert.assertEquals("Incompatible SCMP release nr. [2.0]", e.getMessage());
    }
  }
View Full Code Here

    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(buffer);

    SCMPMessage message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMP(message);
  }
View Full Code Here

    InputStream is = new ByteArrayInputStream(buffer);
    IEncoderDecoder coder = coderFactory.createEncoderDecoder(buffer);

    SCMPMessage message = null;
    try {
      message = (SCMPMessage) coder.decode(is);
    } catch (Exception e) {
      Assert.fail("Should not throw exception");
    }
    verifySCMP(message);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.