com.planet_ink.coffee_mud.core.intermud.i3.persist
Interface PersistentPeer

All Known Implementing Classes:
IMudPeer

public interface PersistentPeer

Any object which should persist over time should have a PersistentPeer which handles saving it. This allows a separate object to worry about persistence issues, specifically whether the object should save to a flatfile or database, and how that saving occurs.


Method Summary
 boolean isRestoring()
          An implementation uses this to tell its Persistent that it is in the middle of restoring.
 void restore()
          Gets data about this peer from storage and gives it back to the object for which this peer exists.
 void save()
          Triggers a save of its peer.
 void setPersistent(Persistent ob)
          Assigns a persistent object to this peer for persistence operations.
 

Method Detail

restore

void restore()
             throws PersistenceException
Gets data about this peer from storage and gives it back to the object for which this peer exists.

Throws:
PersistenceException - if an error occurs during restore

save

void save()
          throws PersistenceException
Triggers a save of its peer. Implementing classes should do whatever it takes to save the object in this method.

Throws:
PersistenceException - if a problem occurs in saving

setPersistent

void setPersistent(Persistent ob)
Assigns a persistent object to this peer for persistence operations.

Parameters:
ob - the implementation of com.planet_ink.coffee_mud.core.intermud.i3.persist.Persistent that this is a peer for
See Also:
Persistent

isRestoring

boolean isRestoring()
An implementation uses this to tell its Persistent that it is in the middle of restoring.

Returns:
true if a restore operation is in progress