Package org.serviceconnector.api.cln

Examples of org.serviceconnector.api.cln.SCClient.attach()


    SCSessionService sessionSrv = null;

    try {
      sc.setMaxConnections(20); // can be set before attach, default 100 Connections
      sc.setKeepAliveIntervalSeconds(10); // can be set before attach, default 0 -> inactive
      sc.attach(); // attaching client to SC , communication starts

      String serviceName = "session-1";
      sessionSrv = sc.newSessionService(serviceName); // name of the service to use
      sessionSrv.setEchoIntervalSeconds(10); // can be set before create session
      sessionSrv.setEchoTimeoutSeconds(2); // can be set before create session
View Full Code Here


        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
          try {
            SCClient localClient = new SCClient(host, port, ConnectionType.NETTY_TCP);
            localClient.attach();
            return localClient;
          } catch (Exception e) {
            LOGGER.warn("upload current log files, connect to network interface " + host + " failed. " + e.toString());
          }
        }
View Full Code Here

        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
          try {
            SCClient localClient = new SCClient(host, port, ConnectionType.NETTY_HTTP);
            localClient.attach();
            return localClient;
          } catch (Exception e) {
            LOGGER.warn("upload current log files, connect to network interface " + host + " and port " + port
                + " failed. " + e.toString());
          }
View Full Code Here

      String host = cascadedSC.getHost();
      int port = cascadedSC.getPortNr();
      String connectionType = cascadedSC.getConnectionType();
      try {
        SCClient localClient = new SCClient(host, port, ConnectionType.getType(connectionType));
        localClient.attach();
        return localClient;
      } catch (Exception e) {
        LOGGER.warn("upload current log files, connect to network interface " + host + " and port " + port + " failed. "
            + e.toString());
      }
View Full Code Here

    try {
      sc = new SCClient("localhost", 7000);
      sc.setMaxConnections(100);

      // connects to SC, checks connection to SC
      sc.attach();

      publishServiceA = sc.newPublishService("publish-1");
      SCMessageCallback callback = new TestPublishCallback(publishServiceA);
      SCSubscribeMessage subscibeMessage = new SCSubscribeMessage();
      subscibeMessage.setMask("000012100012832102FADF-----------X-----------");
View Full Code Here

    this.sessionService1.deleteSession();
    this.sessionClient.detach();

    // 2: connect new client to SC0
    SCClient clientToSc0 = new SCClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    clientToSc0.attach();
    SCSessionService sessionSrvToSC0 = clientToSc0.newSessionService(TestConstants.sesServiceName1);

    // 3: load data to cache (cid=700) on SC0
    SCMessage request = new SCMessage();
    request.setData("cacheFor1Hour_managedData");
View Full Code Here

    // start up additional SC0A and Servers for this test
    this.startSC0AAndServers();

    // 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();
View Full Code Here

    // start up additional SC0A and Servers for this test
    this.startSC0AAndServers();

    // 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();
View Full Code Here

   * Expectation: clients get a not found error, passes
   */
  @Test
  public void t95_TwoSubscribersServerGetsDestroyed() throws Exception {
    SCClient client2 = new SCClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
    client2.attach();
    SCPublishService service1 = client.newPublishService(TestConstants.pubServiceName1);
    SCPublishService service2 = client2.newPublishService(TestConstants.pubServiceName1);

    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    subMsgRequest.setDataLength(TestConstants.pangram.length());
View Full Code Here

   * Expectation: clients get a not found error, passes
   */
  @Test
  public void t95_TwoSubscribersServerGetsDestroyed() throws Exception {
    SCClient client2 = new SCClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    client2.attach();
    SCPublishService service1 = client.newPublishService(TestConstants.pubServiceName1);
    SCPublishService service2 = client2.newPublishService(TestConstants.pubServiceName1);

    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    subMsgRequest.setDataLength(TestConstants.pangram.length());
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.