Package edu.internet2.middleware.grouper
Class CompositeSave
java.lang.Object
edu.internet2.middleware.grouper.CompositeSave
Use this class to insert or update or delete a composite
Sample call (type is complement or intersection)
Composite composite = new CompositeSave().assignOwnerName(group1.getName()).assignLeftFactorName(group2.getName()).assignRightFactorName(group3.getName()) .assignType("complement").save();
Sample call to delete a composite
new CompositeSave().assignOwnerName(group1.getName()).assignLeftFactorName(group2.getName()).assignRightFactorName(group3.getName()) .assignSaveMode(SaveMode.DELETE).save();
-
Constructor Summary
ConstructorDescriptioncreate a new membership saveCompositeSave
(GrouperSession theGrouperSession) create a new composite save -
Method Summary
Modifier and TypeMethodDescriptionassignCompositeType
(CompositeType theCompositeType) assign the composite typeid of composite on insertassignLeftFactorGroup
(Group theLeftFactorGroup) if this is a group attribute, this is the foreign keyassignLeftFactorGroupId
(String theLeftFactorGroupId) if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupNameassignLeftFactorGroupName
(String theLeftFactorGroupName) left factor group name, this is the foreign key mutually exclusive with leftFactorGroupIdassignLeftFactorName
(String theLeftFactor) assignOwnerGroup
(Group theOwnerGroup) owner group foreign keyassignOwnerGroupId
(String theOwnerGroupId) this is the foreign key mutually exclusive with ownerGroupNameassignOwnerGroupName
(String theOwnerGroupName) owner group name, this is the foreign key mutually exclusive with ownerGroupIdassignOwnerName
(String name1) nameassignRightFactorGroup
(Group theRightFactorGroup) right factor group this is the foreign keyassignRightFactorGroupId
(String theRightFactorGroupId) right factor group id, this is the foreign key mutually exclusive with rightFactorGroupNameassignRightFactorGroupName
(String theRightFactorGroupName) right factor group name, this is the foreign key mutually exclusive with rightFactorGroupIdassignRightFactorName
(String theRightFactor) assignSaveMode
(SaveMode theSaveMode) asssign save modeassignType
(String theType) get the save typesave()
create or update a group.
-
Constructor Details
-
CompositeSave
create a new composite save- Parameters:
theGrouperSession
-
-
CompositeSave
public CompositeSave()create a new membership save- Parameters:
theGrouperSession
-
-
-
Method Details
-
assignId
id of composite on insert- Parameters:
theId
-- Returns:
- this for chaining
-
assignType
- Parameters:
theType
-- Returns:
- this for chaining
-
assignLeftFactorName
- Parameters:
theLeftFactor
-- Returns:
- this for chaining
-
assignRightFactorName
- Parameters:
theRightFactor
-- Returns:
- this for chaining
-
assignOwnerName
name- Parameters:
name1
-- Returns:
- name
-
assignSaveMode
asssign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
getSaveResultType
get the save type- Returns:
- save type
-
assignOwnerGroupId
this is the foreign key mutually exclusive with ownerGroupName- Parameters:
theOwnerGroupId
-- Returns:
- this for chaining
-
assignLeftFactorGroupName
left factor group name, this is the foreign key mutually exclusive with leftFactorGroupId- Parameters:
theLeftFactorGroupName
-- Returns:
- this for chaining
-
assignCompositeType
assign the composite type- Parameters:
theCompositeType
-- Returns:
- this for chaining
-
getComposite
- Returns:
- the composite
-
assignOwnerGroup
owner group foreign key- Parameters:
theOwnerGroup
-- Returns:
- this for chaining
-
assignLeftFactorGroup
if this is a group attribute, this is the foreign key- Parameters:
theLeftFactorGroup
-- Returns:
- this for chaining
-
assignLeftFactorGroupId
if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupName- Parameters:
theLeftFactorGroupId
-- Returns:
- this for chaining
-
assignRightFactorGroupName
right factor group name, this is the foreign key mutually exclusive with rightFactorGroupId- Parameters:
theRightFactorGroupName
-- Returns:
- this for chaining
-
assignRightFactorGroup
right factor group this is the foreign key- Parameters:
theRightFactorGroup
-- Returns:
- this for chaining
-
assignRightFactorGroupId
right factor group id, this is the foreign key mutually exclusive with rightFactorGroupName- Parameters:
theRightFactorGroupId
-- Returns:
- this for chaining
-
assignOwnerGroupName
owner group name, this is the foreign key mutually exclusive with ownerGroupId- Parameters:
theOwnerGroupName
-- Returns:
- this for chaining
-
save
public Composite save() throws AttributeDefNameNotFoundException, InsufficientPrivilegeException, StemNotFoundException, GroupNotFoundExceptioncreate 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 composite that was updated or created or deleted
- Throws:
AttributeDefNameNotFoundException
InsufficientPrivilegeException
StemNotFoundException
GroupNotFoundException
-