The AttributePersistence interface provides a way of persisting attributes that have been
set for the Server, Rooms and Clients. Any Object can take care of AttributePersistence as
long as it implements the AttributePersistence interface.
Server and Room persistence is automatic. Client persistence
is automatic when a Client is logged in but clients must be logged in, created and removed manually. These methods must be
must be called for example by a Room or Service. When a client has logged in successfully
isLoggedIn() from the ClientServices for the Client will return true.
For an attribute to passed to the APO (Attribute Persistence Object) it must have been flagged as persistent when set. A persistent
attribute has a flag of either 2 (persistent only) or 3 (shared and persistent). An exception
is Server attributes all of which are considered to be persistent.
The APO to be used is declared in uconfig.xml under the SERVER tag as:
CLASS is the fully qualified name of the APO. This Class must be in the Classpath so Unity 2 Multiuser Server can load it.
All tags within the ATTRIBUTES tag are passed to the APO's init method and are used to customize an APO
at Runtime. The ATTRIBUTES tag is not to be confused with the Server, Room, and Client attribtues the
APO is meant to persist.
For example, here's the tag used to indicate that Unity 2 Multiuser Server should use the supplied MySQL APO.
See Javadoc for information on all methods in the AttributePersistence interface.