Package org.serviceconnector.api.cln

Examples of org.serviceconnector.api.cln.SCMgmtClient.detach()


    // disable service
    SCMgmtClient clientMgmt = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP);
    clientMgmt.attach();
    clientMgmt.disableService(TestConstants.sesServiceName1);
    clientMgmt.detach();

    // execute
    request.setMessageInfo(TestConstants.echoCmd);
    response = sessionService1.execute(request);
    Assert.assertEquals("message body is not the same length", request.getDataLength(), response.getDataLength());
View Full Code Here


    // disable service
    SCMgmtClient clientMgmt = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP);
    clientMgmt.attach();
    clientMgmt.disableService(TestConstants.sesServiceName1);
    clientMgmt.detach();

    // send
    request.setMessageInfo(TestConstants.echoCmd);
    sessionService1.send(request);
    msgCallback1.waitForMessage(10);
View Full Code Here

          Constants.CC_CMD_ENABLE + "?serviceName=" + TestConstants.sesServiceName1 });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertTrue(client.isServiceEnabled(TestConstants.sesServiceName1));
    client.detach();
  }

  /**
   * Description: disable and re-enable all services<br>
   * Expectation: passes with exitCode = 0 "Success".<br>
View Full Code Here

          Constants.CC_CMD_ENABLE + "?serviceName=.*" });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertTrue(client.isServiceEnabled(TestConstants.sesServiceName1));
    client.detach();
  }

  /**
   * Description: start console with "-h localhost -p 9000 sessions?serviceName=notExistingService<br>
   * (unknown service name)<br>
View Full Code Here

        client.killSC();
        System.out.println("SC exit requested");
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_DUMP)) {
        client.dump();
        System.out.println("SC dump requested");
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_CLEAR_CACHE)) {
        client.clearCache();
        System.out.println("Cache has been cleared");
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_ENABLE)) {
View Full Code Here

        System.out.println("SC dump requested");
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_CLEAR_CACHE)) {
        client.clearCache();
        System.out.println("Cache has been cleared");
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_ENABLE)) {
        try {
          client.enableService(serviceName);
          System.out.println("Service [" + serviceName + "] has been enabled");
        } catch (SCServiceException e) {
View Full Code Here

          System.out.println("Service [" + serviceName + "] has been enabled");
        } catch (SCServiceException e) {
          System.out.println("Service [" + serviceName + "] does not exist!");
          status = 4;
        }
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_DISABLE)) {
        try {
          client.disableService(serviceName);
          System.out.println("Service [" + serviceName + "] has been disabled");
        } catch (SCServiceException e) {
View Full Code Here

          System.out.println("Service [" + serviceName + "] has been disabled");
        } catch (SCServiceException e) {
          System.out.println("Service [" + serviceName + "] does not exist!");
          status = 4;
        }
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_STATE)) {
        try {
          Map<String, String> stateMap = client.getStateOfServices(serviceName);
          Set<Entry<String, String>> parameters = stateMap.entrySet();
          StringBuilder sb = new StringBuilder();
View Full Code Here

          }
        } catch (SCServiceException e) {
          System.out.println("Service [" + serviceName + "] does not exist!");
          status = 4;
        }
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_SESSIONS)) {
        try {
          Map<String, String> workloadMap = client.getWorkload(serviceName);
          Set<Entry<String, String>> workloads = workloadMap.entrySet();
          StringBuilder sb = new StringBuilder();
View Full Code Here

          System.out.println(sb.toString());
        } catch (SCServiceException e) {
          System.out.println("Service [" + serviceName + "] does not exist!");
          status = 4;
        }
        client.detach();
      } else if (callKey.equalsIgnoreCase(Constants.CC_CMD_SC_VERSION)) {
        try {
          String scVersion = client.getSCVersion();
          System.out.println(scVersion);
        } catch (SCServiceException e) {
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.