Interface IRoomStorage


public interface IRoomStorage
Basic interface for Room Storage implementations.

The Room Persistence API provide a way of storing Rooms and their relative states (Room Variables) to disk or database. The API can be accessed via Extensions from the Zone object, using Zone.getRoomPersistenceApi()

Example:


 // Init method of a Zone Extension 
 public void init()
 {
 	//Initialize Persistence API
 	getParentZone().initRoomPersistence(RoomStorageMode.FILE_STORAGE, new FileRoomStorageConfig());
 
 	// Load all previously stored Rooms
  try
  {
 		getParentZone().getRoomPersistenceApi().loadAllRooms();
 	}
  catch (SFSStorageException error)
  {
  	trace("Error loading rooms: " + error);
  }
 }
 
See Also:
  • DBRoomStorage
  • FileRoomStorage
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked by the system when the Storage class is being removed The method is your last chance to release open resources such as local files, database connections etc...
    void
    Invoked once, after the class is instantiated: it provides the reference to the current Zone and the custom configurator
    Load all stored Rooms for this Zone
    Load all Rooms belonging to a specific Room Group
    Loads the setting of a previously saved Room
    void
    Remove all stored Rooms for this Zone from the storage system (Use wisely!)
    void
    Remove all stored Rooms belonging to a specific Room Group
    void
    Remove a saved Room from the storage system
    void
    Saves all Rooms in the Zone
    void
    Saves all Rooms belonging to the provided group name
    void
    saveRoom(Room theRoom)
    Save a Room and its state