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)
|
static RegistrySubject |
add(GrouperSession s,
String id,
String type,
String name,
String nameAttributeValue,
String loginid,
String description,
String email)
|
static RegistrySubject |
addOrUpdate(GrouperSession s,
String id,
String type,
String name,
String nameAttributeValue,
String loginid,
String description,
String email)
|
static void |
addOrUpdateOrDeleteAttribute(RegistrySubject registrySubject,
String subjectId,
String attributeName,
String attributeValue) |
RegistrySubject |
clone()
deep clone the fields in this object
|
void |
delete(GrouperSession s)
Delete existing
RegistrySubject. |
boolean |
equals(Object obj) |
static RegistrySubject |
find(String id,
boolean exceptionIfNotFound) |
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
|
Map<String,Object> |
getTranslationMap()
we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation
|
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 |
setTranslationMap(Map<String,Object> translationMap)
we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation
|
void |
setTypeString(String type) |
String |
toString() |
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onPreSave, onPreUpdate, onSave, onUpdate, setHibernateVersionNumberpublic RegistrySubject clone()
GrouperAPIclone in interface GrouperCloneableclone in class GrouperAPIGrouperAPI.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.GrouperExceptionInsufficientPrivilegeExceptionpublic static RegistrySubject add(GrouperSession s, String id, String type, String name, String nameAttributeValue, String loginid, String description, String email) 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.nameAttributeValue - loginid - description - email - RegistrySubject.GrouperExceptionInsufficientPrivilegeExceptionpublic static RegistrySubject addOrUpdate(GrouperSession s, String id, String type, String name, String nameAttributeValue, String loginid, String description, String email) 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.loginid - description - email - RegistrySubject.GrouperExceptionInsufficientPrivilegeExceptionpublic static RegistrySubject find(String id, boolean exceptionIfNotFound)
id - exceptionIfNotFound - public static void addOrUpdateOrDeleteAttribute(RegistrySubject registrySubject, String subjectId, String attributeName, String attributeValue)
registrySubject - subjectId - attributeName - attributeValue - 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 Subjectname - public Set<String> getAttributeValues(String name)
getAttributeValues in interface Subjectname - public String getDescription()
getDescription in interface Subjectpublic 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 SubjectIllegalStateException - if source cannot be returned.public SubjectType getType()
SubjectType.public String getTypeString()
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.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 ObjectObject.toString()public String getAttributeValueOrCommaSeparated(String attributeName)
SubjectReturns 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 SubjectSubject.getAttributeValueOrCommaSeparated(java.lang.String)public String getAttributeValueSingleValued(String attributeName)
SubjectgetAttributeValueSingleValued in interface SubjectSubject.getAttributeValueSingleValued(java.lang.String)public String getSourceId()
SubjectgetSourceId in interface SubjectSubject.getSourceId()public String getTypeName()
SubjectgetTypeName in interface SubjectSubject.getTypeName()public Map<String,Set<String>> getAttributes()
SubjectgetAttributes in interface SubjectSubject.getAttributes()public String getAttributeValue(String attributeName, boolean excludeInternalAttributes)
SubjectgetAttributeValue in interface SubjectexcludeInternalAttributes - if true, values for internal attributes are not returnedSubject.getAttributeValue(java.lang.String, boolean)public String getAttributeValueOrCommaSeparated(String attributeName, boolean excludeInternalAttributes)
SubjectReturns 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 SubjectexcludeInternalAttributes - if true, values for internal attributes are not returnedSubject.getAttributeValueOrCommaSeparated(java.lang.String, boolean)public String getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes)
SubjectgetAttributeValueSingleValued in interface SubjectexcludeInternalAttributes - if true, values for internal attributes are not returnedSubject.getAttributeValueSingleValued(java.lang.String, boolean)public Set<String> getAttributeValues(String attributeName, boolean excludeInternalAttributes)
SubjectgetAttributeValues in interface SubjectexcludeInternalAttributes - if true, values for internal attributes are not returnedSubject.getAttributeValues(java.lang.String, boolean)public Map<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
SubjectgetAttributes in interface SubjectexcludeInternalAttributes - if true, internal attributes are not returnedSubject.getAttributes(boolean)public Map<String,Object> getTranslationMap()
SubjectgetTranslationMap in interface Subjectpublic void setTranslationMap(Map<String,Object> translationMap)
SubjectsetTranslationMap in interface SubjectCopyright © 2016 Internet2. All rights reserved.