public class Stem extends GrouperAPI implements GrouperHasContext, Owner, Hib3GrouperVersioned, Comparable<Stem>, XmlImportable<Stem>, AttributeAssignable, GrouperSetElement, GrouperObject
Modifier and Type | Class and Description |
---|---|
static class |
Stem.Scope
Search scope: one-level or subtree.
|
Modifier and Type | Field and Description |
---|---|
static String |
COLUMN_ALTERNATE_NAME
an alternate name for this stem
|
static String |
COLUMN_CONTEXT_ID
context id column name
|
static String |
COLUMN_CREATE_TIME
id col in db
|
static String |
COLUMN_CREATOR_ID
col
|
static String |
COLUMN_DESCRIPTION
id col in db
|
static String |
COLUMN_DISPLAY_EXTENSION
id col in db
|
static String |
COLUMN_DISPLAY_NAME
col
|
static String |
COLUMN_EXTENSION
id col in db
|
static String |
COLUMN_HIBERNATE_VERSION_NUMBER
column for hibernate version number
|
static String |
COLUMN_ID
id col in db
|
static String |
COLUMN_ID_INDEX
unique number for this stem
|
static String |
COLUMN_LAST_MEMBERSHIP_CHANGE
timestamp of the last membership change for this group
|
static String |
COLUMN_MODIFIER_ID
id col in db
|
static String |
COLUMN_MODIFY_TIME
id col in db
|
static String |
COLUMN_NAME
col
|
static String |
COLUMN_OLD_ID
old id col for id conversion
|
static String |
COLUMN_OLD_UUID
old uuid id col for id conversion
|
static String |
COLUMN_PARENT_STEM
col
|
static String |
COLUMN_UUID
uuid col in db (not used anymore)
|
static String |
DELIM
Hierarchy delimiter.
|
static String |
FIELD_ALTERNATE_NAME_DB
constant for field name for: alternateNameDb
|
static String |
FIELD_CREATE_TIME
constant for field name for: createTime
|
static String |
FIELD_CREATOR_UUID
constant for field name for: creatorUUID
|
static String |
FIELD_DB_VERSION
constant for field name for: dbVersion
|
static String |
FIELD_DESCRIPTION
constant for field name for: description
|
static String |
FIELD_DISPLAY_EXTENSION
constant for field name for: displayExtension
|
static String |
FIELD_DISPLAY_NAME
constant for field name for: displayName
|
static String |
FIELD_EXTENSION
constant for field name for: extension
|
static String |
FIELD_ID_INDEX
constant for field name for: idIndex
|
static String |
FIELD_LAST_MEMBERSHIP_CHANGE_DB
constant for field name for: lastMembershipChangeDb
|
static String |
FIELD_MODIFIER_UUID
constant for field name for: modifierUUID
|
static String |
FIELD_MODIFY_TIME
constant for field name for: modifyTime
|
static String |
FIELD_NAME
constant for field name for: name
|
static String |
FIELD_PARENT_UUID
constant for field name for: parentUuid
|
static String |
FIELD_UUID
constant for field name for: uuid
|
static String |
ROOT_INT
root int
|
static String |
ROOT_NAME
Default name of root stem.
|
static String |
TABLE_GROUPER_STEMS
table for stems table in the db
|
static String |
VALIDATION_STEM_DESCRIPTION_TOO_LONG_KEY |
static String |
VALIDATION_STEM_DISPLAY_EXTENSION_TOO_LONG_KEY |
static String |
VALIDATION_STEM_DISPLAY_NAME_TOO_LONG_KEY |
static String |
VALIDATION_STEM_EXTENSION_TOO_LONG_KEY |
static String |
VALIDATION_STEM_NAME_TOO_LONG_KEY |
dbVersion, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Constructor and Description |
---|
Stem() |
Modifier and Type | Method and Description |
---|---|
String |
__getId()
if of this object
|
String |
__getName()
name of this object (for logging)
|
static Stem |
_createStemAndParentStemsIfNotExist(GrouperSession grouperSession,
String stemName,
String stemDisplayNameForInserts)
create stems and parents if not exist.
|
void |
addAlternateName(String alternateName)
Add an alternate name for this stem.
|
AttributeDef |
addChildAttributeDef(String extension,
AttributeDefType attributeDefType)
Add a new attribute def to the registry.
|
AttributeDefName |
addChildAttributeDefName(AttributeDef attributeDef,
String extension,
String displayExtension)
Add a new attribute def to the registry.
|
AttributeDefName |
addChildAttributeDefName(AttributeDef attributeDef,
String extension,
String displayExtension,
String uuid)
Add a new attribute def to the registry.
|
Group |
addChildGroup(String extension,
String displayExtension)
Add a new group to the registry.
|
Role |
addChildRole(String extension,
String displayExtension)
Add a new role to the registry.
|
Stem |
addChildStem(String extension,
String displayExtension)
Add a new stem to the registry.
|
Stem |
addChildStem(String extension,
String displayExtension,
String uuid,
boolean failIfExists)
Add a new stem to the registry.
|
boolean |
assignIdIndex(long theIdIndex)
assign different id index
|
boolean |
canHavePrivilege(Subject subject,
String privilegeOrListName,
boolean secure)
see if the subject has a privilege or another privilege that implies this privilege.
|
Stem |
clone()
deep clone the fields in this object
|
int |
compareTo(Stem that) |
Stem |
copy(Stem stem)
Copy this stem to another Stem.
|
Stem |
dbVersion()
save the state when retrieving from DB
|
Set<String> |
dbVersionDifferentFields()
note, these are massaged so that name, extension, etc look like normal fields.
|
void |
dbVersionReset()
take a snapshot of the data since this is what is in the db
|
void |
delete()
Delete this stem from the Groups Registry.
|
boolean |
deleteAlternateName(String alternateName)
Delete the specified alternate name.
|
static boolean |
deleteOccuring()
see if we are in the middle of a delete (e.g.
|
boolean |
equals(Object other) |
String |
getAlternateName()
Returns the alternate name for the stem.
|
String |
getAlternateNameDb()
Returns the alternate name for the stem.
|
Set<String> |
getAlternateNames()
Returns the alternate names for the stem.
|
AttributeAssignStemDelegate |
getAttributeDelegate()
get the logic delegate
|
AttributeValueDelegate |
getAttributeValueDelegate()
this delegate works on attributes and values at the same time
|
Set |
getChildGroups()
Get groups that are immediate children of this stem.
|
Set<Group> |
getChildGroups(Privilege[] privileges,
Stem.Scope scope)
Deprecated.
use the overload
|
Set<Group> |
getChildGroups(Stem.Scope scope)
Get groups that are children of this stem.
|
Set<Group> |
getChildGroups(Stem.Scope scope,
Set<Privilege> inPrivSet,
QueryOptions queryOptions)
Get groups that are children of this stem.
|
Set<Group> |
getChildGroups(Stem.Scope scope,
Set<Privilege> inPrivSet,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups)
Get groups that are children of this stem.
|
Set<Group> |
getChildMembershipGroups(Stem.Scope scope,
Set<Privilege> inPrivSet,
QueryOptions queryOptions)
Get groups that are children of this stem and there is a list membership.
|
Set<Stem> |
getChildStems()
Get stems that are immediate children of this stem.
|
Set<Stem> |
getChildStems(Privilege[] privileges,
Stem.Scope scope)
get child stems
|
Set<Stem> |
getChildStems(Stem.Scope scope)
Get stems that are children of this stem.
|
Set<Stem> |
getChildStems(Stem.Scope scope,
QueryOptions queryOptions)
Get stems that are children of this stem.
|
Set<Stem> |
getChildStems(Stem.Scope scope,
Set<Privilege> inPrivSet,
QueryOptions queryOptions)
Get groups that are children of this stem.
|
String |
getContextId()
context id of the transaction
|
Subject |
getCreateSubject()
Get subject that created this stem.
|
Date |
getCreateTime()
Get creation time for this stem.
|
long |
getCreateTimeLong() |
Set |
getCreators()
Get subjects with CREATE privilege on this stem.
|
String |
getCreatorUuid() |
String |
getDescription()
Get stem description.
|
String |
getDescriptionDb() |
String |
getDisplayExtension()
Get stem displayExtension.
|
String |
getDisplayExtensionDb() |
String |
getDisplayName()
Get stem displayName.
|
String |
getDisplayNameDb() |
String |
getExtension()
Get stem extension.
|
String |
getExtensionDb() |
String |
getId()
id is same as uuid
|
Long |
getIdIndex()
id of the group as a unique integer
|
Timestamp |
getLastMembershipChange()
when the last member has changed
|
Long |
getLastMembershipChangeDb()
when the last member has changed, used by hibernate
|
String |
getModifierUuid() |
Subject |
getModifySubject()
Get subject that last modified this stem.
|
Date |
getModifyTime()
Get last modified time for this stem.
|
long |
getModifyTimeLong() |
String |
getName()
Get stem name.
|
String |
getNameDb() |
Stem |
getParentStem()
Get parent stem.
|
String |
getParentStemName()
get the name of the parent stem
|
String |
getParentUuid() |
Set<NamingPrivilege> |
getPrivs(Subject subj)
Get privileges that the specified subject has on this stem.
|
Set |
getStemAttrReaders()
Get subjects with STEM_ATTR_READ privilege on this stem.
|
Set |
getStemAttrUpdaters()
Get subjects with STEM_ATTR_UPDATE privilege on this stem.
|
Set |
getStemmers()
Get subjects with STEM privilege on this stem.
|
String |
getUuid() |
void |
grantPriv(Subject subj,
Privilege priv)
Grant a privilege on this stem.
|
boolean |
grantPriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyMember)
Grant a privilege on this stem.
|
boolean |
grantPrivs(Subject subject,
boolean stemChecked,
boolean createChecked,
boolean attrReadChecked,
boolean attrUpdateChecked,
boolean revokeIfUnchecked)
grant privs to stem
|
boolean |
hasCreate(Subject subj)
Check whether a subject has the CREATE privilege on this stem.
|
int |
hashCode() |
boolean |
hasPrivilege(Subject subject,
String privilegeOrListName)
see if the subject has a privilege
|
boolean |
hasStem(Subject subj)
Check whether a member has the STEM privilege on this stem.
|
boolean |
hasStemAttrRead(Subject subj)
Check whether a subject has the STEM_ATTR_READ privilege on this stem.
|
boolean |
hasStemAttrUpdate(Subject subj)
Check whether a subject has the STEM_ATTR_UPDATE privilege on this stem.
|
protected void |
internal_addAlternateName(String alternateName)
Add an alternate name for this stem.
|
AttributeDef |
internal_addChildAttributeDef(GrouperSession session,
String extn,
String id,
AttributeDefType attributeDefType,
String description) |
AttributeDefName |
internal_addChildAttributeDefName(GrouperSession session,
AttributeDef attributeDef,
String extension,
String displayExtension,
String id,
String description) |
Role |
internal_addChildEntity(String extension,
String displayExtension,
String uuid)
Add a new role to the registry.
|
Group |
internal_addChildGroup(String extn,
String dExtn,
String uuid)
add child group with uuid
|
Group |
internal_addChildGroup(String extn,
String dExtn,
String uuid,
String description,
Set<GroupType> types,
Map<String,String> attributes,
boolean addDefaultGroupPrivileges,
TypeOfGroup typeOfGroup,
boolean checkSecurity) |
Group |
internal_addChildGroup(String extn,
String dExtn,
String uuid,
TypeOfGroup typeOfGroup)
add child group with uuid
|
Role |
internal_addChildRole(String extension,
String displayExtension,
String uuid)
Add a new role to the registry.
|
protected Stem |
internal_addChildStem(GrouperSession session,
String extn,
String dExtn,
String uuid,
boolean addDefaultStemPrivileges,
boolean failIfExists) |
Stem |
internal_addChildStem(String extn,
String dExtn,
String uuid)
add child stem with uuid
|
static Stem |
internal_addRootStem(GrouperSession s,
boolean[] changed)
add root stem
|
protected Stem |
internal_copy(Stem stem,
boolean privilegesOfStem,
boolean privilegesOfGroup,
boolean groupAsPrivilege,
boolean listMembersOfGroup,
boolean listGroupAsMember,
boolean attributes)
Copy this stem to another Stem.
|
boolean |
internal_grantPriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyMember,
String uuid)
Grant a privilege on this stem.
|
protected void |
internal_move(Stem stem,
boolean assignAlternateName) |
void |
internal_setModified()
set modified
|
boolean |
isChildGroup(Group group)
TODO 20070813 make public?
|
boolean |
isChildStem(Stem stem)
TODO 20070813 make public?
|
boolean |
isRootStem() |
boolean |
matchesLowerSearchStrings(Set<String> filterStrings)
see if this object matches the filter strings
|
void |
move(Stem stem)
Move this stem to another Stem.
|
void |
obliterate(boolean printOutput,
boolean testOnly)
Delete this stem from the Groups Registry including all sub objects.
|
void |
onPostDelete(HibernateSession hibernateSession)
after a delete occurs
|
void |
onPostSave(HibernateSession hibernateSession)
after a save (insert) occurs
|
void |
onPostUpdate(HibernateSession hibernateSession)
after an update occurs
|
void |
onPreDelete(HibernateSession hibernateSession)
before a delete (insert) occurs
|
void |
onPreSave(HibernateSession hibernateSession)
before a save (insert) occurs
|
void |
onPreUpdate(HibernateSession hibernateSession)
before an update occurs
|
void |
revokePriv(Privilege priv)
Revoke all privileges of the specified type on this stem.
|
void |
revokePriv(Subject subj,
Privilege priv)
Revoke a privilege on this stem.
|
boolean |
revokePriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyRevoked)
Revoke a privilege on this stem.
|
static Stem |
saveStem(GrouperSession grouperSession,
String stemNameToEdit,
String uuid,
String name,
String displayExtension,
String description,
SaveMode saveMode,
boolean createParentStemsIfNotExist)
create or update a stem.
|
void |
setAlternateNameDb(String alternateName)
Set the group's alternate name Used by hibernate.
|
void |
setContextId(String contextId1)
context id of the transaction
|
void |
setCreateTimeLong(long createTime) |
void |
setCreatorUuid(String creatorUUID) |
void |
setDescription(String value)
Set stem description.
|
void |
setDescriptionDb(String description) |
void |
setDisplayExtension(String value)
Set displayExtension.
|
void |
setDisplayExtensionDb(String displayExtension) |
void |
setDisplayName(String displayName) |
void |
setDisplayNameDb(String displayName) |
void |
setExtension(String value)
Set extension.
|
void |
setExtension(String value,
boolean assignAlternateName)
Set extension.
|
void |
setExtensionDb(String extension) |
void |
setIdIndex(Long idIndex1)
id of the group as a unique integer
|
void |
setLastMembershipChangeDb(Long theMembershipLastChange)
when the last member has changed, used by hibernate
|
void |
setModifierUuid(String modifierUUID) |
void |
setModifyTimeLong(long modifyTime) |
void |
setName(String name) |
void |
setNameDb(String name) |
void |
setParentUuid(String parentUUID) |
void |
setUuid(String uuid) |
void |
store()
will be implemented soon
|
String |
toString() |
String |
toStringDb() |
void |
validate() |
void |
xmlCopyBusinessPropertiesToExisting(Stem existingRecord)
copy business (non update) properties to an existing record
|
boolean |
xmlDifferentBusinessProperties(Stem other)
see if the non update cols are different (e.g.
|
boolean |
xmlDifferentUpdateProperties(Stem other)
see if the update cols are different (e.g.
|
String |
xmlGetId()
set id key in db
|
Stem |
xmlRetrieveByIdOrKey()
retrieve from db by id or key.
|
Stem |
xmlSaveBusinessProperties(Stem existingRecord)
save the business properties (not update properties)
|
void |
xmlSaveUpdateProperties()
save the udpate properties (e.g.
|
void |
xmlSetId(String theId)
set id key in db
|
XmlExportStem |
xmlToExportStem(GrouperVersion grouperVersion)
convert to xml bean for export
|
String |
xmlToString()
convert to string for log
|
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
public static final String VALIDATION_STEM_NAME_TOO_LONG_KEY
public static final String VALIDATION_STEM_DISPLAY_NAME_TOO_LONG_KEY
public static final String VALIDATION_STEM_EXTENSION_TOO_LONG_KEY
public static final String VALIDATION_STEM_DISPLAY_EXTENSION_TOO_LONG_KEY
public static final String VALIDATION_STEM_DESCRIPTION_TOO_LONG_KEY
public static final String TABLE_GROUPER_STEMS
public static final String COLUMN_UUID
public static final String COLUMN_PARENT_STEM
public static final String COLUMN_NAME
public static final String COLUMN_DISPLAY_NAME
public static final String COLUMN_CREATOR_ID
public static final String COLUMN_ID
public static final String COLUMN_ID_INDEX
public static final String COLUMN_CREATE_TIME
public static final String COLUMN_MODIFIER_ID
public static final String COLUMN_MODIFY_TIME
public static final String COLUMN_DISPLAY_EXTENSION
public static final String COLUMN_EXTENSION
public static final String COLUMN_DESCRIPTION
public static final String COLUMN_ALTERNATE_NAME
public static final String COLUMN_HIBERNATE_VERSION_NUMBER
public static final String COLUMN_CONTEXT_ID
public static final String COLUMN_OLD_ID
public static final String COLUMN_OLD_UUID
public static final String COLUMN_LAST_MEMBERSHIP_CHANGE
public static final String FIELD_ALTERNATE_NAME_DB
public static final String FIELD_CREATE_TIME
public static final String FIELD_CREATOR_UUID
public static final String FIELD_DB_VERSION
public static final String FIELD_DESCRIPTION
public static final String FIELD_DISPLAY_EXTENSION
public static final String FIELD_DISPLAY_NAME
public static final String FIELD_EXTENSION
public static final String FIELD_ID_INDEX
public static final String FIELD_MODIFIER_UUID
public static final String FIELD_MODIFY_TIME
public static final String FIELD_NAME
public static final String FIELD_PARENT_UUID
public static final String FIELD_UUID
public static final String FIELD_LAST_MEMBERSHIP_CHANGE_DB
public static final String DELIM
public static final String ROOT_NAME
public static final String ROOT_INT
public String getParentStemName()
public String getId()
public int compareTo(Stem that)
compareTo
in interface Comparable<Stem>
Comparable.compareTo(java.lang.Object)
public AttributeAssignStemDelegate getAttributeDelegate()
AttributeAssignable
getAttributeDelegate
in interface AttributeAssignable
public AttributeValueDelegate getAttributeValueDelegate()
getAttributeValueDelegate
in interface AttributeAssignable
public String getContextId()
public void setContextId(String contextId1)
setContextId
in interface GrouperHasContext
contextId1
- public Group addChildGroup(String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException
// Add a group with the extension "edu" beneath this stem. try { Group edu = ns.addChildGroup("edu", "edu domain"); } catch (GroupAddException eGA) { // Group not added } catch (InsufficientPrivilegeException eIP) { // Not privileged to add group }
extension
- Group's extensiondisplayExtension
- Groups' displayExtensionGroup
GroupAddException
InsufficientPrivilegeException
public AttributeDef addChildAttributeDef(String extension, AttributeDefType attributeDefType) throws InsufficientPrivilegeException
extension
- attributeDef's extensionattributeDefType
- AttributeDef
InsufficientPrivilegeException
public AttributeDefName addChildAttributeDefName(AttributeDef attributeDef, String extension, String displayExtension) throws InsufficientPrivilegeException
attributeDef
- is the definition of this attributeextension
- attributeDef's extensiondisplayExtension
- AttributeDef
InsufficientPrivilegeException
public AttributeDefName addChildAttributeDefName(AttributeDef attributeDef, String extension, String displayExtension, String uuid) throws InsufficientPrivilegeException
attributeDef
- is the definition of this attributeextension
- attributeDef's extensiondisplayExtension
- AttributeDef
InsufficientPrivilegeException
public Stem addChildStem(String extension, String displayExtension, String uuid, boolean failIfExists) throws InsufficientPrivilegeException, StemAddException
// Add a stem with the extension "edu" beneath this stem. try { Stem edu = ns.addChildStem("edu", "edu domain"); } catch (StemAddException e) { // Stem not added }
extension
- Stem's extensiondisplayExtension
- Stem' displayExtensionuuid
- if creating this is the uuidfailIfExists
- throws StemAddException if exists, else just return the existing stemStem
InsufficientPrivilegeException
StemAddException
public Stem addChildStem(String extension, String displayExtension) throws InsufficientPrivilegeException, StemAddException
// Add a stem with the extension "edu" beneath this stem. try { Stem edu = ns.addChildStem("edu", "edu domain"); } catch (StemAddException e) { // Stem not added }
extension
- Stem's extensiondisplayExtension
- Stem' displayExtensionStem
InsufficientPrivilegeException
StemAddException
public static boolean deleteOccuring()
public void delete() throws InsufficientPrivilegeException, StemDeleteException
try { ns.delete(); } catch (InsufficientPrivilegeException eIP) { // not privileged to delete stem } catch (StemDeleteException eSD) { // unable to delete stem }
public Set getChildGroups()
Group
objects.getChildGroups(Scope)
public Set<Group> getChildGroups(Stem.Scope scope) throws IllegalArgumentException
scope
- of search: Scope.ONE
or Scope.SUB
IllegalArgumentException
- if null scope.public Set<Group> getChildGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions)
scope
- of search: Scope.ONE
or Scope.SUB
inPrivSet
- set of privileges that the grouper session needs one of for the row to be returned.
AccessPrivilege has some pre-baked constant sets for use herequeryOptions
- IllegalArgumentException
- if null scope.public Set<Group> getChildGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws IllegalArgumentException
scope
- of search: Scope.ONE
or Scope.SUB
inPrivSet
- set of privileges that the grouper session needs one of for the row to be returned.
AccessPrivilege has some pre-baked constant sets for use heretypeOfGroups
- is the type of groups to get, or null for allqueryOptions
- IllegalArgumentException
- if null scope.public Set<Group> getChildMembershipGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) throws IllegalArgumentException
scope
- of search: Scope.ONE
or Scope.SUB
inPrivSet
- set of privileges that the grouper session needs one of for the row to be returned.
AccessPrivilege has some pre-baked constant sets for use herequeryOptions
- IllegalArgumentException
- if null scope.public Set<Stem> getChildStems(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) throws IllegalArgumentException
scope
- of search: Scope.ONE
or Scope.SUB
inPrivSet
- set of privileges that the grouper session needs one of for the row to be returned.
AccessPrivilege has some pre-baked constant sets for use herequeryOptions
- IllegalArgumentException
- if null scope.@Deprecated public Set<Group> getChildGroups(Privilege[] privileges, Stem.Scope scope) throws IllegalArgumentException
privileges
- privsscope
- all or directIllegalArgumentException
- if any parameter is null.public Set<Stem> getChildStems()
Stem
objects.getChildStems(Scope)
public Set<Stem> getChildStems(Stem.Scope scope)
scope
- of search: Scope.ONE
or Scope.SUB
IllegalArgumentException
- if null scope.public Set<Stem> getChildStems(Stem.Scope scope, QueryOptions queryOptions) throws IllegalArgumentException
scope
- of search: Scope.ONE
or Scope.SUB
queryOptions
- IllegalArgumentException
- if null scope.public Set<Stem> getChildStems(Privilege[] privileges, Stem.Scope scope) throws IllegalArgumentException
privileges
- privsscope
- all or directIllegalArgumentException
- if any parameter is null.public Subject getCreateSubject() throws SubjectNotFoundException
// Get creator of this stem. try { Subject creator = ns.getCreateSubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }
Subject
that created this stem.SubjectNotFoundException
public Date getCreateTime()
// Get create time. Date created = ns.getCreateTime();
Date
that this stem was created.public Set getCreators() throws GrouperException
Set creators = ns.getCreators();
Subject
objectsGrouperException
public String getDescription()
// Get description String description = ns.getDescription();
getDescription
in interface GrouperObject
public String getDisplayExtension()
// Get displayExtension String displayExtn = ns.getDisplayExtension();
public String getDisplayName()
// Get displayName String displayName = ns.getDisplayName();
getDisplayName
in interface GrouperObject
public String getExtension()
// Get extension String extension = ns.getExtension();
public Subject getModifySubject() throws SubjectNotFoundException
// Get last modifier of this stem. try { Subject modifier = ns.getModifySubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }
Subject
that last modified this stem.SubjectNotFoundException
public Date getModifyTime()
// Get last modified time. Date modified = ns.getModifyTime();
Date
that this stem was last modified.public String getName()
// Get name String name = ns.getName();
getName
in interface GrouperObject
getName
in interface Owner
public Stem getParentStem() throws StemNotFoundException
// Get parent Stem parent = ns.getParentStem();
Stem
.StemNotFoundException
- if stem not foundpublic String getAlternateNameDb()
public String getAlternateName()
public void setAlternateNameDb(String alternateName)
alternateName
- public Set<String> getAlternateNames()
public void addAlternateName(String alternateName)
alternateName
- protected void internal_addAlternateName(String alternateName)
alternateName
- public boolean deleteAlternateName(String alternateName)
alternateName
- public Set<NamingPrivilege> getPrivs(Subject subj)
Set privs = ns.getPrivs(subj);
subj
- Get privileges for this subject.NamingPrivilege
objects.public Set getStemmers() throws GrouperException
Set stemmers = ns.getStemmers();
Subject
objectsGrouperException
public Set getStemAttrReaders() throws GrouperException
Set subjects = ns.getStemAttrReaders();
Subject
objectsGrouperException
public Set getStemAttrUpdaters() throws GrouperException
Set subjects = ns.getStemAttrUpdaters();
Subject
objectsGrouperException
public void grantPriv(Subject subj, Privilege priv) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
subj
- Grant privilege to this subject.priv
- Grant this privilege.GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
subj
- Grant privilege to this subject.priv
- Grant this privilege.exceptionIfAlreadyMember
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the groupGrantPrivilegeException
InsufficientPrivilegeException
SchemaException
public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
subj
- Grant privilege to this subject.priv
- Grant this privilege.exceptionIfAlreadyMember
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the groupuuid
- GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
public boolean hasCreate(Subject subj)
if (ns.hasCreate(subj)) { // Has CREATE } // Does not have CREATE }
subj
- Check whether this subject has CREATE.public boolean hasStemAttrRead(Subject subj)
if (ns.hasStemAttrRead(subj)) { // Has STEM_ATTR_READ } // Does not have STEM_ATTR_READ }
subj
- Check whether this subject has STEM_ATTR_READ.public boolean hasStemAttrUpdate(Subject subj)
if (ns.hasStemAttrUpdate(subj)) { // Has STEM_ATTR_UPDATE } // Does not have STEM_ATTR_UPDATE }
subj
- Check whether this subject has STEM_ATTR_UPDATE.public boolean hasStem(Subject subj)
if (ns.hasStem(subj)) { // Has STEM } // Does not have STEM }
subj
- heck whether this subject has STEM.public boolean hasPrivilege(Subject subject, String privilegeOrListName)
subject
- privilegeOrListName
- public boolean isChildGroup(Group group) throws IllegalArgumentException
group
- groupIllegalArgumentException
- if group is null.public boolean isChildStem(Stem stem) throws IllegalArgumentException
stem
- stemIllegalArgumentException
- if stem is null.public boolean isRootStem()
public void revokePriv(Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { ns.revokePriv(NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
priv
- Revoke this privilege.InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
public void revokePriv(Subject subj, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { ns.revokePriv(subj, NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
subj
- Revoke privilege from this subject.priv
- Revoke this privilege.InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { ns.revokePriv(subj, NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
subj
- Revoke privilege from this subject.priv
- Revoke this privilege.exceptionIfAlreadyRevoked
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the groupInsufficientPrivilegeException
RevokePrivilegeException
SchemaException
public void setDescription(String value) throws InsufficientPrivilegeException, StemModifyException
// Set description try { ns.setDescription(value); } } catch (InsufficientPrivilegeException e0) { // Not privileged to set description catch (StemModifyException e1) { // Error setting description }
value
- Set description to this value.InsufficientPrivilegeException
StemModifyException
public void store()
public void validate()
public void setDisplayExtension(String value) throws InsufficientPrivilegeException, StemModifyException
This will also update the displayName of all child stems and groups.
try { ns.setDisplayExtension(value); } catch (InsufficientPrivilegeException eIP) { // Not privileged to set displayExtension catch (StemModifyException eNSM) { // Error setting displayExtension }
value
- Set displayExtension to this value.InsufficientPrivilegeException
StemModifyException
public void setExtension(String value) throws InsufficientPrivilegeException, StemModifyException
This will also update the name of all child stems and groups.
try { ns.setExtension(value); } catch (InsufficientPrivilegeException eIP) { // Not privileged to set "extension" catch (StemModifyException eNSM) { // Error setting "extension" }
value
- Set extension to this value.InsufficientPrivilegeException
StemModifyException
public void setExtension(String value, boolean assignAlternateName) throws InsufficientPrivilegeException, StemModifyException
This will also update the name of all child stems and groups.
try { ns.setExtension(value, true); } catch (InsufficientPrivilegeException eIP) { // Not privileged to set "extension" catch (StemModifyException eNSM) { // Error setting "extension" }
value
- Set extension to this value.assignAlternateName
- Whether to add the old group and stem names as
alternate names for any renamed groups and stems.InsufficientPrivilegeException
StemModifyException
public String toString()
toString
in class Object
Object.toString()
public static Stem internal_addRootStem(GrouperSession s, boolean[] changed) throws GrouperException
s
- sessionchanged
- if you want to know if it was added, pass in array of size one, else nullGrouperException
- is problempublic void internal_setModified()
public Group internal_addChildGroup(String extn, String dExtn, String uuid) throws GroupAddException, InsufficientPrivilegeException
extn
- extensiondExtn
- display extensionuuid
- uuidGroupAddException
- if problemInsufficientPrivilegeException
- if problempublic Group internal_addChildGroup(String extn, String dExtn, String uuid, TypeOfGroup typeOfGroup) throws GroupAddException, InsufficientPrivilegeException
extn
- extensiondExtn
- display extensionuuid
- uuidtypeOfGroup
- GroupAddException
- if problemInsufficientPrivilegeException
- if problempublic Group internal_addChildGroup(String extn, String dExtn, String uuid, String description, Set<GroupType> types, Map<String,String> attributes, boolean addDefaultGroupPrivileges, TypeOfGroup typeOfGroup, boolean checkSecurity) throws GroupAddException, InsufficientPrivilegeException
extn
- dExtn
- uuid
- description
- types
- attributes
- addDefaultGroupPrivileges
- typeOfGroup
- or null for defaultcheckSecurity
- GroupAddException
InsufficientPrivilegeException
public AttributeDefName internal_addChildAttributeDefName(GrouperSession session, AttributeDef attributeDef, String extension, String displayExtension, String id, String description) throws InsufficientPrivilegeException
attributeDef
- session
- extension
- displayExtension
- id
- description
- AttributeDefNameAddException
InsufficientPrivilegeException
public AttributeDef internal_addChildAttributeDef(GrouperSession session, String extn, String id, AttributeDefType attributeDefType, String description) throws InsufficientPrivilegeException
session
- extn
- id
- attributeDefType
- description
- AttributeDefAddException
InsufficientPrivilegeException
public Stem internal_addChildStem(String extn, String dExtn, String uuid) throws StemAddException, InsufficientPrivilegeException
extn
- extensiondExtn
- display extensionuuid
- uuidStemAddException
- if problemInsufficientPrivilegeException
- if problemprotected Stem internal_addChildStem(GrouperSession session, String extn, String dExtn, String uuid, boolean addDefaultStemPrivileges, boolean failIfExists) throws StemAddException, InsufficientPrivilegeException
session
- extn
- dExtn
- uuid
- addDefaultStemPrivileges
- failIfExists
- StemAddException
InsufficientPrivilegeException
public boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
public long getCreateTimeLong()
public String getCreatorUuid()
public String getDescriptionDb()
public String getDisplayExtensionDb()
public String getDisplayNameDb()
public String getExtensionDb()
public String getModifierUuid()
public long getModifyTimeLong()
public String getNameDb()
public String getParentUuid()
public void setCreateTimeLong(long createTime)
createTime
- public void setCreatorUuid(String creatorUUID)
creatorUUID
- public void setDescriptionDb(String description)
description
- public void setDisplayExtensionDb(String displayExtension)
displayExtension
- public void setDisplayName(String displayName)
displayName
- public void setDisplayNameDb(String displayName)
displayName
- public void setExtensionDb(String extension)
extension
- public void setModifierUuid(String modifierUUID)
modifierUUID
- public void setModifyTimeLong(long modifyTime)
modifyTime
- public void setName(String name)
name
- public void setNameDb(String name)
name
- public void setParentUuid(String parentUUID)
parentUUID
- public void setUuid(String uuid)
uuid
- public String toStringDb()
public void onPostDelete(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostDelete
in interface HibGrouperLifecycle
onPostDelete
in class GrouperAPI
GrouperAPI.onPostDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPostSave(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostSave
in interface HibGrouperLifecycle
onPostSave
in class GrouperAPI
GrouperAPI.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPostUpdate(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostUpdate
in interface HibGrouperLifecycle
onPostUpdate
in class GrouperAPI
GrouperAPI.onPostUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreDelete(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreDelete
in interface HibGrouperLifecycle
onPreDelete
in class GrouperAPI
GrouperAPI.onPreDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreSave(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreSave
in interface HibGrouperLifecycle
onPreSave
in class GrouperAPI
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreUpdate(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreUpdate
in interface HibGrouperLifecycle
onPreUpdate
in class GrouperAPI
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public Stem dbVersion()
dbVersion
in class GrouperAPI
public Set<String> dbVersionDifferentFields()
dbVersionDifferentFields
in class GrouperAPI
GrouperAPI.dbVersionDifferentFields()
public void dbVersionReset()
dbVersionReset
in class GrouperAPI
public Stem clone()
clone
in interface GrouperCloneable
clone
in class GrouperAPI
Object.clone()
public static Stem _createStemAndParentStemsIfNotExist(GrouperSession grouperSession, String stemName, String stemDisplayNameForInserts) throws InsufficientPrivilegeException, StemNotFoundException, StemAddException
stemName
- grouperSession
- stemDisplayNameForInserts
- optional, will use this for display name, and not just default to the name. Note this is
only used if creating something, it will not update existing stemsInsufficientPrivilegeException
StemNotFoundException
StemAddException
public static Stem saveStem(GrouperSession grouperSession, String stemNameToEdit, String uuid, String name, String displayExtension, String description, SaveMode saveMode, boolean createParentStemsIfNotExist) throws StemNotFoundException, InsufficientPrivilegeException, StemAddException, StemModifyException
create or update a stem. Note this will not move a stem at this time (might in future) This is a static method since setters to Stem objects persist to the DB Steps: 1. Find the stem by stemNameToEdit (if not there then its an insert) 2. Internally set all the fields of the stem (no need to reset if already the same) 3. Store the stem (insert or update) if needed 4. Return the stem object This occurs in a transaction, so if a part of it fails, it rolls back, and potentially rolls back outer transactions too
grouperSession
- to act asstemNameToEdit
- is the name of the stem to edit (or null if insert)description
- new description for stemdisplayExtension
- display friendly name for this stem only
(parent stems are not specified)name
- this is required, and is the full name of the stem
including the names of parent stems. e.g. stem1:stem2:stem3
the parent stem must exist unless createParentStemsIfNotExist.
Can rename a stem extension, but not the parent stem name (move)uuid
- of the stem. uuid for an inserted stemsaveMode
- to constrain if insert only or update only, if null defaults to INSERT_OR_UPDATEcreateParentStemsIfNotExist
- true if the stems should be created if they dont exist, false
for StemNotFoundException if not exist. Note, the display extension on created stems
will equal the extension. This could be dangerous and should probably only be used for testingStemNotFoundException
InsufficientPrivilegeException
StemAddException
StemModifyException
public void move(Stem stem) throws StemModifyException, InsufficientPrivilegeException
stem
- StemModifyException
InsufficientPrivilegeException
protected void internal_move(Stem stem, boolean assignAlternateName) throws StemModifyException, InsufficientPrivilegeException
stem
- assignAlternateName
- StemModifyException
InsufficientPrivilegeException
protected Stem internal_copy(Stem stem, boolean privilegesOfStem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes) throws StemAddException, InsufficientPrivilegeException
stem
- privilegesOfStem
- Whether to copy privileges of stemsprivilegesOfGroup
- Whether to copy privileges of groupsgroupAsPrivilege
- Whether to copy privileges where groups are a memberlistMembersOfGroup
- Whether to copy the list memberships of groupslistGroupAsMember
- Whether to copy list memberships where groups are a memberattributes
- Whether to copy attributesStemAddException
InsufficientPrivilegeException
public Stem copy(Stem stem) throws StemAddException, InsufficientPrivilegeException
stem
- StemAddException
InsufficientPrivilegeException
public Long getLastMembershipChangeDb()
public void setLastMembershipChangeDb(Long theMembershipLastChange)
theMembershipLastChange
- public Timestamp getLastMembershipChange()
public Role addChildRole(String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException
// Add a role with the extension "edu" beneath this stem. try { Group edu = ns.addChildRole("edu", "edu domain"); } catch (GroupAddException eGA) { // Group not added } catch (InsufficientPrivilegeException eIP) { // Not privileged to add group }
extension
- Role extensiondisplayExtension
- Role displayExtensionRole
GroupAddException
InsufficientPrivilegeException
public Role internal_addChildRole(String extension, String displayExtension, String uuid) throws GroupAddException, InsufficientPrivilegeException
// Add a role with the extension "edu" beneath this stem. try { Group edu = ns.addChildRole("edu", "edu domain"); } catch (GroupAddException eGA) { // Group not added } catch (InsufficientPrivilegeException eIP) { // Not privileged to add group }
extension
- Role extensiondisplayExtension
- Role displayExtensionuuid
- is uuid or null if generatedRole
GroupAddException
InsufficientPrivilegeException
public Role internal_addChildEntity(String extension, String displayExtension, String uuid) throws GroupAddException, InsufficientPrivilegeException
// Add a role with the extension "edu" beneath this stem. try { Group edu = ns.addChildEntity("edu", "edu domain"); } catch (GroupAddException eGA) { // Group not added } catch (InsufficientPrivilegeException eIP) { // Not privileged to add group }
extension
- Entity extensiondisplayExtension
- Entity displayExtensionuuid
- is uuid or null if generatedRole
GroupAddException
InsufficientPrivilegeException
public boolean xmlDifferentBusinessProperties(Stem other)
XmlImportableBase
xmlDifferentBusinessProperties
in interface XmlImportableBase<Stem>
other
- the one to compare withXmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)
public boolean xmlDifferentUpdateProperties(Stem other)
XmlImportableBase
xmlDifferentUpdateProperties
in interface XmlImportableBase<Stem>
other
- the one to compare withXmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)
public void xmlCopyBusinessPropertiesToExisting(Stem existingRecord)
XmlImportableBase
xmlCopyBusinessPropertiesToExisting
in interface XmlImportableBase<Stem>
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)
public Stem xmlRetrieveByIdOrKey()
XmlImportable
xmlRetrieveByIdOrKey
in interface XmlImportable<Stem>
XmlImportable.xmlRetrieveByIdOrKey()
public boolean assignIdIndex(long theIdIndex)
theIdIndex
- public Stem xmlSaveBusinessProperties(Stem existingRecord)
XmlImportableBase
xmlSaveBusinessProperties
in interface XmlImportableBase<Stem>
existingRecord
- null if insert, the object if exists in DB
generally just copy the hibernate version number, and last updated to the
object and store itXmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)
public void xmlSaveUpdateProperties()
XmlImportableBase
xmlSaveUpdateProperties
in interface XmlImportableBase<Stem>
XmlImportableBase.xmlSaveUpdateProperties()
public XmlExportStem xmlToExportStem(GrouperVersion grouperVersion)
grouperVersion
- public String xmlGetId()
XmlImportableBase
xmlGetId
in interface XmlImportableBase<Stem>
XmlImportableBase.xmlGetId()
public void xmlSetId(String theId)
XmlImportableBase
xmlSetId
in interface XmlImportableBase<Stem>
XmlImportableBase.xmlSetId(java.lang.String)
public String xmlToString()
XmlImportableBase
xmlToString
in interface XmlImportableBase<Stem>
XmlImportableBase.xmlToString()
public void obliterate(boolean printOutput, boolean testOnly) throws InsufficientPrivilegeException, StemDeleteException
try { ns.delete(); } catch (InsufficientPrivilegeException eIP) { // not privileged to delete stem } catch (StemDeleteException eSD) { // unable to delete stem }
printOutput
- testOnly
- InsufficientPrivilegeException
StemDeleteException
public String __getId()
GrouperSetElement
__getId
in interface GrouperSetElement
GrouperSetElement.__getId()
public String __getName()
GrouperSetElement
__getName
in interface GrouperSetElement
GrouperSetElement.__getName()
public Long getIdIndex()
public void setIdIndex(Long idIndex1)
idIndex1
- public boolean matchesLowerSearchStrings(Set<String> filterStrings)
GrouperObject
matchesLowerSearchStrings
in interface GrouperObject
GrouperObject.matchesLowerSearchStrings(Set)
public boolean canHavePrivilege(Subject subject, String privilegeOrListName, boolean secure)
subject
- privilegeOrListName
- secure
- if the user must be an admin to checkpublic boolean grantPrivs(Subject subject, boolean stemChecked, boolean createChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean revokeIfUnchecked)
subject
- to addcreateChecked
- stemChecked
- attrReadChecked
- attrUpdateChecked
- revokeIfUnchecked
- Copyright © 2016 Internet2. All rights reserved.