Class MongoDBBasedPolicyProviderDescriptor


  • public class MongoDBBasedPolicyProviderDescriptor
    extends org.ow2.authzforce.xmlns.pdp.ext.AbstractPolicyProvider
    Configuration descriptor for the policy provider module that retrieves policies (given a Policy(Set)IdReference) from documents in a MongoDB-hosted collection. The document model must correspond to JSON form: {id: $policy_ID, version: $policy_version, type: $policy_type, content: $policy_doc}, where $policy_ID must be a valid XACML 3.0 PolicyId, $policy_version a valid XACML 3.0 policy version, $policy_type either '{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}Policy' if the policy is XACML 3.0 Policy or '{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}PolicySet' if it is a XACML 3.0 PolicySet, and $policy_doc a valid XACML 3.0 Policy or PolicySet according to $policy_type. TODO: add settings to control the behavior of the client (MongoClientOptions) and its credentials (MongoCredentials).

    Java class for MongoDBBasedPolicyProviderDescriptor complex type.

    The following schema fragment specifies the expected content contained within this class.

     <complexType name="MongoDBBasedPolicyProviderDescriptor">
       <complexContent>
         <extension base="{http://authzforce.github.io/xmlns/pdp/ext/3}AbstractPolicyProvider">
           <attribute name="serverHost" use="required">
             <simpleType>
               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
                 <pattern value="localhost|([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}"/>
               </restriction>
             </simpleType>
           </attribute>
           <attribute name="serverPort" use="required">
             <simpleType>
               <restriction base="{http://www.w3.org/2001/XMLSchema}int">
                 <minInclusive value="1"/>
                 <maxInclusive value="65535"/>
               </restriction>
             </simpleType>
           </attribute>
           <attribute name="dbName" use="required">
             <simpleType>
               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
                 <minLength value="1"/>
               </restriction>
             </simpleType>
           </attribute>
           <attribute name="collectionName" use="required">
             <simpleType>
               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
                 <minLength value="1"/>
               </restriction>
             </simpleType>
           </attribute>
         </extension>
       </complexContent>
     </complexType>
     
    • Field Detail

      • serverHost

        protected String serverHost
      • serverPort

        protected int serverPort
      • dbName

        protected String dbName
      • collectionName

        protected String collectionName
    • Constructor Detail

      • MongoDBBasedPolicyProviderDescriptor

        public MongoDBBasedPolicyProviderDescriptor()
        Default no-arg constructor
      • MongoDBBasedPolicyProviderDescriptor

        public MongoDBBasedPolicyProviderDescriptor​(String serverHost,
                                                    int serverPort,
                                                    String dbName,
                                                    String collectionName)
        Fully-initialising value constructor
    • Method Detail

      • getServerHost

        public String getServerHost()
        Gets the value of the serverHost property.
        Returns:
        possible object is String
      • setServerHost

        public void setServerHost​(String value)
        Sets the value of the serverHost property.
        Parameters:
        value - allowed object is String
      • getServerPort

        public int getServerPort()
        Gets the value of the serverPort property.
      • setServerPort

        public void setServerPort​(int value)
        Sets the value of the serverPort property.
      • getDbName

        public String getDbName()
        Gets the value of the dbName property.
        Returns:
        possible object is String
      • setDbName

        public void setDbName​(String value)
        Sets the value of the dbName property.
        Parameters:
        value - allowed object is String
      • getCollectionName

        public String getCollectionName()
        Gets the value of the collectionName property.
        Returns:
        possible object is String
      • setCollectionName

        public void setCollectionName​(String value)
        Sets the value of the collectionName property.
        Parameters:
        value - allowed object is String