org.vrspace.server
Class AuthInfo

java.lang.Object
  extended byjava.util.Observable
      extended byorg.vrspace.server.VRObject
          extended byorg.vrspace.server.DBObject
              extended byorg.vrspace.server.PublicDBObject
                  extended byorg.vrspace.server.OwnedDBObject
                      extended byorg.vrspace.server.AuthInfo
All Implemented Interfaces:
java.lang.Cloneable, Owned

public class AuthInfo
extends OwnedDBObject

This class encapsulates authentication information:
- login name
- password
- client ID (class and it within the class)
- classpath used for commands
- objects owned by this client
NOTE:
All fields are public to enable database storage. Take care not to pass AuthInfo to any objects!
What if an object creates an AuthInfo and stores it?


Field Summary
 boolean canLogin
          Ability to login.
 java.lang.String className
          client's class name
 long id
          client's id within it's class
 java.lang.String login
          login name
 int maxSessions
          maximum number of sessions a client can open
 java.lang.String[] ownedObjects
          list of owned objects
 java.lang.String password
          password
 
Fields inherited from class org.vrspace.server.DBObject
db
 
Fields inherited from class org.vrspace.server.VRObject
db_id, primitiveMap, primitives
 
Constructor Summary
AuthInfo()
           
AuthInfo(java.lang.String login, java.lang.String password)
          creates new AuthInfo with login and password
 
Method Summary
protected  void addOwned(VRObject obj)
          Own obj
protected  boolean isOwned(VRObject obj)
          Does this user own obj?
 void loadOwned()
          Loads the owned list.
protected  void removeOwned(VRObject obj)
          Do not own obj any longer
 
Methods inherited from class org.vrspace.server.OwnedDBObject
addOwner, isOwned, notifyOwners, ownershipRequired, processEvent, removeOwner, sendEvent
 
Methods inherited from class org.vrspace.server.PublicDBObject
setValue
 
Methods inherited from class org.vrspace.server.DBObject
delete, get, put, put
 
Methods inherited from class org.vrspace.server.VRObject
arrayToString, canRead, canWrite, clone, equals, fieldToText, fromString, fromText, getClassName, getField, getFields, getId, getID, getMemebers, hasField, hasMethod, isNew, newInstance, sendResponse, setField, setField, setField, setFields, setFields, stringToArray, toString, toText, toText, toText
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

login

public java.lang.String login
login name


password

public java.lang.String password
password


className

public java.lang.String className
client's class name


id

public long id
client's id within it's class


canLogin

public boolean canLogin
Ability to login. A bot that can travel to other host must have valid Authinfo, but no client can login using this info. Strictly local bots don't need Authinfo at all. Note that a bot must have Authinfo in order to execute commands.


maxSessions

public int maxSessions
maximum number of sessions a client can open


ownedObjects

public java.lang.String[] ownedObjects
list of owned objects

Constructor Detail

AuthInfo

public AuthInfo()

AuthInfo

public AuthInfo(java.lang.String login,
                java.lang.String password)
creates new AuthInfo with login and password

Method Detail

isOwned

protected boolean isOwned(VRObject obj)
Does this user own obj?


loadOwned

public void loadOwned()
Loads the owned list. To be used, for example, if the database updates ownedObjects.


addOwned

protected void addOwned(VRObject obj)
Own obj


removeOwned

protected void removeOwned(VRObject obj)
Do not own obj any longer