Exemplo n.º 1
0
 private void manageServices(SipxProcessContext.Command operation) {
   Collection<String> serviceBeanIds = getSelections().getAllSelected();
   if (serviceBeanIds == null) {
     return;
   }
   try {
     SipxServiceManager sipxServiceManager = getSipxServiceManager();
     List<SipxService> services = new ArrayList<SipxService>(serviceBeanIds.size());
     for (String beanId : serviceBeanIds) {
       SipxService service = sipxServiceManager.getServiceByBeanId(beanId);
       if (service != null) {
         services.add(service);
       }
     }
     getSipxProcessContext().manageServices(getServiceLocation(), services, operation);
   } catch (UserException e) {
     IValidationDelegate validator = getValidator(this);
     validator.record(new ValidatorException(e.getMessage()));
   }
 }
Exemplo n.º 2
0
  public Object[] retrieveServiceStatus(Location location) {
    if (location == null || location.getServices() == null) {
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
    try {
      return getSipxProcessContext().getStatus(location, true);

    } catch (UserException e) {
      IValidationDelegate validator = getValidator(this);
      validator.record(new ValidatorException(e.getMessage()));

      Collection<ServiceStatus> serviceStatusList = new ArrayList<ServiceStatus>();
      for (LocationSpecificService lss : location.getServices()) {
        SipxService service = lss.getSipxService();
        String serviceName = service.getProcessName();
        if (serviceName != null) {
          serviceStatusList.add(new ServiceStatus(service.getBeanId(), Undefined));
        }
      }
      return serviceStatusList.toArray();
    }
  }