com.threerings.whirled.server.persist
Interface SceneRepository

All Known Implementing Classes:
DummySceneRepository

public interface SceneRepository

The scene repository provides the basic interface for loading and updating scene data. It is used by the scene registry and though more scene related persistence services may be needed in a full-fledged application, the scene repository only encapsulates those needed by the scene registry and other services provided by the Whirled framework.


Method Summary
 void applyAndRecordUpdate(SceneModel model, SceneUpdate update)
          Applise the supplied scene update to persistent representation of its associated scene, then stores the update persistently for future invocations of the server to load.
 Object loadExtras(int sceneId, SceneModel model)
          Loads optional additional scene data.
 SceneModel loadSceneModel(int sceneId)
          Fetches the model for the scene with the specified scene id.
 UpdateList loadUpdates(int sceneId)
          Fetches the set of updates associated with the specified scene.
 

Method Detail

loadSceneModel

SceneModel loadSceneModel(int sceneId)
                          throws PersistenceException,
                                 NoSuchSceneException
Fetches the model for the scene with the specified scene id.

Throws:
PersistenceException - thrown if an error occurs attempting to load the scene data.
NoSuchSceneException - thrown if no scene exists with the specified scene id.

loadUpdates

UpdateList loadUpdates(int sceneId)
                       throws PersistenceException
Fetches the set of updates associated with the specified scene.

Throws:
PersistenceException - thrown if an error occurs attempting to load the scene updates.

loadExtras

Object loadExtras(int sceneId,
                  SceneModel model)
                  throws PersistenceException
Loads optional additional scene data. This data is loaded during the scene resolution process and made available to the scene manager via SceneManager.gotSceneData(java.lang.Object).

Throws:
PersistenceException

applyAndRecordUpdate

void applyAndRecordUpdate(SceneModel model,
                          SceneUpdate update)
                          throws PersistenceException
Applise the supplied scene update to persistent representation of its associated scene, then stores the update persistently for future invocations of the server to load. Note: the scene update will have already been applied to the supplied scene model.

Throws:
PersistenceException - thrown if an error occurs attempting to apply the scene update.


Copyright © 2011. All Rights Reserved.