Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnCreateSessionCall.invoke()


    // 2. initialize call & invoke
    SCServiceCallback callback = new SCServiceCallback(true);
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, this.serviceName);
    createSessionCall.setEchoIntervalSeconds(Constants.DEFAULT_FILE_SESSION_TIMEOUT_SECONDS);
    try {
      createSessionCall.invoke(callback, operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
    } catch (Exception e) {
      throw new SCServiceException("Create file session on SC failed. ", e);
    }
    // 3. receiving reply and error handling
    SCMPMessage reply = callback.getMessageSync(operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
 
View Full Code Here


    createSessionCall.setCompressed(scMessage.isCompressed());
    createSessionCall.setSessionInfo(scMessage.getSessionInfo());
    createSessionCall.setEchoIntervalSeconds(this.echoIntervalSeconds);
    SCServiceCallback callback = new SCServiceCallback(true);
    try {
      createSessionCall.invoke(callback, operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
    } catch (Exception e) {
      throw new SCServiceException("Create session failed. ", e);
    }
    // 3. receiving reply and error handling
    SCMPMessage reply = callback.getMessageSync(operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
 
View Full Code Here

    // create another session2
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk2 = new TestCallback();
    createSessionCall.invoke(cbk2, 3000);
    SCMPMessage resp = cbk2.getMessageSync(3000);
    String sessionId2 = resp.getSessionId();

    // create another session3
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
View Full Code Here

    // create another session3
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk3 = new TestCallback();
    createSessionCall.invoke(cbk3, 3000);
    resp = cbk3.getMessageSync(3000);
    String sessionId3 = resp.getSessionId();

    // reserve connection 2 with session2
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId3);
View Full Code Here

    // create another session2
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk2 = new TestCallback();
    createSessionCall.invoke(cbk2, 3000);
    SCMPMessage resp = cbk2.getMessageSync(3000);
    String sessionId2 = resp.getSessionId();

    // create another session3
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
View Full Code Here

    // create another session3
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk3 = new TestCallback();
    createSessionCall.invoke(cbk3, 3000);
    resp = cbk3.getMessageSync(3000);
    String sessionId3 = resp.getSessionId();

    // reserve connection 2 with session2
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId3);
View Full Code Here

  protected void createSession() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 3000);
    SCMPMessage resp = cbk.getMessageSync(3000);
    this.sessionId = resp.getSessionId();
  }

  /**
 
View Full Code Here

    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("SNBZHP - TradingClientGUI 10.2.7");
    createSessionCall.setEchoIntervalSeconds(0);
    createSessionCall.getRequest().setServiceName("session-1");
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 3000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.HV_WRONG_ECHO_INTERVAL, SCMPMsgType.CLN_CREATE_SESSION);
  }
View Full Code Here

    createSessionCall.setSessionInfo("SNBZHP - TradingClientGUI 10.2.7");
    // set serviceName null
    createSessionCall.getRequest().setServiceName(null);
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.HV_WRONG_SERVICE_NAME, SCMPMsgType.CLN_CREATE_SESSION);
  }
View Full Code Here

  public void t03_ServiceNameEmpty() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.getRequest().setServiceName("");
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.HV_WRONG_SERVICE_NAME, SCMPMsgType.CLN_CREATE_SESSION);
  }
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.