This project has retired. For details please refer to its Attic page.
StateManager (Apache Gora 0.2 API)

org.apache.gora.persistency
Interface StateManager

All Known Implementing Classes:
StateManagerImpl

public interface StateManager

StateManager manages objects state for persistency.


Method Summary
 void clearDirty(Persistent persistent)
          Clears the dirty state.
 void clearDirty(Persistent persistent, int fieldIndex)
          Clears the field as dirty.
 void clearNew(Persistent persistent)
          Clears the new state
 void clearReadable(Persistent persistent)
          Clears the readable state.
 void clearReadable(Persistent persistent, int fieldIndex)
          Clears the field as readable.
 boolean isDirty(Persistent persistent)
          Returns whether any of the fields of the object has been modified after construction or loading.
 boolean isDirty(Persistent persistent, int fieldIndex)
          Returns whether the field has been modified.
 boolean isNew(Persistent persistent)
          Returns whether the object is newly constructed.
 boolean isReadable(Persistent persistent, int fieldIndex)
          Returns whether the field has been loaded from the datastore.
 void setDirty(Persistent persistent)
          Sets all the fields of the object as dirty.
 void setDirty(Persistent persistent, int fieldIndex)
          Sets the field as dirty.
 void setManagedPersistent(Persistent persistent)
          If one state manager is allocated per persistent object, call this method to set the managed persistent.
 void setNew(Persistent persistent)
          Sets the state of the object as new for persistency
 void setReadable(Persistent persistent, int fieldIndex)
          Sets the field as readable.
 

Method Detail

setManagedPersistent

void setManagedPersistent(Persistent persistent)
If one state manager is allocated per persistent object, call this method to set the managed persistent.

Parameters:
persistent - the persistent to manage

isNew

boolean isNew(Persistent persistent)
Returns whether the object is newly constructed.

Returns:
true if the object is newly constructed, false if retrieved from a datastore.

setNew

void setNew(Persistent persistent)
Sets the state of the object as new for persistency


clearNew

void clearNew(Persistent persistent)
Clears the new state


isDirty

boolean isDirty(Persistent persistent)
Returns whether any of the fields of the object has been modified after construction or loading.

Returns:
whether any of the fields of the object has changed

isDirty

boolean isDirty(Persistent persistent,
                int fieldIndex)
Returns whether the field has been modified.

Parameters:
fieldIndex - the offset of the field in the object
Returns:
whether the field has been modified.

setDirty

void setDirty(Persistent persistent)
Sets all the fields of the object as dirty.


setDirty

void setDirty(Persistent persistent,
              int fieldIndex)
Sets the field as dirty.

Parameters:
fieldIndex - the offset of the field in the object

clearDirty

void clearDirty(Persistent persistent,
                int fieldIndex)
Clears the field as dirty.

Parameters:
fieldIndex - the offset of the field in the object

clearDirty

void clearDirty(Persistent persistent)
Clears the dirty state.


isReadable

boolean isReadable(Persistent persistent,
                   int fieldIndex)
Returns whether the field has been loaded from the datastore.

Parameters:
fieldIndex - the offset of the field in the object
Returns:
whether the field has been loaded

setReadable

void setReadable(Persistent persistent,
                 int fieldIndex)
Sets the field as readable.

Parameters:
fieldIndex - the offset of the field in the object

clearReadable

void clearReadable(Persistent persistent,
                   int fieldIndex)
Clears the field as readable.

Parameters:
fieldIndex - the offset of the field in the object

clearReadable

void clearReadable(Persistent persistent)
Clears the readable state.



Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.