Package edu.internet2.middleware.grouper
Class Stem
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Stem
- All Implemented Interfaces:
AttributeAssignable
,GrouperSetElement
,HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperHasContext
,GrouperId
,GrouperObject
,Owner
,GrouperUtil.FieldValuable
,XmlImportable<Stem>
,XmlImportableBase<Stem>
,Serializable
,Comparable<GrouperObject>
,org.hibernate.classic.Lifecycle
public class Stem
extends GrouperAPI
implements GrouperHasContext, Owner, Hib3GrouperVersioned, Comparable<GrouperObject>, XmlImportable<Stem>, AttributeAssignable, GrouperSetElement, GrouperObject
A namespace within the Groups Registry.
- Version:
- $Id: Stem.java,v 1.209 2009-12-15 06:47:06 mchyzer Exp $
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Search scope: one-level or subtree.static class
counts when obliterating or seeing if can obliterate -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
an alternate name for this stemstatic final String
context id column namestatic final String
id col in dbstatic final String
colstatic final String
id col in dbstatic final String
id col in dbstatic final String
colstatic final String
id col in dbstatic final String
column for hibernate version numberstatic final String
id col in dbstatic final String
unique number for this stemstatic final String
timestamp of the last membership change for this groupstatic final String
id col in dbstatic final String
id col in dbstatic final String
colstatic final String
old id col for id conversionstatic final String
old uuid id col for id conversionstatic final String
colstatic final String
uuid col in db (not used anymore)static final String
Hierarchy delimiter.static final String
constant for field name for: alternateNameDbstatic final String
constant for field name for: createTimestatic final String
constant for field name for: creatorUUIDstatic final String
constant for field name for: dbVersionstatic final String
constant for field name for: descriptionstatic final String
constant for field name for: displayExtensionstatic final String
constant for field name for: displayNamestatic final String
constant for field name for: extensionstatic final String
constant for field name for: idIndexstatic final String
constant for field name for: lastMembershipChangeDbstatic final String
constant for field name for: modifierUUIDstatic final String
constant for field name for: modifyTimestatic final String
constant for field name for: namestatic final String
constant for field name for: parentUuidstatic final String
constant for field name for: uuidstatic final String
root intstatic final String
Default name of root stem.static final String
table for stems table in the dbstatic boolean
run the change log sooner for teststatic final String
static final String
static final String
static final String
static final String
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription__getId()
if of this objectname 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.addChildAttributeDef
(String extension, AttributeDefType attributeDefType) Add a new attribute def to the registry.addChildAttributeDefName
(AttributeDef attributeDef, String extension, String displayExtension) Add a new attribute def to the registry.addChildAttributeDefName
(AttributeDef attributeDef, String extension, String displayExtension, String uuid) Add a new attribute def to the registry.addChildGroup
(String extension, String displayExtension) Add a new group to the registry.addChildRole
(String extension, String displayExtension) Add a new role to the registry.addChildStem
(String extension, String displayExtension) Add a new stem to the registry.addChildStem
(String extension, String displayExtension, String uuid, boolean failIfExists) Add a new stem to the registry.boolean
assignIdIndex
(long theIdIndex) assign different id indexboolean
canHavePrivilege
(Subject subject, String privilegeOrListName, boolean secure) see if the subject has a privilege or another privilege that implies this privilege.clone()
deep clone the fields in this objectint
compareTo
(GrouperObject that) Copy this stem to another Stem.save the state when retrieving from DBnote, these are massaged so that name, extension, etc look like normal fields.void
take a snapshot of the data since this is what is in the dbvoid
delete()
Delete this stem from the Groups Registry.boolean
deleteAlternateName
(String alternateName) Delete the specified alternate name.deleteAttributeDefNames
(boolean printOutput, boolean testOnly, Stem.Scope scope) deleteAttributeDefs
(boolean printOutput, boolean testOnly, Stem.Scope scope) deleteEmptyStems
(boolean printOutput, boolean testOnly, Stem.Scope scope) deleteGroupMemberships
(boolean printOutput, boolean testOnly, Stem.Scope scope) deleteGroups
(boolean printOutput, boolean testOnly, Stem.Scope scope) static boolean
see if we are in the middle of a delete (e.g.boolean
Returns the alternate name for the stem.Returns the alternate name for the stem.Returns the alternate names for the stem.get the logic delegatethis delegate works on attributes and values at the same timeGet groups that are immediate children of this stem.getChildGroups
(Privilege[] privileges, Stem.Scope scope) Deprecated.use the overloadgetChildGroups
(Stem.Scope scope) Get groups that are children of this stem.getChildGroups
(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) Get groups that are children of this stem.getChildGroups
(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) Get groups that are children of this stem.getChildGroups
(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups, Boolean enabled) Get groups that are children of this stem.getChildMembershipGroups
(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) Get groups that are children of this stem and there is a list membership.Get stems that are immediate children of this stem.getChildStems
(Privilege[] privileges, Stem.Scope scope) get child stemsgetChildStems
(Stem.Scope scope) Get stems that are children of this stem.getChildStems
(Stem.Scope scope, QueryOptions queryOptions) Get stems that are children of this stem.getChildStems
(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) Get groups that are children of this stem.context id of the transactionGet subject that created this stem.Get creation time for this stem.long
Get subjects with CREATE privilege on this stem.Get stem description.Get stem displayExtension.Get stem displayName.Get stem extension.getId()
id is same as uuidid of the group as a unique integerwhen the last member has changedwhen the last member has changed, used by hibernateGet subject that last modified this stem.Get last modified time for this stem.long
getName()
Get stem name.Get parent stem.get the name of the parent stemGet parent stem.Get privileges that the specified subject has on this stem.Get subjects with STEM_ADMIN privilege on this stem.Get subjects with STEM_ATTR_READ privilege on this stem.Get subjects with STEM_ATTR_UPDATE privilege on this stem.Get subjects with STEM privilege on this stem.Get subjects with STEM_VIEW privilege on this stem.getUuid()
void
Grant a privilege on this stem.boolean
Grant a privilege on this stem.boolean
grantPrivs
(Subject subject, boolean stemAdminChecked, boolean createChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean revokeIfUnchecked) Deprecated.use the overloaded methodboolean
grantPrivs
(Subject subject, boolean stemAdminChecked, boolean createChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean stemViewChecked, boolean revokeIfUnchecked) grant privs to stemboolean
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 privilegeboolean
Check whether a member has the STEM privilege on this stem.boolean
hasStemAdmin
(Subject subj) Check whether a member has the STEM_ADMIN 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.boolean
hasStemView
(Subject subj) Check whether a subject has the STEM_VIEW privilege on this stem.protected void
internal_addAlternateName
(String alternateName) Add an alternate name for this stem.internal_addChildAttributeDef
(GrouperSession session, String extn, String id, AttributeDefType attributeDefType, String description) internal_addChildAttributeDefName
(GrouperSession session, AttributeDef attributeDef, String extension, String displayExtension, String id, String description) internal_addChildEntity
(String extension, String displayExtension, String uuid) Add a new role to the registry.internal_addChildGroup
(String extn, String dExtn, String uuid) add child group with uuidinternal_addChildGroup
(String extn, String dExtn, String uuid, TypeOfGroup typeOfGroup) add child group with uuidinternal_addChildGroup
(String extn, String dExtn, String uuid, String description, Set<GroupType> types, Map<String, String> attributes, boolean addDefaultGroupPrivileges, TypeOfGroup typeOfGroup, boolean checkSecurity) 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) internal_addChildStem
(String extn, String dExtn, String uuid) add child stem with uuidstatic Stem
internal_addRootStem
(GrouperSession s, boolean[] changed) add root stemprotected Stem
internal_copy
(Stem stem, boolean privilegesOfStem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes, String stemExtension, String stemDisplayExtension) 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
set modifiedboolean
isCanObliterate
(Stem.Scope scope) see if the current session can obliterate.boolean
isChildGroup
(Group group) TODO 20070813 make public?boolean
isChildStem
(Stem stem) TODO 20070813 make public?boolean
isEmpty()
boolean
static void
boolean
matchesLowerSearchStrings
(Set<String> filterStrings) see if this object matches the filter stringsvoid
Move this stem to another Stem.void
obliterate
(boolean printOutput, boolean testOnly) Delete this stem from the Groups Registry including all sub objects.void
obliterate
(boolean printOutput, boolean testOnly, boolean deleteFromPointInTime) Delete this stem from the Groups Registry including all sub objects.static void
obliterate
(String stemName, boolean printOutput, boolean testOnly, boolean deletePointInTime) obliterate this stem name (which might not exist) from point in timestatic void
obliterateFromPointInTime
(String stemName, boolean printOutput) obliterate this stem name (which might not exist) from point in timevoid
onPostDelete
(HibernateSession hibernateSession) after a delete occursvoid
onPostSave
(HibernateSession hibernateSession) after a save (insert) occursvoid
onPostUpdate
(HibernateSession hibernateSession) after an update occursvoid
onPreDelete
(HibernateSession hibernateSession) before a delete (insert) occursvoid
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursstatic Stem.StemObliterateResults
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 transactionvoid
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 integervoid
setLastMembershipChangeDb
(Long theMembershipLastChange) when the last member has changed, used by hibernatevoid
setModifierUuid
(String modifierUUID) void
setModifyTimeLong
(long modifyTime) void
void
void
setParentUuid
(String parentUUID) void
void
store()
will be implemented soontoString()
void
validate()
void
xmlCopyBusinessPropertiesToExisting
(Stem existingRecord) copy business (non update) properties to an existing recordboolean
see if the non update cols are different (e.g.boolean
xmlDifferentUpdateProperties
(Stem other) see if the update cols are different (e.g.xmlGetId()
set id key in dbretrieve from db by id or key.xmlSaveBusinessProperties
(Stem existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set id key in dbxmlToExportStem
(GrouperVersion grouperVersion) convert to xml bean for exportconvert to string for logMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
VALIDATION_STEM_NAME_TOO_LONG_KEY
- See Also:
-
VALIDATION_STEM_DISPLAY_NAME_TOO_LONG_KEY
- See Also:
-
VALIDATION_STEM_EXTENSION_TOO_LONG_KEY
- See Also:
-
VALIDATION_STEM_DISPLAY_EXTENSION_TOO_LONG_KEY
- See Also:
-
VALIDATION_STEM_DESCRIPTION_TOO_LONG_KEY
- See Also:
-
TABLE_GROUPER_STEMS
table for stems table in the db- See Also:
-
COLUMN_UUID
uuid col in db (not used anymore)- See Also:
-
COLUMN_PARENT_STEM
col- See Also:
-
COLUMN_NAME
col- See Also:
-
COLUMN_DISPLAY_NAME
col- See Also:
-
COLUMN_CREATOR_ID
col- See Also:
-
COLUMN_ID
id col in db- See Also:
-
COLUMN_ID_INDEX
unique number for this stem- See Also:
-
COLUMN_CREATE_TIME
id col in db- See Also:
-
COLUMN_MODIFIER_ID
id col in db- See Also:
-
COLUMN_MODIFY_TIME
id col in db- See Also:
-
COLUMN_DISPLAY_EXTENSION
id col in db- See Also:
-
COLUMN_EXTENSION
id col in db- See Also:
-
COLUMN_DESCRIPTION
id col in db- See Also:
-
COLUMN_ALTERNATE_NAME
an alternate name for this stem- See Also:
-
COLUMN_HIBERNATE_VERSION_NUMBER
column for hibernate version number- See Also:
-
COLUMN_CONTEXT_ID
context id column name- See Also:
-
COLUMN_OLD_ID
old id col for id conversion- See Also:
-
COLUMN_OLD_UUID
old uuid id col for id conversion- See Also:
-
COLUMN_LAST_MEMBERSHIP_CHANGE
timestamp of the last membership change for this group- See Also:
-
FIELD_ALTERNATE_NAME_DB
constant for field name for: alternateNameDb- See Also:
-
FIELD_CREATE_TIME
constant for field name for: createTime- See Also:
-
FIELD_CREATOR_UUID
constant for field name for: creatorUUID- See Also:
-
FIELD_DB_VERSION
constant for field name for: dbVersion- See Also:
-
FIELD_DESCRIPTION
constant for field name for: description- See Also:
-
FIELD_DISPLAY_EXTENSION
constant for field name for: displayExtension- See Also:
-
FIELD_DISPLAY_NAME
constant for field name for: displayName- See Also:
-
FIELD_EXTENSION
constant for field name for: extension- See Also:
-
FIELD_ID_INDEX
constant for field name for: idIndex- See Also:
-
FIELD_MODIFIER_UUID
constant for field name for: modifierUUID- See Also:
-
FIELD_MODIFY_TIME
constant for field name for: modifyTime- See Also:
-
FIELD_NAME
constant for field name for: name- See Also:
-
FIELD_PARENT_UUID
constant for field name for: parentUuid- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
FIELD_LAST_MEMBERSHIP_CHANGE_DB
constant for field name for: lastMembershipChangeDb- See Also:
-
DELIM
Hierarchy delimiter.- See Also:
-
ROOT_NAME
Default name of root stem.- See Also:
-
ROOT_INT
root int- See Also:
-
testingRunChangeLogSooner
public static boolean testingRunChangeLogSoonerrun the change log sooner for test
-
-
Constructor Details
-
Stem
public Stem()
-
-
Method Details
-
getParentStemName
get the name of the parent stem- Returns:
- the name of the parent stem
-
getId
id is same as uuid -
compareTo
- Specified by:
compareTo
in interfaceComparable<GrouperObject>
- See Also:
-
getAttributeDelegate
Description copied from interface:AttributeAssignable
get the logic delegate- Specified by:
getAttributeDelegate
in interfaceAttributeAssignable
- Returns:
- the delegate
-
getAttributeValueDelegate
this delegate works on attributes and values at the same time- Specified by:
getAttributeValueDelegate
in interfaceAttributeAssignable
- Returns:
- the delegate
-
getContextId
context id of the transaction- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextId
in interfaceGrouperHasContext
- Parameters:
contextId1
-
-
addChildGroup
public Group addChildGroup(String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException Add a new group to the registry.// 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 }
- Parameters:
extension
- Group's extensiondisplayExtension
- Groups' displayExtension- Returns:
- The added
Group
- Throws:
GroupAddException
InsufficientPrivilegeException
-
addChildAttributeDef
public AttributeDef addChildAttributeDef(String extension, AttributeDefType attributeDefType) throws InsufficientPrivilegeException Add a new attribute def to the registry.- Parameters:
extension
- attributeDef's extensionattributeDefType
-- Returns:
- The added
AttributeDef
- Throws:
InsufficientPrivilegeException
-
addChildAttributeDefName
public AttributeDefName addChildAttributeDefName(AttributeDef attributeDef, String extension, String displayExtension) throws InsufficientPrivilegeException Add a new attribute def to the registry.- Parameters:
attributeDef
- is the definition of this attributeextension
- attributeDef's extensiondisplayExtension
-- Returns:
- The added
AttributeDef
- Throws:
InsufficientPrivilegeException
-
addChildAttributeDefName
public AttributeDefName addChildAttributeDefName(AttributeDef attributeDef, String extension, String displayExtension, String uuid) throws InsufficientPrivilegeException Add a new attribute def to the registry.- Parameters:
attributeDef
- is the definition of this attributeextension
- attributeDef's extensiondisplayExtension
-uuid
-- Returns:
- The added
AttributeDef
- Throws:
InsufficientPrivilegeException
-
addChildStem
public Stem addChildStem(String extension, String displayExtension, String uuid, boolean failIfExists) throws InsufficientPrivilegeException, StemAddException Add a new stem to the registry.// Add a stem with the extension "edu" beneath this stem. try { Stem edu = ns.addChildStem("edu", "edu domain"); } catch (StemAddException e) { // Stem not added }
- Parameters:
extension
- Stem's extensiondisplayExtension
- Stem' displayExtensionuuid
- if creating this is the uuidfailIfExists
- throws StemAddException if exists, else just return the existing stem- Returns:
- The added
Stem
- Throws:
InsufficientPrivilegeException
StemAddException
-
addChildStem
public Stem addChildStem(String extension, String displayExtension) throws InsufficientPrivilegeException, StemAddException Add a new stem to the registry.// Add a stem with the extension "edu" beneath this stem. try { Stem edu = ns.addChildStem("edu", "edu domain"); } catch (StemAddException e) { // Stem not added }
- Parameters:
extension
- Stem's extensiondisplayExtension
- Stem' displayExtension- Returns:
- The added
Stem
- Throws:
InsufficientPrivilegeException
StemAddException
-
deleteOccuring
public static boolean deleteOccuring()see if we are in the middle of a delete (e.g. for hook)- Returns:
- true if delete is occurring
-
delete
Delete this stem from the Groups Registry.try { ns.delete(); } catch (InsufficientPrivilegeException eIP) { // not privileged to delete stem } catch (StemDeleteException eSD) { // unable to delete stem }
-
getChildGroups
Get groups that are immediate children of this stem.- Returns:
- Set of
Group
objects. - See Also:
-
getChildGroups
Get groups that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.SUB
- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildGroups
public Set<Group> getChildGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) Get groups that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.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
-- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildGroups
public Set<Group> getChildGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws IllegalArgumentException Get groups that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.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
-- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildGroups
public Set<Group> getChildGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups, Boolean enabled) throws IllegalArgumentException Get groups that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.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
-enabled
- true if enabled only, false if disabled only, null if everything- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildMembershipGroups
public Set<Group> getChildMembershipGroups(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) throws IllegalArgumentException Get groups that are children of this stem and there is a list membership.- Parameters:
scope
- of search:Scope.ONE
orScope.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
-- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildStems
public Set<Stem> getChildStems(Stem.Scope scope, Set<Privilege> inPrivSet, QueryOptions queryOptions) throws IllegalArgumentException Get groups that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.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
-- Returns:
- Child groups.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildGroups
@Deprecated public Set<Group> getChildGroups(Privilege[] privileges, Stem.Scope scope) throws IllegalArgumentException Deprecated.use the overloadget child groups- Parameters:
privileges
- privsscope
- all or direct- Returns:
- Child groups where current subject has any of the specified privileges.
- Throws:
IllegalArgumentException
- if any parameter is null.- Since:
- 1.2.1
-
getChildStems
Get stems that are immediate children of this stem.- Returns:
- Set of
Stem
objects. - See Also:
-
getChildStems
Get stems that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.SUB
- Returns:
- Child stems.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildStems
public Set<Stem> getChildStems(Stem.Scope scope, QueryOptions queryOptions) throws IllegalArgumentException Get stems that are children of this stem.- Parameters:
scope
- of search:Scope.ONE
orScope.SUB
queryOptions
-- Returns:
- Child stems.
- Throws:
IllegalArgumentException
- if null scope.- Since:
- 1.2.1
-
getChildStems
public Set<Stem> getChildStems(Privilege[] privileges, Stem.Scope scope) throws IllegalArgumentException get child stems- Parameters:
privileges
- privsscope
- all or direct- Returns:
- Child (or deeper) stems where current subject has any of the specified privileges. Parent stems of grandchild (or deeper) groups where the current subject has any of the specified privileges.
- Throws:
IllegalArgumentException
- if any parameter is null.- Since:
- 1.2.1
-
getCreateSubject
Get subject that created this stem.// Get creator of this stem. try { Subject creator = ns.getCreateSubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }
- Returns:
Subject
that created this stem.- Throws:
SubjectNotFoundException
-
getCreateTime
Get creation time for this stem.// Get create time. Date created = ns.getCreateTime();
- Returns:
Date
that this stem was created.
-
getCreators
Get subjects with CREATE privilege on this stem.Set creators = ns.getCreators();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getDescription
Get stem description.// Get description String description = ns.getDescription();
- Specified by:
getDescription
in interfaceGrouperObject
- Returns:
- Stem description.
-
getDisplayExtension
Get stem displayExtension.// Get displayExtension String displayExtn = ns.getDisplayExtension();
- Returns:
- Stem displayExtension.
-
getDisplayName
Get stem displayName.// Get displayName String displayName = ns.getDisplayName();
- Specified by:
getDisplayName
in interfaceGrouperObject
- Returns:
- Stem displayName.
-
getExtension
Get stem extension.// Get extension String extension = ns.getExtension();
- Returns:
- Stem extension.
-
getModifySubject
Get subject that last modified this stem.// Get last modifier of this stem. try { Subject modifier = ns.getModifySubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }
- Returns:
Subject
that last modified this stem.- Throws:
SubjectNotFoundException
-
getModifyTime
Get last modified time for this stem.// Get last modified time. Date modified = ns.getModifyTime();
- Returns:
Date
that this stem was last modified.
-
getName
Get stem name.// Get name String name = ns.getName();
- Specified by:
getName
in interfaceGrouperObject
- Specified by:
getName
in interfaceOwner
- Returns:
- Stem name.
-
getParentStem
Get parent stem.// Get parent Stem parent = ns.getParentStem();
- Specified by:
getParentStem
in interfaceGrouperObject
- Returns:
- Parent
Stem
. - Throws:
StemNotFoundException
- if stem not found
-
getParentStemOrNull
Get parent stem.// Get parent Stem parent = ns.getParentStem();
- Returns:
- Parent
Stem
. - Throws:
StemNotFoundException
- if stem not found
-
getAlternateNameDb
Returns the alternate name for the stem. Used by hibernate.- Returns:
- the alternate name
-
getAlternateName
Returns the alternate name for the stem. If multiple, returns the first one- Returns:
- the alternate name
-
setAlternateNameDb
Set the group's alternate name Used by hibernate.- Parameters:
alternateName
-
-
getAlternateNames
Returns the alternate names for the stem. Only one alternate name is supported currently, so a Set of size 0 or 1 will be returned.- Returns:
- Set of alternate names.
-
addAlternateName
Add an alternate name for this stem. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().- Parameters:
alternateName
-
-
internal_addAlternateName
Add an alternate name for this stem. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().- Parameters:
alternateName
-
-
deleteAlternateName
Delete the specified alternate name. This won't get saved until you call store().- Parameters:
alternateName
-- Returns:
- false if the stem does not have the specified alternate name
-
getPrivs
Get privileges that the specified subject has on this stem.Set privs = ns.getPrivs(subj);
- Parameters:
subj
- Get privileges for this subject.- Returns:
- Set of
NamingPrivilege
objects.
-
getStemmers
Get subjects with STEM privilege on this stem.Set stemmers = ns.getStemmers();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getStemAdmins
Get subjects with STEM_ADMIN privilege on this stem.Set stemAdmins = ns.getStemAdmins();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getStemAttrReaders
Get subjects with STEM_ATTR_READ privilege on this stem.Set subjects = ns.getStemAttrReaders();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getStemAttrUpdaters
Get subjects with STEM_ATTR_UPDATE privilege on this stem.Set subjects = ns.getStemAttrUpdaters();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getStemViewers
Get subjects with STEM_VIEW privilege on this stem.Set subjects = ns.getStemViewers();
- Returns:
- Set of
Subject
objects - Throws:
GrouperException
-
getUuid
-
grantPriv
public void grantPriv(Subject subj, Privilege priv) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant a privilege on this stem.try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
- Parameters:
subj
- Grant privilege to this subject.priv
- Grant this privilege.- Throws:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
grantPriv
public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant a privilege on this stem.try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
- Parameters:
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 group- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
internal_grantPriv
public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant a privilege on this stem.try { ns.grantPriv(subj, NamingPrivilege.CREATE); } catch (GrantPrivilegeException e) { // Error granting privilege }
- Parameters:
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
-- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
hasCreate
Check whether a subject has the CREATE privilege on this stem.if (ns.hasCreate(subj)) { // Has CREATE } // Does not have CREATE }
- Parameters:
subj
- Check whether this subject has CREATE.- Returns:
- Boolean true if the subject has CREATE.
-
hasStemAttrRead
Check whether a subject has the STEM_ATTR_READ privilege on this stem.if (ns.hasStemAttrRead(subj)) { // Has STEM_ATTR_READ } // Does not have STEM_ATTR_READ }
- Parameters:
subj
- Check whether this subject has STEM_ATTR_READ.- Returns:
- Boolean true if the subject has STEM_ATTR_READ.
-
hasStemAttrUpdate
Check whether a subject has the STEM_ATTR_UPDATE privilege on this stem.if (ns.hasStemAttrUpdate(subj)) { // Has STEM_ATTR_UPDATE } // Does not have STEM_ATTR_UPDATE }
- Parameters:
subj
- Check whether this subject has STEM_ATTR_UPDATE.- Returns:
- Boolean true if the subject has STEM_ATTR_UPDATE.
-
hasStemView
Check whether a subject has the STEM_VIEW privilege on this stem.if (ns.hasStemView(subj)) { // Has STEM_VIEW } // Does not have STEM_VIEW }
- Parameters:
subj
- Check whether this subject has STEM_VIEW.- Returns:
- Boolean true if the subject has STEM_VIEW.
-
hasStem
Check whether a member has the STEM privilege on this stem.if (ns.hasStem(subj)) { // Has STEM } // Does not have STEM }
- Parameters:
subj
- check whether this subject has STEM.- Returns:
- Boolean true if the subject has STEM.
-
hasStemAdmin
Check whether a member has the STEM_ADMIN privilege on this stem.if (ns.hasStemAdmin(subj)) { // Has STEM_ADMIN } // Does not have STEM_ADMIN }
- Parameters:
subj
- check whether this subject has STEM_ADMIN.- Returns:
- Boolean true if the subject has STEM_ADMIN.
-
hasPrivilege
see if the subject has a privilege- Parameters:
subject
-privilegeOrListName
-- Returns:
- true if has privilege
-
isChildGroup
TODO 20070813 make public?- Parameters:
group
- group- Returns:
- True if group is child, at any depth, of this stem.
- Throws:
IllegalArgumentException
- if group is null.- Since:
- 1.2.1
-
isChildStem
TODO 20070813 make public?- Parameters:
stem
- stem- Returns:
- True if stem is child, at any depth, of this stem.
- Throws:
IllegalArgumentException
- if stem is null.- Since:
- 1.2.1
-
isRootStem
public boolean isRootStem()- Returns:
- Boolean true if this is the root stem of the Groups Registry.
- Since:
- 1.2.0
-
revokePriv
public void revokePriv(Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke all privileges of the specified type on this stem.try { ns.revokePriv(NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
- Parameters:
priv
- Revoke this privilege.- Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
revokePriv
public void revokePriv(Subject subj, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke a privilege on this stem.try { ns.revokePriv(subj, NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
- Parameters:
subj
- Revoke privilege from this subject.priv
- Revoke this privilege.- Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
revokePriv
public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke a privilege on this stem.try { ns.revokePriv(subj, NamingPrivilege.CREATE); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
- Parameters:
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 group- Returns:
- false if it was already revoked, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
setDescription
Set stem description.// Set description try { ns.setDescription(value); } } catch (InsufficientPrivilegeException e0) { // Not privileged to set description catch (StemModifyException e1) { // Error setting description }
- Parameters:
value
- Set description to this value.- Throws:
InsufficientPrivilegeException
StemModifyException
-
store
public void store()will be implemented soon -
validate
public void validate() -
setDisplayExtension
public void setDisplayExtension(String value) throws InsufficientPrivilegeException, StemModifyException Set displayExtension.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 }
- Parameters:
value
- Set displayExtension to this value.- Throws:
InsufficientPrivilegeException
StemModifyException
-
setExtension
Set extension.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" }
- Parameters:
value
- Set extension to this value.- Throws:
InsufficientPrivilegeException
StemModifyException
-
setExtension
public void setExtension(String value, boolean assignAlternateName) throws InsufficientPrivilegeException, StemModifyException Set extension.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" }
- Parameters:
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.- Throws:
InsufficientPrivilegeException
StemModifyException
-
toString
-
internal_addRootStem
public static Stem internal_addRootStem(GrouperSession s, boolean[] changed) throws GrouperException add root stem- Parameters:
s
- sessionchanged
- if you want to know if it was added, pass in array of size one, else null- Returns:
- stem
- Throws:
GrouperException
- is problem- Since:
- 1.2.0
-
internal_setModified
public void internal_setModified()set modified- Since:
- 1.2.0
-
internal_addChildGroup
public Group internal_addChildGroup(String extn, String dExtn, String uuid) throws GroupAddException, InsufficientPrivilegeException add child group with uuid- Parameters:
extn
- extensiondExtn
- display extensionuuid
- uuid- Returns:
- group
- Throws:
GroupAddException
- if problemInsufficientPrivilegeException
- if problem- Since:
- 1.2.0
-
internal_addChildGroup
public Group internal_addChildGroup(String extn, String dExtn, String uuid, TypeOfGroup typeOfGroup) throws GroupAddException, InsufficientPrivilegeException add child group with uuid- Parameters:
extn
- extensiondExtn
- display extensionuuid
- uuidtypeOfGroup
-- Returns:
- group
- Throws:
GroupAddException
- if problemInsufficientPrivilegeException
- if problem
-
internal_addChildGroup
public 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- Parameters:
extn
-dExtn
-uuid
-description
-types
-attributes
-addDefaultGroupPrivileges
-typeOfGroup
- or null for defaultcheckSecurity
-- Returns:
- group
- Throws:
GroupAddException
InsufficientPrivilegeException
-
internal_addChildAttributeDefName
public AttributeDefName internal_addChildAttributeDefName(GrouperSession session, AttributeDef attributeDef, String extension, String displayExtension, String id, String description) throws InsufficientPrivilegeException - Parameters:
attributeDef
-session
-extension
-displayExtension
-id
-description
-- Returns:
- group
- Throws:
AttributeDefNameAddException
InsufficientPrivilegeException
-
internal_addChildAttributeDef
public AttributeDef internal_addChildAttributeDef(GrouperSession session, String extn, String id, AttributeDefType attributeDefType, String description) throws InsufficientPrivilegeException - Parameters:
session
-extn
-id
-attributeDefType
-description
-- Returns:
- group
- Throws:
AttributeDefAddException
InsufficientPrivilegeException
-
internal_addChildStem
public Stem internal_addChildStem(String extn, String dExtn, String uuid) throws StemAddException, InsufficientPrivilegeException add child stem with uuid- Parameters:
extn
- extensiondExtn
- display extensionuuid
- uuid- Returns:
- the new stem
- Throws:
StemAddException
- if problemInsufficientPrivilegeException
- if problem- Since:
- 1.2.0
-
internal_addChildStem
protected Stem internal_addChildStem(GrouperSession session, String extn, String dExtn, String uuid, boolean addDefaultStemPrivileges, boolean failIfExists) throws StemAddException, InsufficientPrivilegeException - Parameters:
session
-extn
-dExtn
-uuid
-addDefaultStemPrivileges
-failIfExists
-- Returns:
- stem
- Throws:
StemAddException
InsufficientPrivilegeException
-
equals
-
getCreateTimeLong
public long getCreateTimeLong()- Returns:
- create time
-
getCreatorUuid
- Returns:
- create time
-
getDescriptionDb
- Returns:
- description
- Since:
- 1.2.0
-
getDisplayExtensionDb
- Returns:
- displayExtension
- Since:
- 1.2.0
-
getDisplayNameDb
- Returns:
- displayName
- Since:
- 1.2.0
-
getExtensionDb
- Returns:
- extension
- Since:
- 1.2.0
-
getModifierUuid
- Returns:
- modifier uuid
- Since:
- 1.2.0
-
getModifyTimeLong
public long getModifyTimeLong()- Returns:
- modify time long
- Since:
- 1.2.0
-
getNameDb
- Returns:
- name
- Since:
- 1.2.0
-
getParentUuid
- Returns:
- parent uuid
- Since:
- 1.2.0
-
hashCode
public int hashCode() -
setCreateTimeLong
public void setCreateTimeLong(long createTime) - Parameters:
createTime
-- Since:
- 1.2.0
-
setCreatorUuid
- Parameters:
creatorUUID
-- Since:
- 1.2.0
-
setDescriptionDb
- Parameters:
description
-- Since:
- 1.2.0
-
setDisplayExtensionDb
- Parameters:
displayExtension
-- Since:
- 1.2.0
-
setDisplayName
- Parameters:
displayName
-- Since:
- 1.2.0
-
setDisplayNameDb
- Parameters:
displayName
-- Since:
- 1.2.0
-
setExtensionDb
- Parameters:
extension
-- Since:
- 1.2.0
-
setModifierUuid
- Parameters:
modifierUUID
-- Since:
- 1.2.0
-
setModifyTimeLong
public void setModifyTimeLong(long modifyTime) - Parameters:
modifyTime
-- Since:
- 1.2.0
-
setName
- Parameters:
name
-- Since:
- 1.2.0
-
setNameDb
- Parameters:
name
-- Since:
- 1.2.0
-
setParentUuid
- Parameters:
parentUUID
-- Since:
- 1.2.0
-
setUuid
- Parameters:
uuid
-- Since:
- 1.2.0
-
toStringDb
- Returns:
- string
- Since:
- 1.2.0
-
onPostDelete
Description copied from interface:HibGrouperLifecycle
after a delete occurs- Specified by:
onPostDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPostDelete
in classGrouperAPI
- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycle
after a save (insert) occurs- Specified by:
onPostSave
in interfaceHibGrouperLifecycle
- Overrides:
onPostSave
in classGrouperAPI
- See Also:
-
onPostUpdate
Description copied from interface:HibGrouperLifecycle
after an update occurs- Specified by:
onPostUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPostUpdate
in classGrouperAPI
- See Also:
-
onPreDelete
Description copied from interface:HibGrouperLifecycle
before a delete (insert) occurs- Specified by:
onPreDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPreDelete
in classGrouperAPI
- See Also:
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
in classGrouperAPI
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPreUpdate
in classGrouperAPI
- See Also:
-
dbVersion
save the state when retrieving from DB- Overrides:
dbVersion
in classGrouperAPI
- Returns:
- the dbVersion
-
dbVersionDifferentFields
note, these are massaged so that name, extension, etc look like normal fields. access with fieldValue()- Overrides:
dbVersionDifferentFields
in classGrouperAPI
- Returns:
- a set of attributes changed, or empty set if none
- See Also:
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db- Overrides:
dbVersionReset
in classGrouperAPI
-
clone
deep clone the fields in this object- Specified by:
clone
in interfaceGrouperCloneable
- Specified by:
clone
in classGrouperAPI
- Returns:
- the clone of the object
- See Also:
-
_createStemAndParentStemsIfNotExist
public static Stem _createStemAndParentStemsIfNotExist(GrouperSession grouperSession, String stemName, String stemDisplayNameForInserts) throws InsufficientPrivilegeException, StemNotFoundException, StemAddException create stems and parents if not exist.- Parameters:
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 stems- Returns:
- the resulting stem
- Throws:
InsufficientPrivilegeException
StemNotFoundException
StemAddException
-
saveStem
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
- Parameters:
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 testing- Returns:
- the stem that was updated or created
- Throws:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
StemModifyException
-
move
Move this stem to another Stem. If you would like to specify options for the move, use StemMove instead. This will use the default options.- Parameters:
stem
-- Throws:
StemModifyException
InsufficientPrivilegeException
-
internal_move
protected void internal_move(Stem stem, boolean assignAlternateName) throws StemModifyException, InsufficientPrivilegeException - Parameters:
stem
-assignAlternateName
-- Throws:
StemModifyException
InsufficientPrivilegeException
-
internal_copy
protected Stem internal_copy(Stem stem, boolean privilegesOfStem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes, String stemExtension, String stemDisplayExtension) throws StemAddException, InsufficientPrivilegeException Copy this stem to another Stem.- Parameters:
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 attributesstemExtension
-stemDisplayExtension
-- Returns:
- the new stem
- Throws:
StemAddException
InsufficientPrivilegeException
-
copy
Copy this stem to another Stem. If you want to specify options for the copy, use StemCopy. This will use the default options.- Parameters:
stem
-- Returns:
- the new stem
- Throws:
StemAddException
InsufficientPrivilegeException
-
getLastMembershipChangeDb
when the last member has changed, used by hibernate- Returns:
- when
-
setLastMembershipChangeDb
when the last member has changed, used by hibernate- Parameters:
theMembershipLastChange
-
-
getLastMembershipChange
when the last member has changed- Returns:
- the membership last change timestamp
-
addChildRole
public Role addChildRole(String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException Add a new role to the registry.// 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 }
- Parameters:
extension
- Role extensiondisplayExtension
- Role displayExtension- Returns:
- The added
Role
- Throws:
GroupAddException
InsufficientPrivilegeException
-
internal_addChildRole
public Role internal_addChildRole(String extension, String displayExtension, String uuid) throws GroupAddException, InsufficientPrivilegeException Add a new role to the registry.// 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 }
- Parameters:
extension
- Role extensiondisplayExtension
- Role displayExtensionuuid
- is uuid or null if generated- Returns:
- The added
Role
- Throws:
GroupAddException
InsufficientPrivilegeException
-
internal_addChildEntity
public Role internal_addChildEntity(String extension, String displayExtension, String uuid) throws GroupAddException, InsufficientPrivilegeException Add a new role to the registry.// 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 }
- Parameters:
extension
- Entity extensiondisplayExtension
- Entity displayExtensionuuid
- is uuid or null if generated- Returns:
- The added
Role
- Throws:
GroupAddException
InsufficientPrivilegeException
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<Stem>
- Parameters:
other
- the one to compare with- Returns:
- true if so
- See Also:
-
xmlDifferentUpdateProperties
Description copied from interface:XmlImportableBase
see if the update cols are different (e.g. last updated)- Specified by:
xmlDifferentUpdateProperties
in interfaceXmlImportableBase<Stem>
- Parameters:
other
- the one to compare with- Returns:
- true if so
- See Also:
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<Stem>
- See Also:
-
xmlRetrieveByIdOrKey
Description copied from interface:XmlImportable
retrieve from db by id or key. throws exception if duplicate- Specified by:
xmlRetrieveByIdOrKey
in interfaceXmlImportable<Stem>
- Returns:
- the object or null if not found
- See Also:
-
assignIdIndex
public boolean assignIdIndex(long theIdIndex) assign different id index- Parameters:
theIdIndex
-- Returns:
- if it was changed
-
xmlSaveBusinessProperties
Description copied from interface:XmlImportableBase
save the business properties (not update properties)- Specified by:
xmlSaveBusinessProperties
in interfaceXmlImportableBase<Stem>
- Parameters:
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 it- Returns:
- the new object or existing
- See Also:
-
xmlSaveUpdateProperties
public void xmlSaveUpdateProperties()Description copied from interface:XmlImportableBase
save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate- Specified by:
xmlSaveUpdateProperties
in interfaceXmlImportableBase<Stem>
- See Also:
-
xmlToExportStem
convert to xml bean for export- Parameters:
grouperVersion
-- Returns:
- xml bean
-
xmlGetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlGetId
in interfaceXmlImportableBase<Stem>
- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<Stem>
- See Also:
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<Stem>
- Returns:
- the string value for log
- See Also:
-
obliterateFromPointInTime
obliterate this stem name (which might not exist) from point in time- Parameters:
stemName
-printOutput
-
-
obliterate
public static void obliterate(String stemName, boolean printOutput, boolean testOnly, boolean deletePointInTime) obliterate this stem name (which might not exist) from point in time- Parameters:
stemName
-printOutput
-testOnly
-deletePointInTime
-
-
obliterate
public void obliterate(boolean printOutput, boolean testOnly, boolean deleteFromPointInTime) Delete this stem from the Groups Registry including all sub objects.- Parameters:
printOutput
-testOnly
-deleteFromPointInTime
- needs to wait for change log entries to be processed, then delete those too
-
obliterate
public void obliterate(boolean printOutput, boolean testOnly) throws InsufficientPrivilegeException, StemDeleteException Delete this stem from the Groups Registry including all sub objects.- Parameters:
printOutput
-testOnly
-- Throws:
InsufficientPrivilegeException
StemDeleteException
-
__getId
Description copied from interface:GrouperSetElement
if of this object- Specified by:
__getId
in interfaceGrouperSetElement
- Returns:
- id
- See Also:
-
__getName
Description copied from interface:GrouperSetElement
name of this object (for logging)- Specified by:
__getName
in interfaceGrouperSetElement
- Returns:
- name
- See Also:
-
getIdIndex
id of the group as a unique integer- Returns:
- id
-
setIdIndex
id of the group as a unique integer- Parameters:
idIndex1
-
-
matchesLowerSearchStrings
Description copied from interface:GrouperObject
see if this object matches the filter strings- Specified by:
matchesLowerSearchStrings
in interfaceGrouperObject
- Returns:
- true if matches
- See Also:
-
canHavePrivilege
see if the subject has a privilege or another privilege that implies this privilege.- Parameters:
subject
-privilegeOrListName
-secure
- if the user must be an admin to check- Returns:
- true if has privilege
-
grantPrivs
@Deprecated public boolean grantPrivs(Subject subject, boolean stemAdminChecked, boolean createChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean revokeIfUnchecked) Deprecated.use the overloaded methodgrant privs to stem- Parameters:
subject
- to addcreateChecked
-stemAdminChecked
-attrReadChecked
-attrUpdateChecked
-revokeIfUnchecked
-- Returns:
- if something was changed
-
grantPrivs
public boolean grantPrivs(Subject subject, boolean stemAdminChecked, boolean createChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean stemViewChecked, boolean revokeIfUnchecked) grant privs to stem- Parameters:
subject
- to addcreateChecked
-stemAdminChecked
-attrReadChecked
-attrUpdateChecked
-revokeIfUnchecked
-- Returns:
- if something was changed
-
retrieveObliterateResults
- Returns:
- obliterate results
-
main
- Parameters:
args
-
-
isEmpty
public boolean isEmpty()- Returns:
- if this stem is empty i.e. can be deleted
-
isCanObliterate
see if the current session can obliterate. also setup counts of object types- Returns:
- true if can obliterate
-
deleteAttributeDefs
public Set<AttributeDef> deleteAttributeDefs(boolean printOutput, boolean testOnly, Stem.Scope scope) - Parameters:
printOutput
-testOnly
-scope
-- Returns:
- attribute defs to be deleted or would be deleted
-
deleteAttributeDefNames
public Set<AttributeDefName> deleteAttributeDefNames(boolean printOutput, boolean testOnly, Stem.Scope scope) - Parameters:
printOutput
-testOnly
-scope
-- Returns:
- attribute def names deleted or to be deleted
-
deleteGroups
- Parameters:
printOutput
-testOnly
-scope
-- Returns:
- groups to be deleted or would be deleted
-
deleteGroupMemberships
- Parameters:
printOutput
-testOnly
-scope
-- Returns:
- groups have memberships deleted or would be deleted
-
deleteEmptyStems
- Parameters:
printOutput
-testOnly
-scope
-- Returns:
- stems to be deleted or would be deleted
-