Class AttributeDefNameSave
java.lang.Object
edu.internet2.middleware.grouper.attr.AttributeDefNameSave
Use this class to insert or update an attribute def name
Sample call
AttributeDefNameSave attributeDefNameSave = new AttributeDefNameSave(grouperSession, attributeDef) .assignName("top:b").assignDescription("whatever").assignDisplayExtension("theB"); AttributeDefName attributeDefName = attributeDefNameSave.save(); System.out.println(attributeDefNameSave.getSaveResultType()); // INSERT, NO_CHANGE, or UPDATE
Sample call to update only one attribute
new AttributeDefNameSave(grouperSession, attributeDef) .assignName("top:b").assignDisplayExtension("theB").assignReplaceAllSettings(false).save();
-
Constructor Summary
ConstructorDescriptionAttributeDefNameSave
(AttributeDef theAttributeDef) create a new attribute def name saveAttributeDefNameSave
(GrouperSession theGrouperSession, AttributeDef theAttributeDef) create a new attribute def name save -
Method Summary
Modifier and TypeMethodDescriptionassignAttributeDefNameNameToEdit
(String theAttributeDefNameNameToEdit) attributeDefName name to editassignCreateParentStemsIfNotExist
(boolean theCreateParentStemsIfNotExist) assign create parents if not existassignDescription
(String theDescription) assign descriptionassignDisplayExtension
(String theDisplayExtension) display extensionassignDisplayName
(String theDisplayName) assignIdIndex
(Long theIdIndex) assign id_indexassignName
(String name1) nameassignReplaceAllSettings
(boolean theReplaceAllSettings) replace all existing settings.assignSaveMode
(SaveMode theSaveMode) assign save modeassignUuid
(String theId) idgetName()
get the save typesave()
create or update a attributeDefName.
-
Constructor Details
-
AttributeDefNameSave
create a new attribute def name save- Parameters:
theGrouperSession
-theAttributeDef
-
-
AttributeDefNameSave
create a new attribute def name save- Parameters:
theGrouperSession
-theAttributeDef
-
-
-
Method Details
-
getAttributeDefNameNameToEdit
-
getName
-
assignIdIndex
assign id_index- Parameters:
theIdIndex
-- Returns:
- this for chaining
-
assignAttributeDefNameNameToEdit
attributeDefName name to edit- Parameters:
theAttributeDefNameNameToEdit
-- Returns:
- the attributeDefName name to edit
-
assignUuid
id- Parameters:
theId
-- Returns:
- uuid
-
assignDisplayName
- Parameters:
theDisplayName
-- Returns:
- this for chaining
-
assignName
name- Parameters:
name1
-- Returns:
- name
-
assignDisplayExtension
display extension- Parameters:
theDisplayExtension
-- Returns:
- this for chaining
-
assignDescription
assign description- Parameters:
theDescription
-- Returns:
- this for chaining
-
assignSaveMode
assign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
assignCreateParentStemsIfNotExist
public AttributeDefNameSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist) assign create parents if not exist- Parameters:
theCreateParentStemsIfNotExist
-- Returns:
- this for chaining
-
getSaveResultType
get the save type- Returns:
- save type
-
assignReplaceAllSettings
replace all existing settings. defaults to true.- Returns:
- this for chaining
-
save
public AttributeDefName save() throws StemNotFoundException, InsufficientPrivilegeException, StemAddExceptioncreate or update a attributeDefName. Note this will not rename an attributeDefName at this time (might in future) This is a static method since setters to AttributeDefName objects persist to the DB Steps: 1. Find the attributeDefName by attributeDefNameNameToEdit 2. Internally set all the fields of the attributeDefName (no need to reset if already the same) 3. Store the attributeDefName (insert or update) if needed 4. Return the attributeDefName 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 attributeDefName
- Throws:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
-