Class AttributeAssignSave
java.lang.Object
edu.internet2.middleware.grouper.attr.assign.AttributeAssignSave
Use this class to insert or update an attribute assign
e.g.
attributeAssign = new AttributeAssignSave(grouperSession).assignOwnerStemName("test:testFolder").assignNameOfAttributeName("a:b"c).save();
-
Constructor Summary
ConstructorDescriptionAttributeAssignSave
(GrouperSession theGrouperSession) create a new attribute assign save -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeAssignOnThisAssignment
(AttributeAssignSave theAttributeAssignSave) if including assignments on this assignment, put them here, put in null to remove assignmentsaddAttributeAssignValue
(AttributeAssignValue attributeAssignValue) add a value to assign to this assignment.add a value to an attribute assignmentassignAction
(String theAction) assign the actionassignAttributeAssignActionId
(String theAttributeAssignActionId) assign the action id for the action on this assignmentassignAttributeAssignDelegatable
(AttributeAssignDelegatable theAttributeAssignDelegatable) if the subjects assigned to the attribute can delegate to someone else, or delegate as delegatableassignAttributeAssignIdsToNotUse
(Set<String> theAttributeAssignIdsToNotUse) if doing an import, these are id's which should not be used.assignAttributeAssignType
(AttributeAssignType theAttributeAssignType) type of assignmentassignAttributeDefName
(AttributeDefName theAttributeDefName) attribute name in this assignment as opposed to nameOfAttributeDefNameassignAttributeDefNameId
(String theAttributeDefNameId) attribute name in this assignment as opposed to nameOfAttributeDefNameassignDisabledTime
(Long theDisabledTime) if there is a date here, and it is in the past, this assignment is disabledassignDisabledTime
(Timestamp theDisabledTimestamp) if there is a date here, and it is in the past, this assignment is disabledassignDisallowed
(boolean theDisallowed) if this is a permission, then if this permission assignment is allowed or notassignEnabledTime
(Long theEnabledTimeDb) if there is a date here, and it is in the future, this assignment is disabled until that timeassignEnabledTimestamp
(Timestamp theEnabledTimestamp) if there is a date here, and it is in the future, this assignment is disabled until that timeid of this attribute assignassignNameOfAttributeDefName
(String theNameOfAttributeDefName) attribute name in this assignment as opposed to attributeDefNameIdassignNotes
(String theNotes) notes about this assignment, free-form textassignOwnerAttributeAssign
(AttributeAssign theOwnerAttributeAssign) if this is an attribute assign attribute, this is the foreign keyassignOwnerAttributeAssignId
(String theOwnerAttributeAssignId) if this is an attribute assign attribute, this is the foreign keyassignOwnerAttributeDef
(AttributeDef theOwnerAttributeDef) if this is an attribute def attribute, this is the foreign keyassignOwnerAttributeDefId
(String theOwnerAttributeDefId) if this is an attribute def attribute, this is the foreign key, mutually exclusive with ownerNameOfAttributeDefassignOwnerGroup
(Group theOwnerGroup) if this is a group attribute, this is the foreign keyassignOwnerGroupId
(String theOwnerGroupId) if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupNameassignOwnerGroupName
(String theOwnerGroupName) if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupIdassignOwnerMember
(Member theOwnerMember) if this is a member attribute, this is the foreign keyassignOwnerMemberId
(String theOwnerMemberId) if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberSubjectId(entifier) and ownerMemberSourceIdassignOwnerMembership
(Membership theOwnerMembership) if this is a membership attribute, this is the foreign key.assignOwnerMembershipId
(String theOwnerMembershipId) if this is a membership attribute, this is the foreign key.assignOwnerMemberSourceId
(String theOwnerMemberSourceId) if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSubjectId or ownerMemberSubjectIdentifierassignOwnerMemberSubjectId
(String theOwnerMemberSubjectId) if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceIdassignOwnerMemberSubjectIdentifier
(String theOwnerMemberSubjectIdentifier) if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceIdassignOwnerNameOfAttributeDef
(String theOwnerNameOfAttributeDef) if this is an attribute def attribute, this is the foreign key mutually exclusive with ownerAttributeDefIdassignOwnerStem
(Stem theOwnerStem) if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemNameassignOwnerStemId
(String theOwnerStemId) if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemNameassignOwnerStemName
(String theOwnerStemName) if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemIdassignPrintChangesToSystemOut
(boolean thePrintChangesToSystemOut) if changes should be printed as system outassignPutAttributeAssignIdsToNotUseSet
(boolean thePutAttributeAssignIdsToNotUseSet) if the attribute assign ids should be added to the set to not useassignSaveMode
(SaveMode theSaveMode) assign save modevoid
find an existing assignment that is similar this requestmigrate values to attribute assign values if neededint
count how many things were changed (attributes values etc)get the save typestatic boolean
if we are in the middle of saving (then maybe ignore some rules)static boolean
if should print changes to standard outsave()
create or update an attribute assignment Steps: 1.
-
Constructor Details
-
AttributeAssignSave
create a new attribute assign save- Parameters:
theGrouperSession
-
-
-
Method Details
-
assignPrintChangesToSystemOut
if changes should be printed as system out- Parameters:
thePrintChangesToSystemOut
-- Returns:
- this for chaining
-
printChangesToSystemOutThreadlocal
public static boolean printChangesToSystemOutThreadlocal()if should print changes to standard out- Returns:
- if should print
-
inSaveThreadlocal
public static boolean inSaveThreadlocal()if we are in the middle of saving (then maybe ignore some rules)- Returns:
- if in the middle of saving
-
assignSaveMode
assign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
assignAttributeAssignDelegatable
public AttributeAssignSave assignAttributeAssignDelegatable(AttributeAssignDelegatable theAttributeAssignDelegatable) if the subjects assigned to the attribute can delegate to someone else, or delegate as delegatable- Parameters:
theAttributeAssignDelegatable
-- Returns:
- this for chaining
-
assignAttributeAssignType
type of assignment- Parameters:
theAttributeAssignType
-- Returns:
- this for chaining
-
assignAttributeDefNameId
attribute name in this assignment as opposed to nameOfAttributeDefName- Parameters:
theAttributeDefNameId
-- Returns:
- this for chaining
-
assignAttributeDefName
attribute name in this assignment as opposed to nameOfAttributeDefName- Parameters:
theAttributeDefName
-- Returns:
- this for chaining
-
assignNameOfAttributeDefName
attribute name in this assignment as opposed to attributeDefNameId- Parameters:
theNameOfAttributeDefName
-- Returns:
- this for chaining
-
assignDisabledTime
if there is a date here, and it is in the past, this assignment is disabled- Parameters:
theDisabledTime
-- Returns:
- this for chaining
-
assignDisabledTime
if there is a date here, and it is in the past, this assignment is disabled- Parameters:
theDisabledTimestamp
-- Returns:
- this for chaining
-
assignDisallowed
if this is a permission, then if this permission assignment is allowed or not- Parameters:
theDisallowed
-- Returns:
- this for chaining
-
assignEnabledTime
if there is a date here, and it is in the future, this assignment is disabled until that time- Parameters:
theEnabledTimeDb
-- Returns:
- this for chaining
-
assignEnabledTimestamp
if there is a date here, and it is in the future, this assignment is disabled until that time- Parameters:
theEnabledTimestamp
-- Returns:
- this for chaining
-
assignId
id of this attribute assign- Parameters:
theId
-- Returns:
- this for chaining
-
assignNotes
notes about this assignment, free-form text- Parameters:
theNotes
-- Returns:
- this for chaining
-
assignOwnerAttributeAssignId
if this is an attribute assign attribute, this is the foreign key- Parameters:
theOwnerAttributeAssignId
-- Returns:
- this for chaining
-
assignOwnerAttributeAssign
if this is an attribute assign attribute, this is the foreign key- Parameters:
theOwnerAttributeAssign
-- Returns:
- this for chaining
-
assignOwnerAttributeDefId
if this is an attribute def attribute, this is the foreign key, mutually exclusive with ownerNameOfAttributeDef- Parameters:
theOwnerAttributeDefId
-- Returns:
- this for chaining
-
assignOwnerAttributeDef
if this is an attribute def attribute, this is the foreign key- Parameters:
theOwnerAttributeDef
-- Returns:
- this for chaining
-
assignOwnerNameOfAttributeDef
if this is an attribute def attribute, this is the foreign key mutually exclusive with ownerAttributeDefId- Parameters:
theOwnerNameOfAttributeDef
-- Returns:
- this for chaining
-
assignOwnerGroupId
if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupName- Parameters:
theOwnerGroupId
-- Returns:
- this for chaining
-
assignOwnerGroupName
if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupId- Parameters:
theOwnerGroupName
-- Returns:
- this for chaining
-
assignOwnerGroup
if this is a group attribute, this is the foreign key- Parameters:
theOwnerGroup
-- Returns:
- this for chaining
-
assignOwnerMemberId
if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberSubjectId(entifier) and ownerMemberSourceId- Parameters:
theOwnerMemberId
-- Returns:
- this for chaining
-
assignOwnerMember
if this is a member attribute, this is the foreign key- Parameters:
theOwnerMember
-- Returns:
- this for chaining
-
assignOwnerMemberSubjectId
if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceId- Parameters:
theOwnerMemberSubjectId
-- Returns:
- this for chaining
-
assignOwnerMemberSubjectIdentifier
public AttributeAssignSave assignOwnerMemberSubjectIdentifier(String theOwnerMemberSubjectIdentifier) if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceId- Parameters:
theOwnerMemberSubjectIdentifier
-- Returns:
- this for chaining
-
assignOwnerMemberSourceId
if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSubjectId or ownerMemberSubjectIdentifier- Parameters:
theOwnerMemberSourceId
-- Returns:
- this for chaining
-
assignOwnerMembershipId
if this is a membership attribute, this is the foreign key. mutually exclusive with group and member foreign keys- Parameters:
theOwnerMembershipId
-- Returns:
- this for chaining
-
assignOwnerMembership
if this is a membership attribute, this is the foreign key. mutually exclusive with group and member foreign keys- Parameters:
theOwnerMembership
-- Returns:
- this for chaining
-
assignOwnerStemId
if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemName- Parameters:
theOwnerStemId
-- Returns:
- this for chaining
-
assignOwnerStem
if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemName- Parameters:
theOwnerStem
-- Returns:
- this for chaining
-
assignOwnerStemName
if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemId- Parameters:
theOwnerStemName
-- Returns:
- this for chaining
-
getSaveResultType
get the save type- Returns:
- save type
-
assignAttributeAssignActionId
assign the action id for the action on this assignment- Parameters:
theAttributeAssignActionId
-- Returns:
- the id of the action on this assignment
-
assignAction
assign the action- Parameters:
theAction
-- Returns:
- this for chaining
-
assignPutAttributeAssignIdsToNotUseSet
public AttributeAssignSave assignPutAttributeAssignIdsToNotUseSet(boolean thePutAttributeAssignIdsToNotUseSet) if the attribute assign ids should be added to the set to not use- Parameters:
thePutAttributeAssignIdsToNotUseSet
-- Returns:
- this for chaining
-
assignAttributeAssignIdsToNotUse
public AttributeAssignSave assignAttributeAssignIdsToNotUse(Set<String> theAttributeAssignIdsToNotUse) if doing an import, these are id's which should not be used. The current assignment will be added to this list- Parameters:
theAttributeAssignIdsToNotUse
-- Returns:
- this for chaining
-
addAttributeAssignValue
add a value to assign to this assignment. add null if remove all- Parameters:
attributeAssignValue
-- Returns:
- this for chaining
-
addValue
add a value to an attribute assignment- Parameters:
theValue
-- Returns:
- this for chaining
-
addAttributeAssignOnThisAssignment
public AttributeAssignSave addAttributeAssignOnThisAssignment(AttributeAssignSave theAttributeAssignSave) if including assignments on this assignment, put them here, put in null to remove assignments- Parameters:
theAttributeAssignSave
-- Returns:
- this for chaining
-
save
public AttributeAssign save() throws AttributeDefNameNotFoundException, InsufficientPrivilegeException, StemNotFoundException, GroupNotFoundExceptioncreate or update an attribute assignment Steps: 1. Find an existing attribute assignment 2. Internally set all the fields of the assignment 3. Store the assignment (insert or update) if needed 4. Manage assignments on assignments and values 5. Return the assignment 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 assignment
- Throws:
StemNotFoundException
InsufficientPrivilegeException
GroupNotFoundException
AttributeDefNameNotFoundException
-
getChangesCount
public int getChangesCount()count how many things were changed (attributes values etc)- Returns:
- change count
-
getAttributeAssignValues
migrate values to attribute assign values if needed- Returns:
- the attribute assign values
-
findExistingAttributeAssignment
public void findExistingAttributeAssignment()find an existing assignment that is similar this request
-