Class AttributeDefSave
java.lang.Object
edu.internet2.middleware.grouper.attr.AttributeDefSave
Use this class to insert or update an attribute definition
Sample call
AttributeDefSave attributeDefSave = new AttributeDefSave(grouperSession) .assignName("top:b").assignDescription("whatever").assignValueType(AttributeDefValueType.string).assignMultiValued(true); AttributeDef attributeDef = attributeDefSave.save(); System.out.println(attributeDefSave.getSaveResultType()); // INSERT, NO_CHANGE, or UPDATE
Sample call to update only one attribute
new AttributeDefSave(grouperSession) .assignName("top:b").assignMultiValued(true).assignReplaceAllSettings(false).save();
-
Constructor Summary
ConstructorDescriptioncreate a new attribute def saveAttributeDefSave
(GrouperSession theGrouperSession) create a new attribute def save -
Method Summary
Modifier and TypeMethodDescriptionassignAttributeDefNameToEdit
(String theAttributeDefNameToEdit) attributeDef name to editassignAttributeDefPublic
(boolean theBoolean) if assignassignAttributeDefType
(AttributeDefType theAttributeDefType) if assignassignCreateParentStemsIfNotExist
(boolean theCreateParentStemsIfNotExist) assign create parents if not existassignDescription
(String theDescription) assign descriptionuuidassignIdIndex
(Long theIdIndex) assign id_indexassignMultiAssignable
(boolean theBoolean) if assignassignMultiValued
(boolean theBoolean) if assignassignName
(String name1) nameassignPrivAllAdmin
(boolean thePrivAllAdmin) assign priv admin to be different than the defaults for grouperAllassignPrivAllAttrRead
(boolean thePrivAllAttrRead) assign priv attr read to be different than the defaults for grouperAllassignPrivAllAttrUpdate
(boolean thePrivAllAttrUpdate) assign priv attr update to be different than the defaults for grouperAllassignPrivAllOptin
(boolean thePrivAllOptin) assign priv optin to be different than the defaults for grouperAllassignPrivAllOptout
(boolean thePrivAllOptout) assign priv optout to be different than the defaults for grouperAllassignPrivAllRead
(boolean thePrivAllRead) assign priv read to be different than the defaults for grouperAllassignPrivAllUpdate
(boolean thePrivAllUpdate) assign priv update to be different than the defaults for grouperAllassignPrivAllView
(boolean thePrivAllView) assign priv view to be different than the defaults for grouperAllassignReplaceAllSettings
(boolean theReplaceAllSettings) replace all existing settings.assignSaveMode
(SaveMode theSaveMode) assign save modeassignToAttributeDef
(boolean theBoolean) if assignassignToAttributeDefAssn
(boolean theBoolean) if assignassignToEffMembership
(boolean theBoolean) if assignassignToEffMembershipAssn
(boolean theBoolean) if assignassignToGroup
(boolean theBoolean) if assignassignToGroupAssn
(boolean theBoolean) if assignassignToImmMembership
(boolean theBoolean) if assignassignToImmMembershipAssn
(boolean theBoolean) if assignassignToMember
(boolean theBoolean) if assignassignToMemberAssn
(boolean theBoolean) if assignassignToStem
(boolean theBoolean) if assignassignToStemAssn
(boolean theBoolean) if assignassignValueType
(AttributeDefValueType attributeDefValueType) if assigngetName()
get the save typesave()
create or update an attribute def.
-
Constructor Details
-
AttributeDefSave
create a new attribute def save- Parameters:
theGrouperSession
-
-
AttributeDefSave
public AttributeDefSave()create a new attribute def save- Parameters:
theGrouperSession
-
-
-
Method Details
-
getAttributeDefNameToEdit
-
getName
-
assignIdIndex
assign id_index- Parameters:
theIdIndex
-- Returns:
- this for chaining
-
assignAttributeDefNameToEdit
attributeDef name to edit- Parameters:
theAttributeDefNameToEdit
-- Returns:
- the attributeDef name to edit
-
assignId
uuid- Parameters:
theUuid
-- Returns:
- uuid
-
assignName
name- Parameters:
name1
-- Returns:
- name
-
assignDescription
assign description- Parameters:
theDescription
-- Returns:
- this for chaining
-
assignSaveMode
assign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
assignCreateParentStemsIfNotExist
assign create parents if not exist- Parameters:
theCreateParentStemsIfNotExist
-- Returns:
- this for chaining
-
assignToAttributeDef
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToAttributeDefAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToEffMembership
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToEffMembershipAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToGroup
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToGroupAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToImmMembership
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToImmMembershipAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToMember
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToMemberAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToStem
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignToStemAssn
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignAttributeDefPublic
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignAttributeDefType
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignMultiAssignable
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
assignMultiValued
if assign- Parameters:
theBoolean
-- Returns:
- self for chaining
-
assignReplaceAllSettings
replace all existing settings. defaults to true.- Returns:
- this for chaining
-
assignValueType
if assign- Parameters:
theBoolean
-- Returns:
- this for chaining
-
getSaveResultType
get the save type- Returns:
- save type
-
save
public AttributeDef save() throws StemNotFoundException, InsufficientPrivilegeException, StemAddExceptioncreate or update an attribute def. Note this will not rename an attribute def at this time (might in future) Steps: 1. Find the attributeDef by attributeDefNameToEdit 2. Internally set all the fields of the attributeDef (no need to reset if already the same) 3. Store the attributeDef (insert or update) if needed 4. Return the attributeDef 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 attributeDef
- Throws:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
-
assignPrivAllAdmin
assign priv admin to be different than the defaults for grouperAll- Parameters:
thePrivAllAdmin
-- Returns:
- this for chaining
-
assignPrivAllAttrRead
assign priv attr read to be different than the defaults for grouperAll- Parameters:
thePrivAllAttrRead
-- Returns:
- this for chaining
-
assignPrivAllAttrUpdate
assign priv attr update to be different than the defaults for grouperAll- Parameters:
thePrivAllAttrUpdate
-- Returns:
- this for chaining
-
assignPrivAllOptin
assign priv optin to be different than the defaults for grouperAll- Parameters:
thePrivAllOptin
-- Returns:
- this for chaining
-
assignPrivAllOptout
assign priv optout to be different than the defaults for grouperAll- Parameters:
thePrivAllOptout
-- Returns:
- this for chaining
-
assignPrivAllRead
assign priv read to be different than the defaults for grouperAll- Parameters:
thePrivAllRead
-- Returns:
- this for chaining
-
assignPrivAllUpdate
assign priv update to be different than the defaults for grouperAll- Parameters:
thePrivAllUpdate
-- Returns:
- this for chaining
-
assignPrivAllView
assign priv view to be different than the defaults for grouperAll- Parameters:
thePrivAllView
-- Returns:
- this for chaining
-