Exemplo n.º 1
0
 public void list() {
   if (input.parameterNumber() == 0) {
     try {
       realmResultManager.printRealms(realmSyncopeOperations.list());
     } catch (final SyncopeClientException ex) {
       LOG.error("Error listing realm", ex);
       realmResultManager.genericError(ex.getMessage());
     }
   } else {
     realmResultManager.unnecessaryParameters(input.listParameters(), LIST_HELP_MESSAGE);
   }
 }
Exemplo n.º 2
0
 public void delete() {
   if (input.parameterNumber() >= 1) {
     for (final String parameter : input.getParameters()) {
       try {
         notificationSyncopeOperations.delete(parameter);
         notificationResultManager.deletedMessage("Notification", parameter);
       } catch (final WebServiceException | SyncopeClientException ex) {
         LOG.error("Error deleting notification", ex);
         if (ex.getMessage().startsWith("NotFound")) {
           notificationResultManager.notFoundError("Notification", parameter);
         } else {
           notificationResultManager.genericError(ex.getMessage());
         }
       } catch (final NumberFormatException ex) {
         notificationResultManager.notBooleanDeletedError("notification", parameter);
       }
     }
   } else {
     notificationResultManager.commandOptionError(DELETE_HELP_MESSAGE);
   }
 }