org.wso2.carbon.governance.api.policies.dataobjects
Class Policy

java.lang.Object
  extended by org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact
      extended by org.wso2.carbon.governance.api.policies.dataobjects.Policy

public class Policy
extends GovernanceArtifact

This represents a policy artifact stored on the Registry. Policy artifacts are created as a result of importing or uploading a policy.


Field Summary
 
Fields inherited from class org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact
attributes
 
Constructor Summary
Policy(String id, String url)
          Constructor accepting resource identifier and the policy URL.
Policy(String path, String id, org.wso2.carbon.registry.core.Registry registry)
          Constructor accepting resource path, identifier and a registry instance.
 
Method Summary
 String getPath()
          Returns the path.
 String getPolicyContent()
          Method to obtain the policy element of this policy artifact.
 QName getQName()
          Returns the QName of the artifact.
 String getUrl()
          Method to obtain the policy URL.
 void loadPolicyDetails()
          Method to load the policy details into this artifact.
 void setName(String name)
          Method to set the name of the policy.
 void setPolicyContent(String policyContent)
          Method to set the policy element of this policy artifact.
 
Methods inherited from class org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact
addAttribute, associateRegistry, attach, checkRegistryResourceAssociation, createVersion, detach, getAssociatedRegistry, getAttribute, getAttributeKeys, getAttributes, getDependencies, getDependents, getId, removeAttribute, setAttribute, setAttributes, setId, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Policy

public Policy(String path,
              String id,
              org.wso2.carbon.registry.core.Registry registry)
       throws GovernanceException
Constructor accepting resource path, identifier and a registry instance.

Parameters:
path - the resource path.
id - the resource identifier.
registry - the registry instance.
Throws:
GovernanceException - if the construction fails.

Policy

public Policy(String id,
              String url)
Constructor accepting resource identifier and the policy URL.

Parameters:
id - the resource identifier.
url - the policy URL.
Method Detail

getQName

public QName getQName()
Description copied from class: GovernanceArtifact
Returns the QName of the artifact.

Specified by:
getQName in class GovernanceArtifact
Returns:
the QName of the artifact

getPolicyContent

public String getPolicyContent()
Method to obtain the policy element of this policy artifact.

Returns:
the policy element.

setPolicyContent

public void setPolicyContent(String policyContent)
Method to set the policy element of this policy artifact.

Parameters:
policyContent - the policy element.

getUrl

public String getUrl()
Method to obtain the policy URL.

Returns:
the policy URL.

setName

public void setName(String name)
Method to set the name of the policy.

Parameters:
name - the name of the policy.

getPath

public String getPath()
Description copied from class: GovernanceArtifact
Returns the path.

Overrides:
getPath in class GovernanceArtifact
Returns:
the path.

loadPolicyDetails

public void loadPolicyDetails()
                       throws GovernanceException
Method to load the policy details into this artifact.

Throws:
GovernanceException - if the operation failed.


Copyright © 2010 WSO2 Inc. All Rights Reserved.