edu.internet2.middleware.grouper.grouperUi.beans.simpleMembershipUpdate
Class ImportSubjectWrapper

java.lang.Object
  extended by edu.internet2.middleware.grouper.grouperUi.beans.simpleMembershipUpdate.ImportSubjectWrapper
All Implemented Interfaces:
Subject, Serializable

public class ImportSubjectWrapper
extends Object
implements Subject

bean which is a subject, though a thin wrapper just for import purposes

See Also:
Serialized Form

Constructor Summary
ImportSubjectWrapper(int theRow, String theSourceId, String theSubjectId, String subjectIdentifier, String subjectIdOrIdentifier, String[] theRowData)
           
 
Method Summary
 String errorLabelForError()
          get the data for an error message
static String errorLabelForRowStatic(int row, String[] rowData)
          get the data for an error message
 Map<String,Set<String>> getAttributes()
          Gets a map attribute names and values.
 String getAttributeValue(String name)
          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 name)
          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.
 String getDescription()
          Gets this Subject's description.
 String getId()
          Gets this Subject's ID.
 String getName()
          Gets this Subject's name.
 int getRow()
          this is the row of the file, row 1 is the header
 Source getSource()
          Returns the Source of this Subject.
 String getSourceId()
          get the source id of a subject
 SubjectType getType()
          Gets this Subject's type.
 String getTypeName()
          get the type name
 Subject wrappedSubject()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportSubjectWrapper

public ImportSubjectWrapper(int theRow,
                            String theSourceId,
                            String theSubjectId,
                            String subjectIdentifier,
                            String subjectIdOrIdentifier,
                            String[] theRowData)
                     throws SubjectNotFoundException,
                            SubjectNotUniqueException,
                            SourceUnavailableException,
                            Exception
Parameters:
theRow -
theSourceId -
theSubjectId -
subjectIdentifier -
subjectIdOrIdentifier -
theRowData -
Throws:
SubjectNotFoundException
SubjectNotUniqueException
SourceUnavailableException
Exception
Method Detail

wrappedSubject

public Subject wrappedSubject()
Returns:
lazy loaded wrapped subject

getRow

public int getRow()
this is the row of the file, row 1 is the header

Returns:
the row

errorLabelForError

public String errorLabelForError()
get the data for an error message

Returns:
the row

errorLabelForRowStatic

public static String errorLabelForRowStatic(int row,
                                            String[] rowData)
get the data for an error message

Parameters:
row -
rowData -
Returns:
the error label

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

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

getAttributeValues

public Set<String> 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.

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

getAttributes

public Map<String,Set<String>> 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). The returned Map can be augmented or changed

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

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:
Subject.getDescription()

getId

public String getId()
Description copied from interface: Subject
Gets this Subject's ID.

Specified by:
getId in interface Subject
Returns:
string
See Also:
Subject.getId()

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:
Subject.getName()

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:
Subject.getSource()

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:
Subject.getType()

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
Returns:
value or values or null if not there
See Also:
Subject.getAttributeValueOrCommaSeparated(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
Returns:
value or null if not there
See Also:
Subject.getAttributeValueSingleValued(java.lang.String)

getSourceId

public String getSourceId()
Description copied from interface: Subject
get the source id of a subject

Specified by:
getSourceId in interface Subject
Returns:
the source id
See Also:
Subject.getSourceId()

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:
Subject.getTypeName()