public class GroupSave extends Object
Sample call
Group groupAbc = new GroupSave().assignName("a:b:c").assignCreateParentStemsIfNotExist(true).save();
Sample using GroupSave results
GroupSave groupSave = new GroupSave().assignName("a:b:c").assignCreateParentStemsIfNotExist(true); Group groupAbc = groupSave.save(); System.out.println(groupSave.getSaveResultType()); // DELETE, INSERT, NO_CHANGE, or UPDATE
Sample to delete
new GroupSave().assignName("a:b:c").assignSaveMode("DELETE").save();
To edit just one field (the description) for existing group a:b:c
new GroupSave().assignName("a:b:c").assignDescription("new description").assignReplaceAllSettings(false).save();
Modifier and Type | Field and Description |
---|---|
static String |
PERFORMANCE_LOG_LABEL
use this for performance log label
|
Constructor and Description |
---|
GroupSave()
create a new group save
|
GroupSave(GrouperSession theGrouperSession)
create a new group save
|
Modifier and Type | Method and Description |
---|---|
GroupSave |
assignAlternateName(String theAlternateName)
Will save or remove an alternate name for the group e.g.
|
GroupSave |
assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
assign create parents if not exist
|
GroupSave |
assignDescription(String theDescription)
assign description
|
GroupSave |
assignDisabledTime(Long theDisabledTime)
if there is a date here, and it is in the past, this group is disabled
|
GroupSave |
assignDisabledTimestamp(Timestamp theDisabledTimestamp)
if there is a date here, and it is in the past, this group is disabled
|
GroupSave |
assignDisplayExtension(String theDisplayExtension)
display extension
|
GroupSave |
assignDisplayName(String theDisplayName) |
GroupSave |
assignEnabledTime(Long theEnabledTimeDb)
if there is a date here, and it is in the future, this group is disabled
until that time
|
GroupSave |
assignEnabledTimestamp(Timestamp theEnabledTimestamp)
if there is a date here, and it is in the future, this group is disabled
until that time
|
GroupSave |
assignGroupNameToEdit(String theGroupNameToEdit)
group name to edit
|
GroupSave |
assignIdIndex(Long theIdIndex)
assign id_index
|
GroupSave |
assignName(String name1)
name
|
GroupSave |
assignPrivAllAdmin(boolean thePrivAllAdmin)
assign priv admin to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllAttrRead(boolean thePrivAllAttrRead)
assign priv attr read to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllAttrUpdate(boolean thePrivAllAttrUpdate)
assign priv attr update to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllOptin(boolean thePrivAllOptin)
assign priv optin to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllOptout(boolean thePrivAllOptout)
assign priv optout to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllRead(boolean thePrivAllRead)
assign priv read to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllUpdate(boolean thePrivAllUpdate)
assign priv update to be different than the defaults for grouperAll
|
GroupSave |
assignPrivAllView(boolean thePrivAllView)
assign priv view to be different than the defaults for grouperAll
|
GroupSave |
assignReplaceAllSettings(boolean theReplaceAllSettings)
if you want to replace all the settings for the object, send true (that's the default).
|
GroupSave |
assignRunAsRoot(boolean runAsRoot)
set this to true to run as a root session
|
GroupSave |
assignSaveMode(SaveMode theSaveMode)
assign save mode
|
GroupSave |
assignSaveMode(String theSaveMode)
assign save mode
|
GroupSave |
assignSetAlternateNameIfRename(boolean theSetAlternateNameIfRename)
whether an alternate name should automatically be assigned if doing a rename
|
GroupSave |
assignTypeOfGroup(String theTypeOfGroup)
assign save mode
|
GroupSave |
assignTypeOfGroup(TypeOfGroup theTypeOfGroup)
assign save mode
|
GroupSave |
assignUuid(String theUuid)
uuid
|
SaveResultType |
getSaveResultType()
get the save type
|
Group |
save()
create or update a group.
|
Group |
saveUnchecked()
Deprecated.
use save() instead
|
public static final String PERFORMANCE_LOG_LABEL
public GroupSave()
theGrouperSession
- public GroupSave(GrouperSession theGrouperSession)
theGrouperSession
- public GroupSave assignRunAsRoot(boolean runAsRoot)
runAsRoot
- public GroupSave assignPrivAllAdmin(boolean thePrivAllAdmin)
thePrivAllAdmin
- public GroupSave assignPrivAllView(boolean thePrivAllView)
thePrivAllView
- public GroupSave assignPrivAllRead(boolean thePrivAllRead)
thePrivAllRead
- public GroupSave assignPrivAllUpdate(boolean thePrivAllUpdate)
thePrivAllUpdate
- public GroupSave assignPrivAllOptin(boolean thePrivAllOptin)
thePrivAllOptin
- public GroupSave assignPrivAllOptout(boolean thePrivAllOptout)
thePrivAllOptout
- public GroupSave assignPrivAllAttrRead(boolean thePrivAllAttrRead)
thePrivAllAttrRead
- public GroupSave assignPrivAllAttrUpdate(boolean thePrivAllAttrUpdate)
thePrivAllAttrUpdate
- public GroupSave assignGroupNameToEdit(String theGroupNameToEdit)
theGroupNameToEdit
- public GroupSave assignDisplayName(String theDisplayName)
theDisplayName
- public GroupSave assignDisplayExtension(String theDisplayExtension)
theDisplayExtension
- public GroupSave assignDescription(String theDescription)
theDescription
- public GroupSave assignAlternateName(String theAlternateName)
assignAlternateName("x:y:z")
theAlternateName
- public GroupSave assignSetAlternateNameIfRename(boolean theSetAlternateNameIfRename)
theSetAlternateNameIfRename
- public GroupSave assignDisabledTime(Long theDisabledTime)
theDisabledTime
- public GroupSave assignDisabledTimestamp(Timestamp theDisabledTimestamp)
theDisabledTimestamp
- public GroupSave assignEnabledTime(Long theEnabledTimeDb)
theEnabledTimeDb
- public GroupSave assignEnabledTimestamp(Timestamp theEnabledTimestamp)
theEnabledTimestamp
- public GroupSave assignIdIndex(Long theIdIndex)
theIdIndex
- public GroupSave assignSaveMode(SaveMode theSaveMode)
theSaveMode
- public GroupSave assignSaveMode(String theSaveMode)
theSaveMode
- public GroupSave assignTypeOfGroup(TypeOfGroup theTypeOfGroup)
theTypeOfGroup
- public GroupSave assignTypeOfGroup(String theTypeOfGroup)
theTypeOfGroup
- public GroupSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
theCreateParentStemsIfNotExist
- public SaveResultType getSaveResultType()
@Deprecated public Group saveUnchecked()
create or update a group. Do not throw checked exceptions, wrap in unchecked Note this will not rename a group at this time (might in future) This is a static method since setters to Group objects persist to the DB Steps: 1. Find the group by groupNameToEdit 2. Internally set all the fields of the stem (no need to reset if already the same) 3. Store the group (insert or update) if needed 4. Return the group object This runs in a tx so that if part of it fails the whole thing fails, and potentially the outer transaction too
public Group save() throws StemNotFoundException, InsufficientPrivilegeException, StemAddException, GroupModifyException, GroupNotFoundException, GroupAddException
create or update a group. Note this will not rename a group at this time (might in future) This is a static method since setters to Group objects persist to the DB Steps: 1. Find the group by groupNameToEdit 2. Internally set all the fields of the stem (no need to reset if already the same) 3. Store the group (insert or update) if needed 4. Return the group object This runs in a tx so that if part of it fails the whole thing fails, and potentially the outer transaction too
StemNotFoundException
InsufficientPrivilegeException
StemAddException
GroupModifyException
GroupNotFoundException
GroupAddException
public GroupSave assignReplaceAllSettings(boolean theReplaceAllSettings)
Copyright © 2016 Internet2. All rights reserved.