java.lang.Object
java.util.Observable
org.vrspace.server.VRObject
org.vrspace.server.DBObject
org.vrspace.server.AuthInfo
- All Implemented Interfaces:
- java.lang.Cloneable
- public class AuthInfo
- extends DBObject
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?
| Fields inherited from class org.vrspace.server.DBObject |
db |
| 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, lock, lockClass, newInstance, sendResponse, setField, setField, setField, setFields, setFields, setValue, stringToArray, toString, toText, toText, toText, unlock, unlockClass |
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
owned
java.util.HashSet owned
AuthInfo
public AuthInfo()
AuthInfo
public AuthInfo(java.lang.String login,
java.lang.String password)
- creates new AuthInfo with login and password
isOwned
protected boolean isOwned(VRObject obj)
- Does this user own obj?
addOwned
protected void addOwned(VRObject obj)
- Own obj
removeOwned
protected void removeOwned(VRObject obj)
- Do not own obj any longer