edu.internet2.middleware.grouper.group
Class CompositeSave

java.lang.Object
  extended by edu.internet2.middleware.grouper.group.CompositeSave

public class CompositeSave
extends Object

Use this class to insert or update a composite e.g. composite = new CompositeSave(grouperSession).assignOwnerGroupName("test:testGroup").assignLeftFactorGroupName("a:b"c).assignRightFactorGroupName("a:b:d").assignCompsiteType(CompositeType.COMPLEMENT).save();


Constructor Summary
CompositeSave(GrouperSession theGrouperSession)
          create a new composite save
 
Method Summary
 CompositeSave assignCompositeType(CompositeType theCompositeType)
          assign the composite type
 CompositeSave assignId(String theId)
          id of this composite
 CompositeSave assignLeftFactorGroup(Group theLeftFactorGroup)
          if this is a group attribute, this is the foreign key
 CompositeSave assignLeftFactorGroupId(String theLeftFactorGroupId)
          if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupName
 CompositeSave assignLeftFactorGroupName(String theLeftFactorGroupName)
          left factor group name, this is the foreign key mutually exclusive with leftFactorGroupId
 CompositeSave assignOwnerGroup(Group theOwnerGroup)
          owner group foreign key
 CompositeSave assignOwnerGroupId(String theOwnerGroupId)
          this is the foreign key mutually exclusive with ownerGroupName
 CompositeSave assignOwnerGroupName(String theOwnerGroupName)
          owner group name, this is the foreign key mutually exclusive with ownerGroupId
 CompositeSave assignRightFactorGroup(Group theRightFactorGroup)
          right factor group this is the foreign key
 CompositeSave assignRightFactorGroupId(String theRightFactorGroupId)
          right factor group id, this is the foreign key mutually exclusive with rightFactorGroupName
 CompositeSave assignRightFactorGroupName(String theRightFactorGroupName)
          right factor group name, this is the foreign key mutually exclusive with rightFactorGroupId
 CompositeSave assignSaveMode(SaveMode theSaveMode)
          assign save mode
 Composite getComposite()
           
 SaveResultType getSaveResultType()
          get the save type
 Composite save()
           create or update a group.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeSave

public CompositeSave(GrouperSession theGrouperSession)
create a new composite save

Parameters:
theGrouperSession -
Method Detail

assignSaveMode

public CompositeSave assignSaveMode(SaveMode theSaveMode)
assign save mode

Parameters:
theSaveMode -
Returns:
this for chaining

assignId

public CompositeSave assignId(String theId)
id of this composite

Parameters:
theId -
Returns:
this for chaining

assignOwnerGroupId

public CompositeSave assignOwnerGroupId(String theOwnerGroupId)
this is the foreign key mutually exclusive with ownerGroupName

Parameters:
theOwnerGroupId -
Returns:
this for chaining

assignLeftFactorGroupName

public CompositeSave assignLeftFactorGroupName(String theLeftFactorGroupName)
left factor group name, this is the foreign key mutually exclusive with leftFactorGroupId

Parameters:
theLeftFactorGroupName -
Returns:
this for chaining

assignOwnerGroup

public CompositeSave assignOwnerGroup(Group theOwnerGroup)
owner group foreign key

Parameters:
theOwnerGroup -
Returns:
this for chaining

getSaveResultType

public SaveResultType getSaveResultType()
get the save type

Returns:
save type

assignCompositeType

public CompositeSave assignCompositeType(CompositeType theCompositeType)
assign the composite type

Parameters:
theCompositeType -
Returns:
this for chaining

getComposite

public Composite getComposite()
Returns:
the composite

save

public Composite save()
               throws AttributeDefNameNotFoundException,
                      InsufficientPrivilegeException,
                      StemNotFoundException,
                      GroupNotFoundException
 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
GroupNotFoundException
AttributeDefNameNotFoundException

assignLeftFactorGroup

public CompositeSave assignLeftFactorGroup(Group theLeftFactorGroup)
if this is a group attribute, this is the foreign key

Parameters:
theLeftFactorGroup -
Returns:
this for chaining

assignLeftFactorGroupId

public CompositeSave assignLeftFactorGroupId(String theLeftFactorGroupId)
if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupName

Parameters:
theLeftFactorGroupId -
Returns:
this for chaining

assignRightFactorGroupName

public CompositeSave assignRightFactorGroupName(String theRightFactorGroupName)
right factor group name, this is the foreign key mutually exclusive with rightFactorGroupId

Parameters:
theRightFactorGroupName -
Returns:
this for chaining

assignRightFactorGroup

public CompositeSave assignRightFactorGroup(Group theRightFactorGroup)
right factor group this is the foreign key

Parameters:
theRightFactorGroup -
Returns:
this for chaining

assignRightFactorGroupId

public CompositeSave assignRightFactorGroupId(String theRightFactorGroupId)
right factor group id, this is the foreign key mutually exclusive with rightFactorGroupName

Parameters:
theRightFactorGroupId -
Returns:
this for chaining

assignOwnerGroupName

public CompositeSave assignOwnerGroupName(String theOwnerGroupName)
owner group name, this is the foreign key mutually exclusive with ownerGroupId

Parameters:
theOwnerGroupName -
Returns:
this for chaining