Class FMResourceMapper

  • All Implemented Interfaces:
    ResourceMapper

    public class FMResourceMapper
    extends Object
    implements ResourceMapper
    This class implements ResourceMapper to map between XACML context Resource and FM native resource This mapper would recognise only the following XACML defined attributeId
       urn:oasis:names:tc:xacml:1.0:resource:resource-id
     
    The attribtue is required to have dataType
     http://www.w3.org/2001/XMLSchema#string
     
    Attribute resource-id is mapped to OpenAM Policy resource name. This mapper also recognises only additional attributeId
     urn:opensso:names:xacml:2.0:resource:target-service
     
    The attribtue is required to have dataType
     http://www.w3.org/2001/XMLSchema#string
     
    Attribute target-service is mapped to OpenAM Policy service type name If the attribute is not specified in the request a default value of iPlanetAMWebAgentService would be used. This is the service name for policies that protect URLs.
    • Constructor Detail

      • FMResourceMapper

        public FMResourceMapper()
    • Method Detail

      • initialize

        public void initialize​(String pdpEntityId,
                               String pepEntityId,
                               Map properties)
                        throws XACMLException
        Initializes the mapper implementation. This would be called immediately after constructing an instance of the implementation.
        Specified by:
        initialize in interface ResourceMapper
        Parameters:
        pdpEntityId - EntityID of PDP
        pepEntityId - EntityID of PEP
        properties - configuration properties
        Throws:
        XACMLException - if can not initialize
      • mapToNativeResource

        public String[] mapToNativeResource​(Resource xacmlContextResource)
                                     throws XACMLException
        Returns native resource and service name
        Specified by:
        mapToNativeResource in interface ResourceMapper
        Parameters:
        xacmlContextResource - XACML context Resource
        Returns:
        native resource and service name. Returned object is an array of String objects. First element would be resource name. Second element would be service name.
        Throws:
        XACMLException - if can not map to native resource and service name
      • mapToXACMLResoure

        public Resource mapToXACMLResoure​(String resourceName,
                                          String serviceName)
                                   throws XACMLException
        Returns XACML context Resource
        Specified by:
        mapToXACMLResoure in interface ResourceMapper
        Parameters:
        resourceName - native resource name
        serviceName - native service name the requested resource belongs to
        Returns:
        XACML context Resource
        Throws:
        XACMLException - if can not map to XACML context Resource