Class Status
- java.lang.Object
 - 
- org.apache.jackrabbit.jcr2spi.state.Status
 
 
- 
public final class Status extends Object
Status... 
- 
- 
Field Summary
Fields Modifier and Type Field Description static int_UNDEFINED_static intEXISTING'existing', i.e.static intEXISTING_MODIFIED'existing', i.e.static intEXISTING_REMOVED'existing', i.e.static intINVALIDATEDA state once read from persistent storage has been set to invalid.static intMODIFIEDTemporary status used to mark a state, this is permanently modified either by saving transient changes, by workspace operations or by external modification.static intNEW'new' statestatic intREMOVEDa new state was removed and is now 'removed' or an existing item has been removed by a workspace operation or by an external modification.static intSTALE_DESTROYED'existing', i.e.static intSTALE_MODIFIED'existing', i.e. 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetName(int status)static intgetNewStatus(int oldStatus, int newStatusHint)Returns the givennewStatusHintunless the new status collides with a pending modification or removal which results in a stale item state.static booleanisStale(int status)static booleanisTerminal(int status)Returnstrueif the given status is a terminal status, i.e.static booleanisTransient(int status)static booleanisValid(int status)Returnstrueif this item state is valid, that is its status is one of:EXISTINGEXISTING_MODIFIEDNEWstatic booleanisValidStatusChange(int oldStatus, int newStatus)Returns true, if the status of an item state can be changed fromoldStatustonewStatus, and false if the change is illegal or if any of the given status flags is illegal. 
 - 
 
- 
- 
Field Detail
- 
_UNDEFINED_
public static final int _UNDEFINED_
- See Also:
 - Constant Field Values
 
 
- 
INVALIDATED
public static final int INVALIDATED
A state once read from persistent storage has been set to invalid. This means that the state needs to be re-fetched from persistent storage when accessed the next time.- See Also:
 - Constant Field Values
 
 
- 
EXISTING
public static final int EXISTING
'existing', i.e. persistent state- See Also:
 - Constant Field Values
 
 
- 
EXISTING_MODIFIED
public static final int EXISTING_MODIFIED
'existing', i.e. persistent state that has been transiently modified (copy-on-write)- See Also:
 - Constant Field Values
 
 
- 
EXISTING_REMOVED
public static final int EXISTING_REMOVED
'existing', i.e. persistent state that has been transiently removed (copy-on-write)- See Also:
 - Constant Field Values
 
 
- 
NEW
public static final int NEW
'new' state- See Also:
 - Constant Field Values
 
 
- 
STALE_MODIFIED
public static final int STALE_MODIFIED
'existing', i.e. persistent state that has been persistently modified by somebody else- See Also:
 - Constant Field Values
 
 
- 
STALE_DESTROYED
public static final int STALE_DESTROYED
'existing', i.e. persistent state that has been destroyed by somebody else- See Also:
 - Constant Field Values
 
 
- 
MODIFIED
public static final int MODIFIED
Temporary status used to mark a state, this is permanently modified either by saving transient changes, by workspace operations or by external modification.- See Also:
 - Constant Field Values
 
 
- 
REMOVED
public static final int REMOVED
a new state was removed and is now 'removed' or an existing item has been removed by a workspace operation or by an external modification.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
isTerminal
public static boolean isTerminal(int status)
Returnstrueif the given status is a terminal status, i.e. the given status one of:- Parameters:
 status-- Returns:
 - true if the given status is terminal.
 
 
- 
isValid
public static boolean isValid(int status)
Returnstrueif this item state is valid, that is its status is one of:- Parameters:
 status-- Returns:
 - true if the given status indicates a valid ItemState.
 
 
- 
isStale
public static boolean isStale(int status)
- Parameters:
 status- the status to check.- Returns:
 trueifstatusindicates that an item state is stale.
 
- 
isTransient
public static boolean isTransient(int status)
- Parameters:
 status- the status to check.- Returns:
 trueifstatusindicates that an item state is transiently modified.
 
- 
isValidStatusChange
public static boolean isValidStatusChange(int oldStatus, int newStatus)Returns true, if the status of an item state can be changed fromoldStatustonewStatus, and false if the change is illegal or if any of the given status flags is illegal.- Parameters:
 oldStatus-newStatus-- Returns:
 - true if a status change from 
oldStatustonewStatusis allowed or if the two status are the same. 
 
- 
getNewStatus
public static int getNewStatus(int oldStatus, int newStatusHint)Returns the givennewStatusHintunless the new status collides with a pending modification or removal which results in a stale item state.- Parameters:
 oldStatus-newStatusHint-- Returns:
 - new status that takes transient modification/removal into account.
 
 
- 
getName
public static String getName(int status)
- Parameters:
 status- A valid status constant.- Returns:
 - Human readable status name for the given int.
 
 
 - 
 
 -