Class PolicyAdapter

    • Constructor Detail

      • PolicyAdapter

        public PolicyAdapter​(PolicyEntity entity,
                             javax.persistence.EntityManager em,
                             StoreFactory storeFactory)
    • Method Detail

      • getId

        public String getId()
        Description copied from interface: Policy
        Returns the unique identifier for this instance.
        Specified by:
        getId in interface Policy
        Returns:
        the unique identifier for this instance
      • getType

        public String getType()
        Description copied from interface: Policy
        Returns the type of this policy.
        Specified by:
        getType in interface Policy
        Returns:
        the type of this policy
      • setDecisionStrategy

        public void setDecisionStrategy​(DecisionStrategy decisionStrategy)
        Description copied from interface: Policy
        Sets the {DecisionStrategy} for this policy.
        Specified by:
        setDecisionStrategy in interface Policy
        Parameters:
        decisionStrategy - for this policy
      • getLogic

        public Logic getLogic()
        Description copied from interface: Policy
        Returns the Logic for this policy.
        Specified by:
        getLogic in interface Policy
        Returns:
        the decision strategy defined for this policy
      • setLogic

        public void setLogic​(Logic logic)
        Description copied from interface: Policy
        Sets the {Logic} for this policy.
        Specified by:
        setLogic in interface Policy
        Parameters:
        logic - for this policy
      • getConfig

        public Map<String,​String> getConfig()
        Description copied from interface: Policy
        Returns a Map holding string-based key/value pairs representing any additional configuration for this policy.
        Specified by:
        getConfig in interface Policy
        Returns:
        a unmodifiable map with any additional configuration defined for this policy.
      • setConfig

        public void setConfig​(Map<String,​String> config)
        Description copied from interface: Policy
        Sets a Map with string-based key/value pairs representing any additional configuration for this policy.
        Specified by:
        setConfig in interface Policy
        Parameters:
        config - a map with any additional configuration for this policy.
      • getName

        public String getName()
        Description copied from interface: Policy
        Returns the name of this policy.
        Specified by:
        getName in interface Policy
        Returns:
        the name of this policy
      • setName

        public void setName​(String name)
        Description copied from interface: Policy
        Sets an unique name to this policy.
        Specified by:
        setName in interface Policy
        Parameters:
        name - an unique name
      • getDescription

        public String getDescription()
        Description copied from interface: Policy
        Returns the description of this policy.
        Specified by:
        getDescription in interface Policy
        Returns:
        a description or null of there is no description
      • setDescription

        public void setDescription​(String description)
        Description copied from interface: Policy
        Sets the description for this policy.
        Specified by:
        setDescription in interface Policy
        Parameters:
        description - a description
      • getAssociatedPolicies

        public Set<Policy> getAssociatedPolicies()
        Description copied from interface: Policy
        Returns the Policy instances associated with this policy and used to evaluate authorization decisions when this policy applies.
        Specified by:
        getAssociatedPolicies in interface Policy
        Returns:
        the associated policies or an empty set if no policy is associated with this policy
      • getResources

        public Set<Resource> getResources()
        Description copied from interface: Policy
        Returns the Resource instances where this policy applies.
        Specified by:
        getResources in interface Policy
        Returns:
        a set with all resource instances where this policy applies. Or an empty set if there is no resource associated with this policy
      • getScopes

        public Set<Scope> getScopes()
        Description copied from interface: Policy
        Returns the Scope instances where this policy applies.
        Specified by:
        getScopes in interface Policy
        Returns:
        a set with all scope instances where this policy applies. Or an empty set if there is no scope associated with this policy
      • addScope

        public void addScope​(Scope scope)
        Specified by:
        addScope in interface Policy
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toEntity

        public static PolicyEntity toEntity​(javax.persistence.EntityManager em,
                                            Policy policy)