edu.internet2.middleware.grouper
Class GroupSave

java.lang.Object
  extended by edu.internet2.middleware.grouper.GroupSave

public class GroupSave
extends java.lang.Object

Use this class to insert or update a group


Constructor Summary
GroupSave(GrouperSession theGrouperSession)
          create a new group save
 
Method Summary
 GroupSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
          assign create parents if not exist
 GroupSave assignDescription(java.lang.String theDescription)
          assign description
 GroupSave assignDisplayExtension(java.lang.String theDisplayExtension)
          display extension
 GroupSave assignDisplayName(java.lang.String theDisplayName)
           
 GroupSave assignGroupNameToEdit(java.lang.String theGroupNameToEdit)
          group name to edit
 GroupSave assignName(java.lang.String name1)
          name
 GroupSave assignSaveMode(SaveMode theSaveMode)
          assign save mode
 GroupSave assignTypeOfGroup(TypeOfGroup theTypeOfGroup)
          assign save mode
 GroupSave assignUuid(java.lang.String theUuid)
          uuid
 SaveResultType getSaveResultType()
          get the save type
 Group save()
           create or update a group.
 Group saveUnchecked()
           create or update a group.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupSave

public GroupSave(GrouperSession theGrouperSession)
create a new group save

Parameters:
theGrouperSession -
Method Detail

assignGroupNameToEdit

public GroupSave assignGroupNameToEdit(java.lang.String theGroupNameToEdit)
group name to edit

Parameters:
theGroupNameToEdit -
Returns:
the group name to edit

assignUuid

public GroupSave assignUuid(java.lang.String theUuid)
uuid

Parameters:
theUuid -
Returns:
uuid

assignDisplayName

public GroupSave assignDisplayName(java.lang.String theDisplayName)
Parameters:
theDisplayName -
Returns:
this for chaining

assignName

public GroupSave assignName(java.lang.String name1)
name

Parameters:
name1 -
Returns:
name

assignDisplayExtension

public GroupSave assignDisplayExtension(java.lang.String theDisplayExtension)
display extension

Parameters:
theDisplayExtension -
Returns:
this for chaining

assignDescription

public GroupSave assignDescription(java.lang.String theDescription)
assign description

Parameters:
theDescription -
Returns:
this for chaining

assignSaveMode

public GroupSave assignSaveMode(SaveMode theSaveMode)
assign save mode

Parameters:
theSaveMode -
Returns:
this for chaining

assignTypeOfGroup

public GroupSave assignTypeOfGroup(TypeOfGroup theTypeOfGroup)
assign save mode

Parameters:
theTypeOfGroup -
Returns:
this for chaining

assignCreateParentStemsIfNotExist

public GroupSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
assign create parents if not exist

Parameters:
theCreateParentStemsIfNotExist -
Returns:
this for chaining

getSaveResultType

public SaveResultType getSaveResultType()
get the save type

Returns:
save type

saveUnchecked

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
 

Returns:
the group

save

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
 

Returns:
the group
Throws:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
GroupModifyException
GroupNotFoundException
GroupAddException