Package org.serviceconnector.api.cln

Examples of org.serviceconnector.api.cln.SCSessionService.createSession()


      SCMessage msg = new SCMessage();
      msg.setSessionInfo("session-info"); // optional
      msg.setData("certificate or what so ever"); // optional
      SCMessageCallback cbk = new DemoSessionClientCallback(service); // callback on service!!
      SCMessage reply = service.createSession(10, msg, cbk); // create a session within 10 seconds
      Object body = reply.getData();

      String sid = service.getSessionId();

      SCMessage requestMsg = new SCMessage();
View Full Code Here


      SCMessage msg = new SCMessage();
      msg.setSessionInfo("session-info"); // optional
      msg.setData("certificate or what so ever"); // optional
      SCMessageCallback cbk = new DemoSessionClientCallback(service); // callback on service!!
      service.createSession(10, msg, cbk); // alternative with operation timeout and message
      // service.createSession(msg); // alternative with message

      String sid = service.getSessionId();

      SCMessage requestMsg = new SCMessage();
View Full Code Here

      // creates a session
      SCMessage scMessage = new SCMessage();
      scMessage.setSessionInfo("sessionInfo");
      sessionServiceA.setEchoTimeoutSeconds(300);
      SCMessageCallback cbk = new ExampleCallback(sessionServiceA);
      sessionServiceA.createSession(60, scMessage, cbk);

      SCMessage requestMsg = new SCMessage();
      requestMsg.setData("Hello World");
      requestMsg.setCompressed(false);
View Full Code Here

      // creates a session
      SCMessage scMessage = new SCMessage();
      scMessage.setSessionInfo("sessionInfo");
      sessionServiceA.setEchoTimeoutSeconds(300);
      SCMessageCallback cbk = new ExampleCallback(sessionServiceA);
      sessionServiceA.createSession(60, scMessage, cbk);

      SCMessage requestMsg = new SCMessage();
      // set up large buffer
      byte[] buffer = new byte[9000000];
      for (int i = 0; i < buffer.length; i++) {
View Full Code Here

      // creates a session
      SCMessage scMessage = new SCMessage();
      scMessage.setSessionInfo("sessionInfo");
      sessionServiceA.setEchoTimeoutSeconds(300);
      SCMessageCallback cbk = new ExampleCallback(sessionServiceA);
      sessionServiceA.createSession(60, scMessage, cbk);

      SCMessage requestMsg = new SCMessage();
      requestMsg.setData("Hello World");
      requestMsg.setCompressed(false);
      SCMessage responseMsg = sessionServiceA.execute(requestMsg);
View Full Code Here

      SCMessage msg = new SCMessage();
      msg.setSessionInfo("session-info"); // optional
      msg.setData("certificate or what so ever"); // optional
      SCMessageCallback cbk = new DemoSessionClientCallback(sessionSrv); // callback on service!!
      SCMessage reply = sessionSrv.createSession(10, msg, cbk); // create a session within 10 seconds
      Object body = reply.getData();   
     
      String sid = sessionSrv.getSessionId();

      SCMessage requestMsg = new SCMessage();
View Full Code Here

   */
  @Test
  public void t01_() throws Exception {
    SCSessionService sessService = client.newSessionService(TestConstants.sesServerName1);
    SCMessage scMessage = new SCMessage();
    sessService.createSession(scMessage, new TestSessionServiceMessageCallback(sessService));
    SCPublishService pubService = client.newPublishService(TestConstants.pubServerName1);
    SCSubscribeMessage scSubscribeMessage = new SCSubscribeMessage();
    scSubscribeMessage.setMask(TestConstants.mask);
    pubService.subscribe(scSubscribeMessage, new TestPublishServiceMessageCallback(pubService));

View Full Code Here

    ctrl.startServer(TestConstants.COMMUNICATOR_TYPE_SESSION, TestConstants.log4jSrvProperties, TestConstants.sesServerName1,
        TestConstants.PORT_SES_SRV_TCP, TestConstants.PORT_SC0_TCP, 100, 10, TestConstants.sesServiceName1);

    SCSessionService sessionService2 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService2);
    sessionService2.createSession(request, msgCallback1);
    message = new SCMessage();
    message.setMessageInfo(TestConstants.cacheCmd);
    message.setData("cache10MBStringFor1Hour");
    message.setCacheId("700");
View Full Code Here

    // 3: load data to cache (cid=700) on SC0
    SCMessage request = new SCMessage();
    request.setData("cacheFor1Hour_managedData");
    request.setCacheId("700");
    request.setMessageInfo(TestConstants.cacheCmd);
    sessionSrvToSC0.createSession(new SCMessage(), new SessionMsgCallback(sessionSrvToSC0));
    sessionSrvToSC0.execute(request);

    // 4: start cache guardian - publish 3 large appendix
    SCSubscribeMessage subMsg = new SCSubscribeMessage();
    subMsg.setMask(TestConstants.mask);
View Full Code Here

    // 1: connect new client2 to top level (cascaded) SC
    SCClient client2 = new SCClient(TestConstants.HOST, sessionClient.getPort(), ConnectionType.NETTY_TCP);
    client2.attach();
    SCSessionService sessionService2 = client2.newSessionService(TestConstants.sesServiceName1);
    sessionService2.createSession(new SCMessage(), new SessionMsgCallback(sessionService2));

    // 2: load data to cache (cid=700) by client1
    SCMessage request = new SCMessage();
    request.setData("cacheFor1Hour_managedData");
    request.setCacheId("700");
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.