Package org.nimbustools.ctxbroker

Examples of org.nimbustools.ctxbroker.ContextBrokerException


    public void injectData(String dataName, String value)
            throws ContextBrokerException {

        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 (?)");
        }

        synchronized (this.dbLock) {
            this._newData(dataName, value);
        }
View Full Code Here


        synchronized (this.dbLock) {

            if (this.totalNodes > 0) {
                if (this.totalNodes != totalNodesFromAgent) {
                    throw new ContextBrokerException("Context '" +
                        this.id + "' has received a conflicting " +
                        "total node count.  Was previously " + this.totalNodes +
                        "but has received a cluster definition with a total " +
                        "of " + totalNodesFromAgent);
                }
            } else {
                this.totalNodes = totalNodesFromAgent;
            }

            this.numNodes += 1;

            if (this.numNodes > this.totalNodes) {
                throw new ContextBrokerException("Context '" +
                        this.id + "' has heard from a new agent which " +
                        "makes the total node count exceed the theoretical" +
                        "maximum from the cluster definitions (" +
                        this.totalNodes + ").");
            }

            // invalidate cache if it existed
            this.allIdentityCache = null;

            Node node = this.allNodes.get(workspaceID);
            if (node != null) {
                throw new ContextBrokerException("Blackboard has " +
                        "already added node with ID #" + workspaceID);
            }

            String[] requiredDataNames = null;
            if (requiredData != null && requiredData.length > 0) {
View Full Code Here

                // only this specific interface provides the role

                final Identity identity = node.getParticularIdentity(iface);
                if (identity == null) {
                    throw new ContextBrokerException("There is an " +
                            "interface specification ('" + iface + "') in " +
                            "the provides section for role '" + roleName +
                            "' that does not have matching identity element " +
                            "with that interface name.  Cannot " +
                            "contextualize #" + node.getId());
View Full Code Here

                        found = true;
                        break;
                    }
                }
                if (!found) {
                    throw new ContextBrokerException("Set contained a " +
                            "required role already but we cannot find the " +
                            "object in the set's iterator (?).  Role: " + role);
                }
            }
View Full Code Here

            throw new IllegalArgumentException("workspaceID cannot be null");
        }
       
        final Node node = this.allNodes.get(workspaceID);
        if (node == null) {
            throw new ContextBrokerException("Blackboard is not aware " +
                    "of node with ID #" + workspaceID);
        }

        synchronized(this.dbLock) {
View Full Code Here

    public void okExit(Integer workspaceID)
            throws ContextBrokerException {

        final Node node = this.allNodes.get(workspaceID);
        if (node == null) {
            throw new ContextBrokerException("unknown workspace #" + workspaceID);
        }
        synchronized (this.dbLock) {
            CtxResult result = node.getCtxResult();

            if (result.hasOkOccurred() || result.hasErrorOccurred()) {
                throw new ContextBrokerException("already received " +
                        "exiting report from workspace #" + workspaceID);
            }

            result.setOkOccurred(true);
View Full Code Here

                          String errorMessage)
            throws ContextBrokerException {

        final Node node = this.allNodes.get(workspaceID);
        if (node == null) {
            throw new ContextBrokerException("unknown workspace #" + workspaceID);
        }
        synchronized (this.dbLock) {
            CtxResult result = node.getCtxResult();

            if (result.hasOkOccurred() || result.hasErrorOccurred()) {
                throw new ContextBrokerException("already received " +
                        "exiting report from workspace #" + workspaceID);
            }

            result.setErrorOccurred(true);
            result.setErrorCode(exitCode);
View Full Code Here

                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

        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

    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

TOP

Related Classes of org.nimbustools.ctxbroker.ContextBrokerException

Copyright © 2018 www.massapicom. 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.