Examples of CLIException


Examples of com.fathomdb.cli.CliException

      try {
        String json = jsonHelper.marshal(jobs, formatted);
        writer.println(json);
        return;
      } catch (IOException e) {
        throw new CliException("Error formatting for output", e);
      }
    }

    Ansi ansi = new Ansi(writer);
View Full Code Here

Examples of com.fathomdb.cli.CliException

      try {
        String json = jsonHelper.marshal(jobs, formatted);
        writer.println(json);
        return;
      } catch (IOException e) {
        throw new CliException("Error formatting for output", e);
      }
    }

    Ansi ansi = new Ansi(writer);
View Full Code Here

Examples of com.fathomdb.cli.CliException

      } catch (IOException e) {
        throw new IOException("Error reading configuration file", e);
      }

      if (properties.getProperty("platformlayer.username") == null) {
        throw new CliException("User property not set in configuration file");
      }

      if (debug) {
        client = buildPlatformLayerClient(properties, debug);
      } else {
        String propertiesKey = PropertyUtils.serialize(properties);

        try {
          client = platformLayerClientCache.get(propertiesKey, new Callable<HttpPlatformLayerClient>() {
            @Override
            public HttpPlatformLayerClient call() throws Exception {
              return buildPlatformLayerClient(properties, false);
            }
          });
        } catch (ExecutionException e) {
          throw new CliException("Error building platformlayer client", e);
        }
      }
    } finally {
      if (is != System.in) {
        Closeables.closeQuietly(is);
View Full Code Here

Examples of org.glite.authz.pap.ui.cli.CLIException

    PolicySetType[] policySetArray;

    policySetArray = xacmlPolicyMgmtClient.listPolicySets(papAlias);

    if (policySetArray.length == 0) {
      throw new CLIException(
          "Error: the repository seems to be corrupted, no policy sets have been found");
    }

    PolicyType[] policyArray;

    policyArray = xacmlPolicyMgmtClient.listPolicies(papAlias);

    List<PolicyWizard> policyWizardList = new ArrayList<PolicyWizard>(policyArray.length);

    for (PolicyType policy : policyArray) {
     
      // Filtering by action
      // TODO: how to handle wildcards? Should we use regexp match?
      String actionValue = PolicyWizard.getActionValue(policy);
      if (actionFilter != null && !actionValue.equals(actionFilter))
        continue;
     
      PolicyWizard policyWizard = new PolicyWizard(policy);
      policyWizardList.add(policyWizard);
      policyWizard.releaseChildrenDOM();
      policyWizard.releaseDOM();
    }

    policyArray = null;

    PolicySetType localRootPolicySet = policySetArray[0];

    for (String policySetId : PolicySetHelper
        .getPolicySetIdReferencesValues(localRootPolicySet)) {

      PolicySetType policySet = null;

      for (PolicySetType policySetElem : policySetArray) {
        if (policySetId.equals(policySetElem.getPolicySetId())) {
          policySet = policySetElem;
          break;
        }
      }

      if (policySet == null) {
        throw new CLIException(
            "Error: the repository seems to be corrupted, policy set not found: "
                + policySetId);
      }

      try {
View Full Code Here

Examples of org.glite.authz.pap.ui.cli.CLIException

    public static void initAttributeWizard() {
        String papDir = System.getProperty("PAP_HOME");

        if (papDir == null) {
            throw new CLIException("Environment variable PAP_HOME is not set.");
        }

        AttributeWizardTypeConfiguration.bootstrap(papDir + "/conf/attribute-mappings.ini");
    }
View Full Code Here

Examples of org.nasutekds.server.util.cli.CLIException

      Set<String> values = new TreeSet<String>(d);
      ManagedObjectPath<?,?> path = d.getParentPath();
      try {
        values.addAll(Arrays.asList(context.listManagedObjects(path, rd)));
      } catch (AuthorizationException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.quit();
      } catch (ManagedObjectNotFoundException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.cancel();
      } catch (CommunicationException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.quit();
      }

      for (String value : values) {
        Message option = getPropertyValues(d, Collections.singleton(value));
View Full Code Here

Examples of org.nasutekds.server.util.cli.CLIException

        final Set<String> values = new TreeSet<String>(d);
        ManagedObjectPath<?,?> path = d.getParentPath();
        try {
          values.addAll(Arrays.asList(context.listManagedObjects(path, rd)));
        } catch (AuthorizationException e) {
          this.e = new CLIException(e.getMessageObject());
          return MenuResult.quit();
        } catch (ManagedObjectNotFoundException e) {
          this.e = new CLIException(e.getMessageObject());
          return MenuResult.cancel();
        } catch (CommunicationException e) {
          this.e = new CLIException(e.getMessageObject());
          return MenuResult.quit();
        }

        // Create the add values call-back.
        MenuCallback<Boolean> addCallback = null;
View Full Code Here

Examples of org.nasutekds.server.util.cli.CLIException

      ManagedObjectPath<?,?> path = d.getParentPath();
      InstantiableRelationDefinition<C, S> rd = d.getRelationDefinition();
      try {
        values.addAll(Arrays.asList(context.listManagedObjects(path, rd)));
      } catch (AuthorizationException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.quit();
      } catch (ManagedObjectNotFoundException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.cancel();
      } catch (CommunicationException e) {
        this.e = new CLIException(e.getMessageObject());
        return MenuResult.quit();
      }

      final Message ufn = rd.getUserFriendlyName();
      for (String value : values) {
View Full Code Here

Examples of org.nasutekds.server.util.cli.CLIException

            if (cd == null) {
              // The name must be invalid.
              String typeUsage = getSubTypesUsage(d);
              Message msg = ERR_DSCFG_ERROR_SUB_TYPE_UNRECOGNIZED.get(
                  name, r.getUserFriendlyName(), typeUsage);
              clie = new CLIException(msg);
              result = MenuResult.quit();
              return;
            } else {
              childName = cd.getName();
            }
View Full Code Here

Examples of org.nasutekds.server.util.cli.CLIException

        // First attempt to create the child, this will guarantee that
        // the name is acceptable.
        try {
          child = parent.createChild(irelation, d, input, exceptions);
        } catch (IllegalManagedObjectNameException e) {
          CLIException ae = ArgumentExceptionFactory
              .adaptIllegalManagedObjectNameException(e, d);
          app.println();
          app.println(ae.getMessageObject());
          app.println();
          return null;
        }

        // Make sure that there are not any other children with the
        // same name.
        try {
          // Attempt to retrieve a child using this name.
          parent.getChild(irelation, input);
        } catch (AuthorizationException e) {
          Message msg = ERR_DSCFG_ERROR_CREATE_AUTHZ.get(irelation
              .getUserFriendlyName());
          throw new CLIException(msg);
        } catch (ConcurrentModificationException e) {
          Message msg = ERR_DSCFG_ERROR_CREATE_CME.get(irelation
              .getUserFriendlyName());
          throw new CLIException(msg);
        } catch (CommunicationException e) {
          Message msg = ERR_DSCFG_ERROR_CREATE_CE.get(irelation
              .getUserFriendlyName(), e.getMessage());
          throw new CLIException(msg);
        } catch (DefinitionDecodingException e) {
          // Do nothing.
        } catch (ManagedObjectDecodingException e) {
          // Do nothing.
        } catch (ManagedObjectNotFoundException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.