org.edg.security.authorization.map
Interface AttributeMap

All Superinterfaces:
java.util.Map
All Known Implementing Classes:
DefaultAttributeMap

public interface AttributeMap
extends java.util.Map

The standard Java Map extended with some utility functions to ease its use in the particular case that the keys are String (subject) and maps against List of String (attributes).

Author:
mulmo
See Also:
AttributeMapFactory

Method Summary
 void addAttribute(java.lang.String key, java.lang.String value)
          Convenience method to add a single attribute to the existing set of attributes associated with a key.
 void addAttributes(java.lang.String key, java.util.List values)
          Convenience method to add a set of attributes.
 java.util.List getAttributes(java.lang.String key)
          Convenience method to get the right return type, and to get an empty list in case of no match.
 boolean hasMapping(java.lang.String key, java.lang.String value)
          This method has the same semantics as the call getAttributes(key).contains(value)
but may be optimized for the particular Map
 java.lang.String removeAttribute(java.lang.String key, java.lang.String value)
          Removal of a particular attribute in the list of attributes for the given subject.
 void terminate()
          Terminate all Timer objects responsible for refreshing the content of the AttributeMap.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getAttributes

public java.util.List getAttributes(java.lang.String key)
Convenience method to get the right return type, and to get an empty list in case of no match.

Returns:
List of String, or an empty list if no match
See Also:
Map.get(Object)

addAttributes

public void addAttributes(java.lang.String key,
                          java.util.List values)
Convenience method to add a set of attributes.

This is typically implemented as an iteration of calls to addAttribute(String, String), one call for each value in the List.

This feature may be overriden by a particular Map implementation.

Parameters:
key - the key
values - List of String with attributes
See Also:
Map.put(Object, Object)

addAttribute

public void addAttribute(java.lang.String key,
                         java.lang.String value)
Convenience method to add a single attribute to the existing set of attributes associated with a key. This may be needed to be overriden by a particular Map.

Parameters:
key - the key
value - The attribute to add
See Also:
Map.put(Object, Object)

hasMapping

public boolean hasMapping(java.lang.String key,
                          java.lang.String value)
This method has the same semantics as the call getAttributes(key).contains(value)
but may be optimized for the particular Map

Parameters:
key - the key
value - the value to match against
Returns:
boolean if the mapping exists

removeAttribute

public java.lang.String removeAttribute(java.lang.String key,
                                        java.lang.String value)
Removal of a particular attribute in the list of attributes for the given subject.
This call may be optimized for the particular Map instance.

Parameters:
key - the key
value - a single value to remove from the list of values associated with the key
See Also:
Map.remove(java.lang.Object)

terminate

public void terminate()
Terminate all Timer objects responsible for refreshing the content of the AttributeMap.