Ejemplo n.º 1
0
 public boolean isServiceFaulty(String serviceName) throws RemoteException {
   boolean serviceState = false;
   FaultyServicesWrapper faultyServicesWrapper;
   FaultyService[] faultyServiceList;
   faultyServicesWrapper = listFaultyServices();
   if (faultyServicesWrapper != null) {
     faultyServiceList = faultyServicesWrapper.getFaultyServices();
     if (faultyServiceList == null || faultyServiceList.length == 0) {
       serviceState = false;
     } else {
       for (FaultyService faultyServiceData : faultyServiceList) {
         if (faultyServiceData != null
             && faultyServiceData.getServiceName().equalsIgnoreCase(serviceName)) {
           return true;
         }
       }
     }
   }
   return serviceState;
 }
Ejemplo n.º 2
0
 public FaultyService getFaultyData(String serviceName) throws RemoteException {
   FaultyService faultyService = null;
   FaultyServicesWrapper faultyServicesWrapper;
   FaultyService[] faultyServiceList;
   faultyServicesWrapper = listFaultyServices();
   if (faultyServicesWrapper != null) {
     faultyServiceList = faultyServicesWrapper.getFaultyServices();
     if (faultyServiceList == null || faultyServiceList.length == 0) {
       throw new RuntimeException("Service not found in faulty service list");
     } else {
       for (FaultyService faultyServiceData : faultyServiceList) {
         if (faultyServiceData != null
             && faultyServiceData.getServiceName().equalsIgnoreCase(serviceName)) {
           faultyService = faultyServiceData;
         }
       }
     }
   }
   if (faultyService == null) {
     throw new RuntimeException("Service not found in faulty service list " + faultyService);
   }
   return faultyService;
 }