Package org.serviceconnector.api.cln

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


      SCMessage requestMsg = new SCMessage();
      SCMessage responseMsg = new SCMessage();

      for (int i = 0; i < 5; i++) {
        requestMsg.setData("body nr : " + i);
        responseMsg = service.execute(requestMsg); // regular synchronous call
        LOGGER.info("Message sent sync=" + requestMsg.getData());
        LOGGER.info("Message received sync=" + responseMsg.getData());
        Thread.sleep(2000);
      }
      for (int i = 0; i < 5; i++) {
View Full Code Here


        Thread.sleep(2000);
      }

      requestMsg.setData("cache message body");
      requestMsg.setCacheId("700");
      responseMsg = service.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent to put in cache=" + requestMsg.getData());
      LOGGER.info("Message received=" + responseMsg.getData());

      responseMsg = service.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent with cacheId=" + requestMsg.getData());
View Full Code Here

      requestMsg.setCacheId("700");
      responseMsg = service.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent to put in cache=" + requestMsg.getData());
      LOGGER.info("Message received=" + responseMsg.getData());

      responseMsg = service.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent with cacheId=" + requestMsg.getData());
      LOGGER.info("Message received from cache=" + responseMsg.getData());
    } catch (Exception e) {
      LOGGER.error("run", e);
    } finally {
View Full Code Here

        // service.receive(cbk); // wait for response
        // cbk.receive(); // wait for response ?
        // responseMsg = cbk.getMessage(); // response message

        // synchronous call encapsulates asynchronous call!
        responseMsg = service.execute(requestMsg); // regular synchronous call
        // responseMsg = service.execute(requestMsg, 10); // alternative with operation timeout

        LOGGER.info("Message received=" + responseMsg.getData());
        Thread.sleep(1000);
      }
View Full Code Here

      }
      requestMsg.setData(buffer);
      requestMsg.setPartSize(65536); // 64KB
      requestMsg.setCompressed(false);
      System.out.println(buffer.length);
      SCMessage responseMsg = sessionServiceA.execute(requestMsg);
      System.out.println(responseMsg.getData().toString());
      // deletes the session
      sessionServiceA.deleteSession();
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      sessionServiceA.createSession(60, scMessage, cbk);

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

      System.out.println(responseMsg.getData().toString());
      // deletes the session
      sessionServiceA.deleteSession();
View Full Code Here

      SCMessage requestMsg = new SCMessage();
      SCMessage responseMsg = new SCMessage();

      requestMsg.setData("cache message body");
      requestMsg.setCacheId("700");
      responseMsg = sessionSrv.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent to put in cache=" + requestMsg.getData());
      LOGGER.info("Message received=" + responseMsg.getData());

      responseMsg = sessionSrv.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent with cacheId=" + requestMsg.getData());
View Full Code Here

      requestMsg.setCacheId("700");
      responseMsg = sessionSrv.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent to put in cache=" + requestMsg.getData());
      LOGGER.info("Message received=" + responseMsg.getData());

      responseMsg = sessionSrv.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent with cacheId=" + requestMsg.getData());
      LOGGER.info("Message received from cache=" + responseMsg.getData());     
     
      SCPublishService publishService = sc.newPublishService("cacheGuardian1"); // name of the service to use
View Full Code Here

      subMsg.setData("certificate or what so ever"); // optional
      subMsg.setMask(mask); // mandatory
      subMsg.setNoDataIntervalSeconds(100); // mandatory
      SCSubscribeMessage subReply = publishService.subscribe(subMsg, pubCbk); // regular subscribe
     
      responseMsg = sessionSrv.execute(requestMsg); // regular synchronous call
      LOGGER.info("Message sent with cacheId=" + requestMsg.getData());
      LOGGER.info("Message received from cache=" + responseMsg.getData());   
     
     
    } catch (Exception e) {
View Full Code Here

    message.setCacheId("700");

    response = null;
    while (response == null) {
      try {
        response = sessionService2.execute(message);
      } catch (SCServiceException e) {
        if (e.getSCErrorCode() != SCMPError.CACHE_LOADING.getErrorCode()) {
          throw e;
        }
        Thread.sleep(5000);
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.