Examples of SCMPPart


Examples of org.serviceconnector.scmp.SCMPPart

  public void t01_InvalidSCMPVersionFormatTest() {
    String requestString = "REQ 0000053 00053 xxx\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t02_InvalidSCMPVersion9_9Test() {
    String requestString = "REQ 0000053 00053 9.9\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t03_InvalidSCMPVersion0_9Test() {
    String requestString = "REQ 0000053 00053 0.9\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

  public void t03_ValidSCMPVersionTest() {
    String requestString = "REQ 0000052 00052 1.0\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";

    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

Examples of org.serviceconnector.scmp.SCMPPart

  @Test
  public void t10_InvalidReleaseNumberTest() {
    String requestString = "REQ 0000053 00053 2.0\nldt=2010-08-02T11:24:52.093+0200\nver=1.0-000\nmty=ATT";
    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) {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

    }
    // Any object delivered by the cache should be copied to avoid modifications done by consumers
    Object objectValue = element.getObjectValue();

    if (objectValue instanceof SCMPPart) {
      SCMPPart copiedSCMPPart = null;
      copiedSCMPPart = new SCMPPart((SCMPPart) objectValue);
      return (T) copiedSCMPPart;
    } else if (objectValue instanceof SCMPMessage) {
      SCMPMessage copiedSCMPMsg = null;
      copiedSCMPMsg = new SCMPMessage((SCMPMessage) objectValue);
      return (T) copiedSCMPMsg;
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

      throw new IllegalArgumentException("timeToLive can't be negative");
    }

    // Any object put to the cache should be copied to avoid modifications done by consumers
    if (value instanceof SCMPPart) {
      value = (T) new SCMPPart((SCMPPart) value);
    } else if (value instanceof SCMPMessage) {
      value = (T) new SCMPMessage((SCMPMessage) value);
    } else if (value instanceof SCCacheMetaEntry) {
      value = (T) new SCCacheMetaEntry((SCCacheMetaEntry) value);
    } else {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

      throw new IllegalArgumentException("timeToLive can't be negative");
    }

    // Any object put to the cache should be copied to avoid modifications done by consumers
    if (value instanceof SCMPPart) {
      value = (T) new SCMPPart((SCMPPart) value);
    } else if (value instanceof SCMPMessage) {
      value = (T) new SCMPMessage((SCMPMessage) value);
    } else if (value instanceof SCCacheMetaEntry) {
      value = (T) new SCCacheMetaEntry((SCCacheMetaEntry) value);
    } else {
View Full Code Here

Examples of org.serviceconnector.scmp.SCMPPart

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

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(message.getSCMPVersion(), true);
    } else {
      // SCMP Version request
      reply = new SCMPMessage(message.getSCMPVersion());
    }
    reply.setMessageType(this.getKey());
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.