Package org.wso2.carbon.governance.api.exception

Examples of org.wso2.carbon.governance.api.exception.GovernanceException


            } catch (RegistryException e) {
                String msg =
                        "Error in setting the content from schema, schema id: " + schema.getId() +
                                ", schema path: " + schema.getPath() + ".";
                log.error(msg, e);
                throw new GovernanceException(msg, e);
            }
        }
        // and set all the attributes as properties.
        String[] attributeKeys = schema.getAttributeKeys();
        if (attributeKeys != null) {
View Full Code Here


        try {
            parser = XMLInputFactory.newInstance().createXMLStreamReader(inputStream);
        } catch (XMLStreamException e) {
            String msg = "Error in initializing the parser to build the OMElement.";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }

        //create the builder
        StAXOMBuilder builder = new StAXOMBuilder(parser);
        //get the root element (in this case the envelope)
View Full Code Here

        try {
            return element.toStringWithConsume();
        } catch (XMLStreamException e) {
            String msg = "Error in serializing the OMElement.";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

            parameter.put("query", sql);
            result = (String[]) registry.executeQuery(null, parameter).getContent();
        } catch (RegistryException e) {
            String msg = "Error in getting the result for media type: " + mediaType + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
        return result;
    }
View Full Code Here

            if (!registry.resourceExists(path)) {
                String msg =
                        "The artifact is not added to the registry. Please add the artifact " +
                                "before creating versions.";
                log.error(msg);
                throw new GovernanceException(msg);
            }
            registry.createVersion(path);
        } catch (RegistryException e) {
            String msg = "Error in creating a version for the artifact. id: " + id +
                    ", path: " + path + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

            }
        } catch (RegistryException e) {
            String msg = "Error in getting dependencies from the artifact. id: " + id +
                    ", path: " + path + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
        return governanceArtifacts.toArray(new GovernanceArtifact[governanceArtifacts.size()]);
    }
View Full Code Here

            }
        } catch (RegistryException e) {
            String msg = "Error in getting dependents from the artifact. id: " + id +
                    ", path: " + path + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
        return governanceArtifacts.toArray(new GovernanceArtifact[governanceArtifacts.size()]);
    }
View Full Code Here

        String path = getPath();
        String attachedToArtifactPath = attachedToArtifact.getPath();
        if (attachedToArtifactPath == null) {
            String msg = "'Attached to artifact' is not associated with a registry path.";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        try {
            registry.addAssociation(path, attachedToArtifactPath, GovernanceConstants.DEPENDS);
            registry.addAssociation(attachedToArtifactPath, path, GovernanceConstants.USED_BY);
        } catch (RegistryException e) {
            String msg = "Error in attaching the artifact. source id: " + id + ", path: " + path +
                    ", target id: " + attachedToArtifact.getId() + ", path:" +
                    attachedToArtifactPath +
                    ", attachment type: " + attachedToArtifact.getClass().getName() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

        String path = getPath();
        String artifactPath = GovernanceUtils.getArtifactPath(registry, artifactId);
        if (artifactPath == null) {
            String msg = "Attached to artifact is not associated with a registry path.";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        try {
            registry.removeAssociation(path, artifactPath, GovernanceConstants.DEPENDS);
            registry.removeAssociation(artifactPath, path, GovernanceConstants.USED_BY);
        } catch (RegistryException e) {
            String msg = "Error in detaching the artifact. source id: " + id + ", path: " + path +
                    ", target id: " + artifactId +
                    ", target path:" + artifactPath + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

        // uses the path from the getter to make sure the used overloaded method
        String path = getPath();
        if (registry == null) {
            String msg = "A registry is not associated with the artifact.";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        if (path == null) {
            String msg = "A path is not associated with the artifcat.";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        if (id == null) {
            String msg = "An id is not associated with the artifcat.";
            log.error(msg);
            throw new GovernanceException(msg);
        }
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.governance.api.exception.GovernanceException

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.