org.moock.unity.core
Interface AttributePersistence


public interface AttributePersistence

AttributePersistence

Author:
Derek Clayton

Method Summary
 void changePersistentClient(ClientServices client, java.util.ArrayList args)
          Change a client int the database.
 void cleanup()
          Called when the server is shutting down.
 void createPersistentClient(ClientServices client, java.util.ArrayList args)
          Create a client in the database.
 boolean init(java.util.HashMap attributes)
          Init the Attribute Persistence object.
 void loadRoom(RoomServices roomServices)
          Load the Attributes for a room with ID roomID when the Room is spawned.
 void loadServer(ServerServices serverServices)
          Load the server Attributes
 void loginClient(ClientServices client, java.util.ArrayList args)
          Load the Attributes for the Client when loginClient is called by a Room.
 void removePersistentClient(ClientServices client, java.util.ArrayList args)
          Remove a client from the database.
 void storeClient(ClientServices client, java.util.HashMap map)
          Store the Attributes of the Client when the Client disconnects.
 void storeRoom(java.lang.String roomID, org.moock.unity.core.AttributeList list)
          Store the Attributes for a room with ID roomID when the Room is shutdown.
 void storeServer(org.moock.unity.core.AttributeList list)
          Store the server Attributes when the server is shutdown.
 

Method Detail

init

public boolean init(java.util.HashMap attributes)
             throws org.moock.unity.core.exception.AttributePersistenceException
Init the Attribute Persistence object.
Parameters:
settings - the ATTRIBUTES specified in the config file.

loadServer

public void loadServer(ServerServices serverServices)
                throws org.moock.unity.core.exception.AttributePersistenceException
Load the server Attributes
Parameters:
ServerServices - to load the Attributes

storeServer

public void storeServer(org.moock.unity.core.AttributeList list)
                 throws org.moock.unity.core.exception.AttributePersistenceException
Store the server Attributes when the server is shutdown.

loadRoom

public void loadRoom(RoomServices roomServices)
              throws org.moock.unity.core.exception.AttributePersistenceException
Load the Attributes for a room with ID roomID when the Room is spawned. Not called for Rooms with server generated ID's.

storeRoom

public void storeRoom(java.lang.String roomID,
                      org.moock.unity.core.AttributeList list)
               throws org.moock.unity.core.exception.AttributePersistenceException
Store the Attributes for a room with ID roomID when the Room is shutdown. Not called for Rooms with server generated ID's.

createPersistentClient

public void createPersistentClient(ClientServices client,
                                   java.util.ArrayList args)
                            throws org.moock.unity.core.exception.PersistentClientAlreadyExistsException,
                                   org.moock.unity.core.exception.AttributePersistenceException
Create a client in the database. ClientServices is null if for an offline client.

removePersistentClient

public void removePersistentClient(ClientServices client,
                                   java.util.ArrayList args)
                            throws org.moock.unity.core.exception.PersistentClientNotFoundException,
                                   org.moock.unity.core.exception.AttributePersistenceException
Remove a client from the database. ClientServices is null if for an offline client.

changePersistentClient

public void changePersistentClient(ClientServices client,
                                   java.util.ArrayList args)
                            throws org.moock.unity.core.exception.PersistentClientNotFoundException,
                                   org.moock.unity.core.exception.AuthenticationFailedException,
                                   org.moock.unity.core.exception.AttributePersistenceException
Change a client int the database. ClientServices is null if for an offline client.

loginClient

public void loginClient(ClientServices client,
                        java.util.ArrayList args)
                 throws org.moock.unity.core.exception.PersistentClientNotFoundException,
                        org.moock.unity.core.exception.AuthenticationFailedException,
                        org.moock.unity.core.exception.AttributePersistenceException
Load the Attributes for the Client when loginClient is called by a Room.
Parameters:
ClientServices - used to load the attributes.
args - passed by the Room to identify the Client.

storeClient

public void storeClient(ClientServices client,
                        java.util.HashMap map)
                 throws org.moock.unity.core.exception.AttributePersistenceException
Store the Attributes of the Client when the Client disconnects. map keys are the RoomID's for scope (null if Global) and the values are AttributeList's for that scope. This method will only be callled if the client has been set as logged in.

cleanup

public void cleanup()
             throws org.moock.unity.core.exception.AttributePersistenceException
Called when the server is shutting down. Perform any cleanup on this Object here.