Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Registry


     *
     * @throws GovernanceException if the operation failed.
     */
    public void loadSchemaDetails() throws GovernanceException {
        checkRegistryResourceAssociation();
        Registry registry = getAssociatedRegistry();
        String path = getPath();
        String id = getId();
        Resource resource;
        try {
            resource = registry.get(path);
            byte[] content = (byte[]) resource.getContent();
            schemaElement = GovernanceUtils.buildOMElement(content);

        } catch (RegistryException e) {
            String msg =
View Full Code Here


     */
    @SuppressWarnings("unused")
    public void activate() throws GovernanceException {
        checkRegistryResourceAssociation();
        try {
            Registry registry = getAssociatedRegistry();
            String path = getPath();
            Resource r = registry.get(path);
            r.setProperty(ACTIVATE_PROPERTY_FLAG_NAME, ACTIVATE_PROPERTY_FLAG_VALUE_IN_ACTIVE);
            registry.put(path, r);
        } catch (RegistryException e) {
            String msg = "Error in activating the service: id:" + getId() +
                    ", path: " + getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
View Full Code Here

     */
    @SuppressWarnings("unused")
    public void deactivate() throws GovernanceException {
        checkRegistryResourceAssociation();
        try {
            Registry registry = getAssociatedRegistry();
            String path = getPath();
            Resource r = registry.get(path);
            r.setProperty(ACTIVATE_PROPERTY_FLAG_NAME, ACTIVATE_PROPERTY_FLAG_VALUE_IN_INACTIVE);
            registry.put(path, r);
        } catch (RegistryException e) {
            String msg = "Error in activating the service: id:" + getId() +
                    ", path: " + getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
View Full Code Here

     */
    @SuppressWarnings("unused")
    public void setActive(boolean isActive) throws GovernanceException {
        checkRegistryResourceAssociation();
        try {
            Registry registry = getAssociatedRegistry();
            String path = getPath();
            Resource r = registry.get(path);
            r.setProperty(ACTIVATE_PROPERTY_FLAG_NAME, isActive ?
                    ACTIVATE_PROPERTY_FLAG_VALUE_IN_ACTIVE :
                    ACTIVATE_PROPERTY_FLAG_VALUE_IN_INACTIVE);
            registry.put(path, r);
        } catch (RegistryException e) {
            String msg = "Error in activating the service: id:" + getId() +
                    ", path: " + getPath() + ".";
            log.error(msg, e);
            throw new GovernanceException(msg, e);
View Full Code Here

     */
    @SuppressWarnings("unused")
    public boolean isActive() throws GovernanceException {
        checkRegistryResourceAssociation();
        try {
            Registry registry = getAssociatedRegistry();
            String path = getPath();
            Resource r = registry.get(path);
            // if the inactive flag is not set explicitly it is active.
            return !ACTIVATE_PROPERTY_FLAG_VALUE_IN_INACTIVE
                    .equals(r.getProperty(ACTIVATE_PROPERTY_FLAG_NAME));
        } catch (RegistryException e) {
            String msg = "Error in checking the activeness of the service: id:" + getId() +
View Full Code Here

     * @return all policies attached to this service artifact.
     * @throws GovernanceException if the operation failed.
     */
    public Policy[] getAttachedPolicies() throws GovernanceException {
        checkRegistryResourceAssociation();
        Registry registry = getAssociatedRegistry();
        String path = getPath();
        List<Policy> policies = new ArrayList<Policy>();
        try {
            Association[] associations =
                    registry.getAssociations(path, GovernanceConstants.DEPENDS);
            for (Association association : associations) {
                String destinationPath = association.getDestinationPath();
                GovernanceArtifact governanceArtifact =
                        GovernanceUtils.retrieveGovernanceArtifactByPath(registry, destinationPath);
                if (governanceArtifact instanceof Policy) {
View Full Code Here

     * @throws GovernanceException if the operation failed.
     */
    @SuppressWarnings("unused")
    public Schema[] getAttachedSchemas() throws GovernanceException {
        checkRegistryResourceAssociation();
        Registry registry = getAssociatedRegistry();
        String path = getPath();
        List<Schema> schemas = new ArrayList<Schema>();
        try {
            Association[] associations =
                    registry.getAssociations(path, GovernanceConstants.DEPENDS);
            for (Association association : associations) {
                String destinationPath = association.getDestinationPath();
                GovernanceArtifact governanceArtifact =
                        GovernanceUtils.retrieveGovernanceArtifactByPath(registry, destinationPath);
                if (governanceArtifact instanceof Schema) {
View Full Code Here

     * @return all WSDLs attached to this service artifact.
     * @throws GovernanceException if the operation failed.
     */
    public Wsdl[] getAttachedWsdls() throws GovernanceException {
        checkRegistryResourceAssociation();
        Registry registry = getAssociatedRegistry();
        String path = getPath();
        List<Wsdl> wsdls = new ArrayList<Wsdl>();
        try {
            Association[] associations =
                    registry.getAssociations(path, GovernanceConstants.DEPENDS);
            for (Association association : associations) {
                String destinationPath = association.getDestinationPath();
                GovernanceArtifact governanceArtifact =
                        GovernanceUtils.retrieveGovernanceArtifactByPath(registry, destinationPath);
                if (governanceArtifact instanceof Wsdl) {
View Full Code Here

     * @return all endpoints attached to this service artifact.
     * @throws GovernanceException if the operation failed.
     */
    public Endpoint[] getAttachedEndpoints() throws GovernanceException {
        checkRegistryResourceAssociation();
        Registry registry = getAssociatedRegistry();
        String path = getPath();
        List<Endpoint> endpoints = new ArrayList<Endpoint>();
        try {
            Association[] associations =
                    registry.getAssociations(path, GovernanceConstants.DEPENDS);
            for (Association association : associations) {
                String destinationPath = association.getDestinationPath();
                GovernanceArtifact governanceArtifact =
                        GovernanceUtils.retrieveGovernanceArtifactByPath(registry, destinationPath);
                if (governanceArtifact instanceof Endpoint) {
View Full Code Here

            }
            initialized = true;
            try {
                // We can't get Registry from Utils, as the MessageContext is not available at
                // activation time.
                Registry systemRegistry = registryService.getConfigSystemRegistry();
                if (registry != null && registry == systemRegistry) {
                    // Handler has already been set.
                    return;
                }
                registry = systemRegistry;
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.Registry

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.