edu.internet2.middleware.grouper
Class StemSave

java.lang.Object
  extended by edu.internet2.middleware.grouper.StemSave

public class StemSave
extends Object

Use this class to insert or update a stem


Constructor Summary
StemSave(GrouperSession theGrouperSession)
          create a new stem save
 
Method Summary
 StemSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
          assign create parents if not exist
 StemSave assignDescription(String theDescription)
          assign description
 StemSave assignDisplayExtension(String theDisplayExtension)
          display extension
 StemSave assignDisplayName(String theDisplayName)
           
 StemSave assignIdIndex(Long theIdIndex)
          assign id_index
 StemSave assignName(String name1)
          name
 StemSave assignSaveMode(SaveMode theSaveMode)
          asssign save mode
 StemSave assignStemNameToEdit(String theStemNameToEdit)
          stem name to edit
 StemSave assignUuid(String theUuid)
          uuid
 SaveResultType getSaveResultType()
          get the save type
 Stem save()
           create or update a stem.
 Stem saveUnchecked()
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StemSave

public StemSave(GrouperSession theGrouperSession)
create a new stem save

Parameters:
theGrouperSession -
Method Detail

assignIdIndex

public StemSave assignIdIndex(Long theIdIndex)
assign id_index

Parameters:
theIdIndex -
Returns:
this for chaining

assignStemNameToEdit

public StemSave assignStemNameToEdit(String theStemNameToEdit)
stem name to edit

Parameters:
theStemNameToEdit -
Returns:
the stem name to edit

assignUuid

public StemSave assignUuid(String theUuid)
uuid

Parameters:
theUuid -
Returns:
uuid

assignName

public StemSave assignName(String name1)
name

Parameters:
name1 -
Returns:
name

assignDisplayExtension

public StemSave assignDisplayExtension(String theDisplayExtension)
display extension

Parameters:
theDisplayExtension -
Returns:
this for chaining

assignDescription

public StemSave assignDescription(String theDescription)
assign description

Parameters:
theDescription -
Returns:
this for chaining

assignSaveMode

public StemSave assignSaveMode(SaveMode theSaveMode)
asssign save mode

Parameters:
theSaveMode -
Returns:
this for chaining

assignCreateParentStemsIfNotExist

public StemSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
assign create parents if not exist

Parameters:
theCreateParentStemsIfNotExist -
Returns:
this for chaining

getSaveResultType

public SaveResultType getSaveResultType()
get the save type

Returns:
save type

saveUnchecked

@Deprecated
public Stem saveUnchecked()
Deprecated. 

 create or update a stem.  Note this will not move a stem at this time (might in future)
 
 This is a static method since setters to Stem objects persist to the DB
 
 Steps:
 
 1. Find the stem by stemNameToEdit (if not there then its an insert)
 2. Internally set all the fields of the stem (no need to reset if already the same)
 3. Store the stem (insert or update) if needed
 4. Return the stem object
 
 This occurs in a transaction, so if a part of it fails, it rolls back, and potentially
 rolls back outer transactions too
 

Returns:
the stem saved

save

public Stem save()
          throws StemNotFoundException,
                 InsufficientPrivilegeException,
                 StemAddException,
                 StemModifyException
 create or update a stem.  Note this will not move a stem at this time (might in future)
 
 This is a static method since setters to Stem objects persist to the DB
 
 Steps:
 
 1. Find the stem by stemNameToEdit (if not there then its an insert)
 2. Internally set all the fields of the stem (no need to reset if already the same)
 3. Store the stem (insert or update) if needed
 4. Return the stem object
 
 This occurs in a transaction, so if a part of it fails, it rolls back, and potentially
 rolls back outer transactions too
 

Returns:
the stem that was updated or created
Throws:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
StemModifyException

assignDisplayName

public StemSave assignDisplayName(String theDisplayName)
Parameters:
theDisplayName -
Returns:
this for chaining