org.openliberty.openaz.pep
Class SimpleJavaPermissionMapper

java.lang.Object
  extended by org.openliberty.openaz.pep.SimpleJavaPermissionMapper
All Implemented Interfaces:
JavaObjectMapper

public class SimpleJavaPermissionMapper
extends java.lang.Object
implements JavaObjectMapper

Default Java Permission implementation of JavObjectMapper. It supports the mapping of

to containing Basically, a typical Java Permission is converted to three XACML name,value pairs of AttributeId and AttributeValue.

Author:
Josh Bregman, Rich Levinson, Prateek Mishra

Constructor Summary
SimpleJavaPermissionMapper()
           
 
Method Summary
 boolean canMapObject(java.lang.Object obj)
          Determines if the object requested to map is a Java Permission.
 java.util.Set<java.lang.Class> getSupportedClasses()
          Returns the Set of Classes supported by this Mapper.
<T extends java.lang.Enum<T>>
AzWrapperRequestObject<T>
map(java.lang.Object javaObject, AzWrapperRequestObject<T> azWrapperRequestObject)
          Maps a Java Permission object to a set of XACML attributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJavaPermissionMapper

public SimpleJavaPermissionMapper()
Method Detail

getSupportedClasses

public java.util.Set<java.lang.Class> getSupportedClasses()
Returns the Set of Classes supported by this Mapper.

Specified by:
getSupportedClasses in interface JavaObjectMapper
Returns:
a set of classes

canMapObject

public boolean canMapObject(java.lang.Object obj)
Determines if the object requested to map is a Java Permission.

Specified by:
canMapObject in interface JavaObjectMapper
Parameters:
obj - An Object
Returns:
a boolean set to true if obj is a Java Permission, ow false

map

public <T extends java.lang.Enum<T>> AzWrapperRequestObject<T> map(java.lang.Object javaObject,
                                                                   AzWrapperRequestObject<T> azWrapperRequestObject)
                                                        throws PepException
Maps a Java Permission object to a set of XACML attributes. The Java Permission maps as follows:
   - The value of Permission.getName() maps to the value of
      the Resource Attribute with AttributeId:
        "urn:oasis:names:tc:xacml:1.0:resource:resource-id"
   - The value of Permission.getClass().getName() maps to 
      the value of a Resource Attribute with AttributeId:
       "org.openliberty.openaz.pep.resource.resource-type"
   - The value of Permission.getActions() maps to the value of
      the Action Attribute with AttributeId:
       "urn:oasis:names:tc:xacml:1.0:action:implied-action"  
 

Specified by:
map in interface JavaObjectMapper
Returns:
Throws:
PepException