Class LazySubject

java.lang.Object
edu.internet2.middleware.grouper.subj.LazySubject
All Implemented Interfaces:
Subject, Serializable

public class LazySubject extends Object implements Subject
Subject from a Membership - getMember().getSubject() only called if necessary i.e. the UI pages results and so it is often not necessary to instantiate all the Subjects (and Members)

Version:
$Id: LazySubject.java,v 1.11 2009-10-31 16:27:12 mchyzer Exp $
See Also:
  • Constructor Details

    • LazySubject

      public LazySubject(String sourceId, String subjectId)
    • LazySubject

      public LazySubject(Membership ms)
      Parameters:
      ms -
    • LazySubject

      public LazySubject(Member member)
      Parameters:
      member -
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getAttributes

      public Map getAttributes()
      Description copied from interface: Subject
      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). This does not return internal attributes. Note, the keys are case-insensitive
      Specified by:
      getAttributes in interface Subject
      Returns:
      map or empty map or null if not there
      See Also:
    • getAttributeValue

      public String getAttributeValue(String name)
      Description copied from interface: Subject
      Returns the value of a single-valued attribute. If multivalued, this returns the first value. This does not return values for internal attributes. Note, the keys are case-insensitive
      Specified by:
      getAttributeValue in interface Subject
      Returns:
      value or null if not found
      See Also:
    • getAttributeValues

      public Set getAttributeValues(String name)
      Description copied from interface: Subject
      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. This does not return values for internal attributes. Note, the keys are case-insensitive
      Specified by:
      getAttributeValues in interface Subject
      Returns:
      set or empty set or null if not there
      See Also:
    • getDescription

      public String getDescription()
      Description copied from interface: Subject
      Gets this Subject's description.
      Specified by:
      getDescription in interface Subject
      Returns:
      description or null if not there
      See Also:
    • getId

      public String getId()
      Description copied from interface: Subject
      Gets this Subject's ID.
      Specified by:
      getId in interface Subject
      Returns:
      string
      See Also:
    • getName

      public String getName()
      Description copied from interface: Subject
      Gets this Subject's name.
      Specified by:
      getName in interface Subject
      Returns:
      name or null if not there
      See Also:
    • getSource

      public Source getSource()
      Description copied from interface: Subject
      Returns the Source of this Subject.
      Specified by:
      getSource in interface Subject
      Returns:
      source
      See Also:
    • getSourceId

      public String getSourceId()
      get the source id
      Specified by:
      getSourceId in interface Subject
      Returns:
      the soruce id
    • getType

      public SubjectType getType()
      Description copied from interface: Subject
      Gets this Subject's type.
      Specified by:
      getType in interface Subject
      Returns:
      subject type
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • getMembership

      public Membership getMembership()
      Returns:
      membership
    • getTypeName

      public String getTypeName()
      Description copied from interface: Subject
      get the type name
      Specified by:
      getTypeName in interface Subject
      Returns:
      the type name
      See Also:
    • 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.
       This does not return values for internal attributes.
       Note, the keys are case-insensitive
       
      Specified by:
      getAttributeValueOrCommaSeparated in interface Subject
      Returns:
      value or values or null if not there
      See Also:
    • 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. This does not return values for internal attributes. Note, the keys are case-insensitive
      Specified by:
      getAttributeValueSingleValued in interface Subject
      Returns:
      value or null if not there
      See Also:
    • getAttributeValue

      public String getAttributeValue(String attributeName, boolean excludeInternalAttributes)
      Description copied from interface: Subject
      Returns the value of a single-valued attribute. If multivalued, this returns the first value. Note, the keys are case-insensitive
      Specified by:
      getAttributeValue in interface Subject
      excludeInternalAttributes - if true, values for internal attributes are not returned
      Returns:
      value or null if not found
      See Also:
    • getAttributeValues

      public Set<String> getAttributeValues(String attributeName, boolean excludeInternalAttributes)
      Description copied from interface: Subject
      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. Note, the keys are case-insensitive
      Specified by:
      getAttributeValues in interface Subject
      excludeInternalAttributes - if true, values for internal attributes are not returned
      Returns:
      set or empty set or null if not there
      See Also:
    • getAttributeValueOrCommaSeparated

      public String getAttributeValueOrCommaSeparated(String attributeName, boolean excludeInternalAttributes)
      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.
       Note, the keys are case-insensitive
       
      Specified by:
      getAttributeValueOrCommaSeparated in interface Subject
      excludeInternalAttributes - if true, values for internal attributes are not returned
      Returns:
      value or values or null if not there
      See Also:
    • getAttributeValueSingleValued

      public String getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes)
      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. Note, the keys are case-insensitive
      Specified by:
      getAttributeValueSingleValued in interface Subject
      excludeInternalAttributes - if true, values for internal attributes are not returned
      Returns:
      value or null if not there
      See Also:
    • getAttributes

      public Map<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
      Description copied from interface: Subject
      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. Note, the keys are case-insensitive
      Specified by:
      getAttributes in interface Subject
      Parameters:
      excludeInternalAttributes - if true, internal attributes are not returned
      Returns:
      map or empty map or null if not there
      See Also:
    • getTranslationMap

      public Map<String,Object> getTranslationMap()
      Description copied from interface: Subject
      we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation
      Specified by:
      getTranslationMap in interface Subject
      Returns:
    • setTranslationMap

      public void setTranslationMap(Map<String,Object> translationMap)
      Description copied from interface: Subject
      we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation
      Specified by:
      setTranslationMap in interface Subject
    • isResolvedFromSource

      public boolean isResolvedFromSource()
      Specified by:
      isResolvedFromSource in interface Subject
      Returns:
      true if resolved from source (rather than cache)
    • setResolvedFromSource

      public void setResolvedFromSource(boolean isResolvedFromSource)
      true if resolved from source (rather than cache)
      Specified by:
      setResolvedFromSource in interface Subject
      Parameters:
      isResolvedFromSource -