org.sandev.basics.DataManager
Interface Persister

All Superinterfaces:
IDLookup

public interface Persister
extends IDLookup

The Persister interface defines methods and constants used for storage and retrieval of persistent message information. A Persister interface must be transactionally safe, and must reject any update requests that are not working with the latest data.

Responsibilities of the Persister include:

  1. Verifying that application data storage is available.
  2. Initializing application data storage as necessary to make it available for use. Incompatible structure definitions are passed through to a Converter for structural update processing.
  3. Verifying that initial data required by the application exists.
  4. Accepting update messages and writing them to persistent storage. This includes
  5. Responding to ad-hoc queries. This includes translating match expressions and queries across superclasses. It is NOT necessary to support queries across interfaces (such as SandMessage). When processing a query, recordStatus != DELETED is assumed, unless recordStatus is specified in the query.
  6. Functioning in an efficient fashion, including appropriate data caching.

Persistence is a critical system function, so any exception thrown by a Persister will likely result in a node shutdown, or a systemwide shutdown. See Persist.html for overview information.


Field Summary
static int TEMPIDTHRESHOLD
          When adding several new instances at once through an AggregateUpdate, it may be necessary to use temporary IDs to describe the references between object instances.
 
Method Summary
 void init(DataManagerNode node)
          Perform whatever steps are necessary at startup.
 SandMessage processMessage(SandMessage msg)
          Process the specified message appropriately, returning the result.
 
Methods inherited from interface org.sandev.basics.util.IDLookup
getInstance
 

Field Detail

TEMPIDTHRESHOLD

static final int TEMPIDTHRESHOLD
When adding several new instances at once through an AggregateUpdate, it may be necessary to use temporary IDs to describe the references between object instances. Any IDs below this value are considered temporary and will be remapped as needed by the Persister during processing.

See Also:
Constant Field Values
Method Detail

init

void init(DataManagerNode node)
          throws PersisterException
Perform whatever steps are necessary at startup. The back reference to the DataManager is provided for access to the node data and facilities.

Throws:
PersisterException

processMessage

SandMessage processMessage(SandMessage msg)
                           throws PersisterException
Process the specified message appropriately, returning the result. If a Persister is given a message it does not deal with, then it should throw an exception. The message may be an update or a query, these are lumped together to allow for implementations full access for optimization.

Throws:
PersisterException