public class RegistrySubject extends GrouperAPI implements Subject
Subject
local to the Groups Registry.
NOTE: THIS CLASS IS NOT CONSIDERED STABLE AND MAY CHANGE IN FUTURE RELEASES.
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Constructor and Description |
---|
RegistrySubject() |
Modifier and Type | Method and Description |
---|---|
static RegistrySubject |
add(GrouperSession s,
String id,
String type,
String name)
|
RegistrySubject |
clone()
deep clone the fields in this object
|
void |
delete(GrouperSession s)
Delete existing
RegistrySubject . |
boolean |
equals(Object obj) |
Map<String,Set<String>> |
getAttributes()
Gets a map attribute names and values.
|
Map<String,Set<String>> |
getAttributes(boolean excludeInternalAttributes)
Gets a map attribute names and values.
|
String |
getAttributeValue(String name)
Return the value of the specified attribute.
|
String |
getAttributeValue(String attributeName,
boolean excludeInternalAttributes)
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).
|
String |
getAttributeValueOrCommaSeparated(String attributeName,
boolean excludeInternalAttributes)
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)
Return the values for the specified attribute.
|
Set<String> |
getAttributeValues(String attributeName,
boolean excludeInternalAttributes)
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 |
getAttributeValueSingleValued(String attributeName,
boolean excludeInternalAttributes)
Returns the attribute value if single-valued, or
if multi-valued, throws an exception.
|
String |
getDescription()
Return this subject's description.
|
String |
getId()
Return the subject id.
|
String |
getName()
Return the subject's name.
|
Source |
getSource()
Return the source.
|
String |
getSourceId()
get the source id of a subject
|
SubjectType |
getType()
Return this subject's
SubjectType . |
String |
getTypeName()
get the type name
|
String |
getTypeString() |
int |
hashCode() |
void |
setId(String id) |
void |
setName(String name) |
void |
setTypeString(String type) |
String |
toString() |
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onPreSave, onPreUpdate, onSave, onUpdate, setHibernateVersionNumber
public RegistrySubject clone()
GrouperAPI
clone
in interface GrouperCloneable
clone
in class GrouperAPI
GrouperAPI.clone()
public static RegistrySubject add(GrouperSession s, String id, String type, String name) throws GrouperException, InsufficientPrivilegeException
Subject
to a Source
within the Groups Registry.
Subjects may only be added within a root-like session.
try { RegistrySubject subj = RegistrySubject.add(s, "subject id", "person", "name"); } catch (GrouperException eG) { // unable to add subject } catch (InsufficientPrivilegeException eIP) { // not privileged to add subject }
s
- Create subject within this session context.id
- The subject id to assign to the subject.type
- The subject type to assign to the subject.name
- The name to assign to the subject.RegistrySubject
.GrouperException
InsufficientPrivilegeException
public void delete(GrouperSession s) throws GrouperException, IllegalStateException, InsufficientPrivilegeException
RegistrySubject
.
try { rSubj.delete(s); } catch (GrouperException eG) { // failed to delete this RegistrySubject } catch (InsufficientPrivilegeException eIP) { // not privileged to delete this RegistrySubject }
s
- Delete RegistrySubject within this GrouperSession context.GrouperException
- if RegistrySubject cannot be deleted.IllegalStateException
- if GrouperSession is null.InsufficientPrivilegeException
- if not privileged to delete RegistrySubjects.public String getAttributeValue(String name)
getAttributeValue
in interface Subject
name
- public Set<String> getAttributeValues(String name)
getAttributeValues
in interface Subject
name
- public String getDescription()
getDescription
in interface Subject
public String getId()
public String getName()
public Source getSource() throws IllegalStateException
NOTE: The current implementation is very crude and inefficient. It attempts to query for the subject to identify the source.
getSource
in interface Subject
IllegalStateException
- if source cannot be returned.public SubjectType getType()
SubjectType
.public String getTypeString()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void setId(String id)
id
- public void setName(String name)
name
- public void setTypeString(String type)
type
- public String toString()
toString
in class Object
Object.toString()
public String getAttributeValueOrCommaSeparated(String attributeName)
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
getAttributeValueOrCommaSeparated
in interface Subject
Subject.getAttributeValueOrCommaSeparated(java.lang.String)
public String getAttributeValueSingleValued(String attributeName)
Subject
getAttributeValueSingleValued
in interface Subject
Subject.getAttributeValueSingleValued(java.lang.String)
public String getSourceId()
Subject
getSourceId
in interface Subject
Subject.getSourceId()
public String getTypeName()
Subject
getTypeName
in interface Subject
Subject.getTypeName()
public Map<String,Set<String>> getAttributes()
Subject
getAttributes
in interface Subject
Subject.getAttributes()
public String getAttributeValue(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValue
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValue(java.lang.String, boolean)
public String getAttributeValueOrCommaSeparated(String attributeName, boolean excludeInternalAttributes)
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
getAttributeValueOrCommaSeparated
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValueOrCommaSeparated(java.lang.String, boolean)
public String getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValueSingleValued
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValueSingleValued(java.lang.String, boolean)
public Set<String> getAttributeValues(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValues
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValues(java.lang.String, boolean)
public Map<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
Subject
getAttributes
in interface Subject
excludeInternalAttributes
- if true, internal attributes are not returnedSubject.getAttributes(boolean)
Copyright © 2016 Internet2. All rights reserved.