Examples of GovernanceException


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

            succeeded = true;
        } catch (RegistryException e) {
            String msg = "Error in updating the artifact, artifact id: " + service.getId() +
                    ", artifact path: " + service.getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        } finally {
            if (succeeded) {
                try {
                    registry.commitTransaction();
                } catch (RegistryException e) {
View Full Code Here

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

        GovernanceArtifact artifact =
                GovernanceUtils.retrieveGovernanceArtifactById(registry, serviceId);
        if (artifact != null && !(artifact instanceof Service)) {
            String msg = "The artifact request is not a " + type + ". id: " + serviceId + ".";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        return (Service) artifact;
    }
View Full Code Here

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

            }
        } catch (RegistryException e) {
            String msg = "Error in saving attributes for the artifact. id: " + service.getId() +
                    ", path: " + service.getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

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

        } catch (RegistryException e) {
            String msg =
                    "Error in getting the content for the artifact. artifact id: " + id + ", " +
                            "path: " + path + ".";
            log.error(msg);
            throw new GovernanceException(msg, e);
        }
        // get the target namespace.

        name = RegistryUtils.getResourceName(path);
View Full Code Here

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

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

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

            schema.loadSchemaDetails();
            succeeded = true;
        } catch (RegistryException e) {
            String msg = "Error in adding the Schema. schema id: " + schema.getId() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        } catch (MalformedURLException e) {
            String msg = "Malformed schema url provided. url: " + schema.getUrl() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        } finally {
            if (succeeded) {
                try {
                    registry.commitTransaction();
                } catch (RegistryException e) {
View Full Code Here

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

                        GovernanceConstants.GOVERNANCE_ARTIFACT_INDEX_PATH);
            } else {
                String msg = "The artifact index doesn't exist. artifact index path: " +
                        GovernanceConstants.GOVERNANCE_ARTIFACT_INDEX_PATH + ".";
                log.error(msg);
                throw new GovernanceException(msg);
            }
            String path = resource.getProperty(artifactId);
            if (registry.resourceExists(path)) {
                registry.delete(path);
            }
            resource.removeProperty(artifactId);
            governanceSystemRegistry.put(
                    GovernanceConstants.GOVERNANCE_ARTIFACT_INDEX_PATH, resource);
        } catch (RegistryException e) {
            String msg = "Error in deleting the the artifact id:" + artifactId + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

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

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

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

        } catch (RegistryException e) {
            String msg = "Error in getting the artifact id to path map: " +
                    GovernanceConstants.GOVERNANCE_ARTIFACT_INDEX_PATH +
                    ", artifact id:" + artifactId + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        }
    }
View Full Code Here

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

            String msg =
                    "Updates are only accepted if the schemeElement is available. " +
                            "So no updates will be done. " + "schema id: " + schema.getId() +
                            ", schema path: " + schema.getPath() + ".";
            log.error(msg);
            throw new GovernanceException(msg);
        }
        boolean succeeded = false;
        try {
            registry.beginTransaction();

            // getting the old schema.
            Schema oldSchema = getSchema(schema.getId());
            if (oldSchema == null) {
                addSchema(schema);
                return;
            }
            // we are expecting only the OMElement to be different.
            Resource schemaResource = registry.newResource();
            schemaResource.setMediaType(GovernanceConstants.SCHEMA_MEDIA_TYPE);

            // setting the schema content
            setContent(schema, schemaResource);

            registry.put(oldSchema.getPath(), schemaResource);
            schema.updatePath();
            schema.loadSchemaDetails();

            succeeded = true;
        } catch (RegistryException e) {
            String msg =
                    "Error in updating the schema, schema id: " + schema.getId() +
                            ", schema path: " + schema.getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
        } finally {
            if (succeeded) {
                try {
                    registry.commitTransaction();
                } catch (RegistryException 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.