public static void ServiceAdmin() {
    try {
      String serviceName = "ServiceAdmin";
      ServiceAdminStub stub;
      String backEndUrl = "https://localhost:9443/services";
      String endPoint = backEndUrl + "/services/" + serviceName;
      stub = new ServiceAdminStub(endPoint);
      // Authenticate Your stub from sessionCooke
      ServiceClient serviceClient;
      Options option;

      serviceClient = stub._getServiceClient();
      option = serviceClient.getOptions();
      option.setManageSession(true);
      option.setProperty(
          org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);

      System.out.println(stub.getNumberOfActiveServices());
      // System.out.println(stub.isUserValid("admin", "user"));

    } catch (Exception e) {
      System.out.println(e.getMessage());
    }

    //		ServiceAdminLibrary li = new ServiceAdminLibrary();
    //		try {
    //			li.initServiceAdmin();
    //			System.out.println(li.getNumberOfActiveServices());
    //			li.AssertgetNumberOfActiveServices(4);
    //		} catch (Exception e) {
    //			System.out.println(e.getMessage());
    //		}

  }
Esempio n. 2
0
 public ServiceMetaDataWrapper listServices(String serviceName, String filerType)
     throws RemoteException {
   ServiceMetaDataWrapper serviceMetaDataWrapper;
   serviceMetaDataWrapper = serviceAdminStub.listServices(filerType, serviceName, 0);
   serviceAdminStub.getFaultyServiceArchives(0);
   return serviceMetaDataWrapper;
 }
Esempio n. 3
0
  public FaultyServicesWrapper listFaultyServices() throws RemoteException {
    FaultyServicesWrapper faultyServicesWrapper;

    faultyServicesWrapper = serviceAdminStub.getFaultyServiceArchives(0);

    return faultyServicesWrapper;
  }
Esempio n. 4
0
 public boolean deleteFaultyServiceByServiceName(String serviceName) throws RemoteException {
   try {
     return serviceAdminStub.deleteFaultyServiceGroup(getFaultyData(serviceName).getArtifact());
   } catch (RemoteException e) {
     log.error("Faulty service deletion fails", e);
     throw new RemoteException("Faulty service deletion fails", e);
   }
 }
Esempio n. 5
0
 public boolean deleteFaultyService(String archiveName) throws RemoteException {
   try {
     return serviceAdminStub.deleteFaultyServiceGroup(archiveName);
   } catch (RemoteException e) {
     log.error("Faulty service deletion fails", e);
     throw new RemoteException("Faulty service deletion fails", e);
   }
 }
Esempio n. 6
0
 public FaultyServicesWrapper getFaultyServiceArchives(int pageNumber) throws RemoteException {
   FaultyServicesWrapper faultyServicesWrapper;
   try {
     faultyServicesWrapper = serviceAdminStub.getFaultyServiceArchives(pageNumber);
   } catch (RemoteException e) {
     log.error("Unable to get faulty service Archives", e);
     throw new RemoteException("Unable to get faulty service Archives", e);
   }
   return faultyServicesWrapper;
 }
Esempio n. 7
0
  public void deleteMatchingServiceByGroup(String serviceFileName) throws RemoteException {
    String matchingServiceName = getMatchingServiceName(serviceFileName);
    if (matchingServiceName != null) {
      String serviceGroup[] = {getServiceGroup(matchingServiceName)};
      log.info("Service group name " + serviceGroup[0]);

      serviceAdminStub.deleteServiceGroups(serviceGroup);

    } else {
      log.error("Service group name cannot be null");
    }
  }
Esempio n. 8
0
  public String getMatchingServiceName(String serviceFileName) throws RemoteException {

    ServiceMetaDataWrapper serviceMetaDataWrapper;
    serviceMetaDataWrapper = serviceAdminStub.listServices("ALL", serviceFileName, 0);

    ServiceMetaData[] serviceMetaDataList;
    if (serviceMetaDataWrapper != null) {
      serviceMetaDataList = serviceMetaDataWrapper.getServices();
      if (serviceMetaDataList != null && serviceMetaDataList.length > 0) {

        for (ServiceMetaData serviceData : serviceMetaDataList) {
          if (serviceData != null && serviceData.getName().contains(serviceFileName)) {
            return serviceData.getName();
          }
        }
      }
    }
    return null;
  }
Esempio n. 9
0
  public String deleteAllServicesByType(String type) throws RemoteException {
    ServiceMetaDataWrapper serviceMetaDataWrapper;

    serviceMetaDataWrapper = serviceAdminStub.listServices("ALL", null, 0);

    ServiceMetaData[] serviceMetaDataList;
    if (serviceMetaDataWrapper != null) {
      serviceMetaDataList = serviceMetaDataWrapper.getServices();

      String[] serviceGroup;
      if (serviceMetaDataList != null && serviceMetaDataList.length > 0) {

        for (ServiceMetaData serviceData : serviceMetaDataList) {
          if (serviceData.getServiceType().equalsIgnoreCase(type)) {
            serviceGroup = new String[] {serviceData.getServiceGroupName()};
            deleteService(serviceGroup);
          }
        }
      }
    }
    return null;
  }
Esempio n. 10
0
  public void deleteAllNonAdminServiceGroups() throws RemoteException {

    serviceAdminStub.deleteAllNonAdminServiceGroups();
  }
Esempio n. 11
0
  public void deleteService(String[] serviceGroup) throws RemoteException {

    serviceAdminStub.deleteServiceGroups(serviceGroup);
  }
Esempio n. 12
0
  /**
   * @param serviceName
   * @return
   * @throws ServiceAdminException
   * @throws RemoteException
   */
  public String[] getExposedTransports(String serviceName)
      throws ServiceAdminException, RemoteException {

    return serviceAdminStub.getExposedTransports(serviceName);
  }
Esempio n. 13
0
  public void stopService(String serviceName) throws ServiceAdminException, RemoteException {

    serviceAdminStub.stopService(serviceName);
    log.info("Service Stopped");
  }
Esempio n. 14
0
  public ServiceMetaData getServicesData(String serviceName)
      throws ServiceAdminException, RemoteException {

    return serviceAdminStub.getServiceData(serviceName);
  }