edu.internet2.middleware.subject.provider
Class JNDISubject

java.lang.Object
  extended by edu.internet2.middleware.subject.provider.SubjectImpl
      extended by edu.internet2.middleware.subject.provider.JNDISubject
All Implemented Interfaces:
Subject, Serializable

public class JNDISubject
extends SubjectImpl

JNDI Subject implementation. This will lazy load attributes only if needed

See Also:
Serialized Form

Constructor Summary
JNDISubject(String id1, String name1, String description1, String typeName1, String sourceId1)
           
JNDISubject(String id1, String name1, String description1, String typeName1, String sourceId1, Map<String,Set<String>> attributes1)
           
 
Method Summary
 Map<String,Set<String>> getAttributes()
          Gets a map attribute names and values.
 String getAttributeValue(String name1)
          Returns the value of a single-valued attribute.
 String getAttributeValueOrCommaSeparated(String attributeName)
           Returns the attribute value if single-valued, or if multi-valued, returns the values comma separated (with a space too).
 Set<String> getAttributeValues(String name1)
          Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.
 String getAttributeValueSingleValued(String attributeName)
          Returns the attribute value if single-valued, or if multi-valued, throws an exception.
 
Methods inherited from class edu.internet2.middleware.subject.provider.SubjectImpl
attributeValueOrCommaSeparated, equals, equalsStatic, getDescription, getId, getName, getSource, getSourceId, getType, getTypeName, hashCode, hashcodeStatic, initVirtualAttributes, setAttributes, setDescription, setId, setName, setSourceId, setTypeName, toAttributeMap, toString, toStringStatic, virtualAttributesForSource, virtualAttributeVariablesForSource
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JNDISubject

public JNDISubject(String id1,
                   String name1,
                   String description1,
                   String typeName1,
                   String sourceId1)
Parameters:
id1 -
name1 -
description1 -
typeName1 -
sourceId1 -

JNDISubject

public JNDISubject(String id1,
                   String name1,
                   String description1,
                   String typeName1,
                   String sourceId1,
                   Map<String,Set<String>> attributes1)
Parameters:
id1 -
name1 -
description1 -
typeName1 -
sourceId1 -
attributes1 -
Method Detail

getAttributes

public Map<String,Set<String>> getAttributes()
Description copied from class: SubjectImpl
Gets a map attribute names and values. The map's key contains the attribute name and the map's value contains a Set of attribute value(s). The returned Map can be augmented or changed

Specified by:
getAttributes in interface Subject
Overrides:
getAttributes in class SubjectImpl
Returns:
map or empty map or null if not there
See Also:
SubjectImpl.getAttributes()

getAttributeValue

public String getAttributeValue(String name1)
Description copied from class: SubjectImpl
Returns the value of a single-valued attribute. If multivalued, this returns the first value

Specified by:
getAttributeValue in interface Subject
Overrides:
getAttributeValue in class SubjectImpl
Returns:
value or null if not found
See Also:
SubjectImpl.getAttributeValue(java.lang.String)

getAttributeValueOrCommaSeparated

public String getAttributeValueOrCommaSeparated(String attributeName)
Description copied from interface: Subject
 Returns the attribute value if single-valued, or
 if multi-valued, returns the values comma separated (with a space too).
 So if the values are: a b c; this would return the string: "a, b, c"
 Implementors can use the static helper in SubjectImpl
 

Specified by:
getAttributeValueOrCommaSeparated in interface Subject
Overrides:
getAttributeValueOrCommaSeparated in class SubjectImpl
Returns:
value or values or null if not there
See Also:
SubjectImpl.getAttributeValueOrCommaSeparated(java.lang.String)

getAttributeValues

public Set<String> getAttributeValues(String name1)
Description copied from class: SubjectImpl
Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute. Note the returned set should not be changed.

Specified by:
getAttributeValues in interface Subject
Overrides:
getAttributeValues in class SubjectImpl
Returns:
set or empty set or null if not there
See Also:
SubjectImpl.getAttributeValues(java.lang.String)

getAttributeValueSingleValued

public String getAttributeValueSingleValued(String attributeName)
Description copied from interface: Subject
Returns the attribute value if single-valued, or if multi-valued, throws an exception. Implementors can use the static helper in SubjectImpl

Specified by:
getAttributeValueSingleValued in interface Subject
Overrides:
getAttributeValueSingleValued in class SubjectImpl
Returns:
value or null if not there
See Also:
SubjectImpl.getAttributeValueSingleValued(java.lang.String)