/*
   * Method returns the Load balancer service instance running within
   * 'default' container.
   */
  private IConfigManager getConfigManagerService(String containerName) {
    IContainerManager containerManager =
        (IContainerManager) ServiceHelper.getGlobalInstance(IContainerManager.class, this);
    if (containerManager == null) {
      throw new ServiceUnavailableException(
          "Container " + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    boolean found = false;
    List<String> containerNames = containerManager.getContainerNames();
    for (String cName : containerNames) {
      if (cName.trim().equalsIgnoreCase(containerName.trim())) {
        found = true;
      }
    }

    if (found == false) {
      throw new ResourceNotFoundException(
          containerName + " " + RestMessages.NOCONTAINER.toString());
    }

    IConfigManager configManager =
        (IConfigManager) ServiceHelper.getInstance(IConfigManager.class, containerName, this);

    if (configManager == null) {
      throw new ServiceUnavailableException(
          "Load Balancer" + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    return configManager;
  }
 private IConnectionManager getConnectionManager() {
   return (IConnectionManager) ServiceHelper.getGlobalInstance(IConnectionManager.class, this);
 }
예제 #3
0
 public AppWeb() {
   ServiceHelper.registerGlobalService(IDaylightWeb.class, this, null);
 }
 private IBridgeDomainConfigService getConfigurationService() {
   return (IBridgeDomainConfigService)
       ServiceHelper.getGlobalInstance(IBridgeDomainConfigService.class, this);
 }
 public static INeutronFloatingIPCRUD getINeutronFloatingIPCRUD(Object o) {
   INeutronFloatingIPCRUD answer =
       (INeutronFloatingIPCRUD) ServiceHelper.getGlobalInstance(INeutronFloatingIPCRUD.class, o);
   return answer;
 }