Class PolicyImpl

  • All Implemented Interfaces:
    GovernanceArtifact, Policy

    public class PolicyImpl
    extends GovernanceArtifactImpl
    implements Policy
    This represents a policy artifact stored on the Registry. Policy artifacts are created as a result of importing or uploading a policy.
    • Constructor Detail

      • PolicyImpl

        public PolicyImpl​(String id,
                          org.wso2.carbon.registry.core.Registry registry)
                   throws GovernanceException
        Constructor accepting resource path, identifier and a registry instance. This constructor should be used only when the policy already saved in the registry.
        Parameters:
        path - the resource path.
        id - the resource identifier.
        registry - the registry instance.
        Throws:
        GovernanceException - if the construction fails.
      • PolicyImpl

        public PolicyImpl​(String id,
                          String url)
        Constructor accepting resource identifier and the policy URL.
        Parameters:
        id - the resource identifier.
        url - the policy URL.
    • Method Detail

      • getPolicyContent

        public String getPolicyContent()
        Method to obtain the policy element of this policy artifact.
        Specified by:
        getPolicyContent in interface Policy
        Returns:
        the policy element.
      • setPolicyContent

        public void setPolicyContent​(String policyContent)
        Method to set the policy element of this policy artifact.
        Specified by:
        setPolicyContent in interface Policy
        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.