Examples of ContextBrokerException


Examples of org.nimbustools.ctxbroker.ContextBrokerException

                target = newpiece + "," + target;
            }
        }

        if (cnCount == 0) {
            throw new ContextBrokerException("Unsupported: CA has no " +
                                                 "CN (?)");
        }

        if (cnCount != 1) {
            throw new ContextBrokerException("Unsupported: CA has more " +
                                                 "than one CN");
        }

        this.targetString = target;
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

        try {
            cert = this.ca.signNewCertificate(uuid,
                                              keypair.getPublic(),
                                              expires);
        } catch (SignatureException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (InvalidKeyException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (CertificateException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        } catch (IOException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        }

        try {
            bootstrap.setX509Cert(cert);
        } catch (CertificateEncodingException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        }
        try {
            bootstrap.setKeypair(keypair);
        } catch (IOException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        }

        X500Principal subjectDN = cert.getSubjectX500Principal();
        String DN = subjectDN.getName(X500Principal.RFC2253);
        String globusDN = CertUtil.toGlobusID(DN, false);
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

    public void initialize() throws Exception {

        if (this.caCertPath == null) {
            final String msg = "No CA certificate path was provided.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }
        logger.debug("caCertPath provided: '" + this.caCertPath + "'");

        if (this.caKeyPath == null) {
            final String msg = "No CA key path was provided.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }
        logger.debug("caKeyPath provided: '" + this.caKeyPath + "'");

        File cert = new File(this.caCertPath);
        if (!cert.isAbsolute()) {
            final String msg = "Configured CA certificate path ('" +
                               this.caCertPath + "') is not an absolute path.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }

        if (!cert.canRead()) {
            final String msg = "Configured CA certificate path ('" +
                               this.caCertPath + "') can not be read.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }

        cert = new File(this.caKeyPath);
        if (!cert.isAbsolute()) {
            final String msg = "Configured CA key path ('" + this.caKeyPath +
                               "') is not an absolute path.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }

        if (!cert.canRead()) {
            final String msg = "Configured CA key path ('" +
                               this.caKeyPath + "') can not be read.";
            logger.error(msg); // hard to see amidst JNDI problem
            throw new ContextBrokerException(msg);
        }

        final GlobusCredential caGlobusCred =
                new GlobusCredential(this.caCertPath, this.caKeyPath);
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

        String url;
        try {
            url = ServiceHost.getBaseURL()
                            + BrokerConstants.CTX_BROKER_PATH;
        } catch (IOException e) {
            throw new ContextBrokerException(e.getMessage(), e);
        }

        this.newBootstrap("fake-UUID", url, expires);

        // for now, not going through and checking validity of cert
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

    // always access it this way internally in the class or there may
    // be a check then act on the cache set
    public synchronized Blackboard getBlackboard()
                                    throws ContextBrokerException {
        if (this.resourceID == null) {
            throw new ContextBrokerException("no resource id yet (?)");
        }
        if (this.blackboard == null) {
            this.blackboard =
                    Blackboard.createOrGetBlackboard(this.resourceID);
        }
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

    }

    public void noMoreInjections() throws ContextBrokerException {

        if (!this.allowInjections) {
            throw new ContextBrokerException("Erroneous: noMoreInjections " +
                    "called but injections weren't expected in the first" +
                    "place");
        }

        synchronized (this.statusLock) {
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

                // (without going through role finding which will always place
                // identities in the filled requires document for a role,
                // regardless if all identities are required or not).

                if (givenID.length > 1) {
                    throw new ContextBrokerException("Given requires " +
                            "section has multiple identity elements? Currently " +
                            "only supporting zero or one empty identity element " +
                            "in requires section (which signals all identities " +
                            "are desired).  Will not contextualize #" +
                            workspaceID + ".");
                }

                if (givenID[0].getHostname() != null ||
                        givenID[0].getIp() != null ||
                        givenID[0].getPubkey() != null) {

                    throw new ContextBrokerException("Given requires " +
                            "section has an identity element with information " +
                            "in it? Currently only supporting zero or one " +
                            "*empty* identity element in requires section " +
                            "(which signals all identities are desired).  Will " +
                            "not contextualize #" + workspaceID + ".");
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

                    Requires_TypeData data = datas[i];
                    final String dataName = data.getName();

                    if (dataName == null || dataName.trim().length() == 0) {
                        // does not happen when object is created via XML (which is usual)
                        throw new ContextBrokerException("Empty data element name (?)");
                    }
                    dataPairs[i] = new DataPair(dataName, data.get_value());
                }
                return dataPairs;
            }
View Full Code Here

Examples of org.nimbustools.ctxbroker.ContextBrokerException

        // name attribute is relevant for given requires roles, NOT value
        final String roleName = typeRole.getName();
        if (roleName == null || roleName.trim().equals("")) {
            // does not happen when object is created via XML (which is usual)
            throw new ContextBrokerException("Empty role name (?)");
        }

        boolean hostRequired = false;
        if (typeRole.getHostname() != null &&
                typeRole.getHostname()) {
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.