Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.vrspace.server
Class AuthInfo  view AuthInfo download AuthInfo.java

java.lang.Object
  extended byjava.util.Observable
      extended byorg.vrspace.server.VRObject
          extended byorg.vrspace.server.DBObject
              extended byorg.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?


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
(package private)  java.util.HashSet owned
           
 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, isNew, primitiveMap, primitives
 
Fields inherited from class java.util.Observable
 
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?
protected  void removeOwned(VRObject obj)
          Do not own obj any longer
 
Methods inherited from class org.vrspace.server.DBObject
delete, get, put, put, sendEvent
 
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
 
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


owned

java.util.HashSet owned
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?


addOwned

protected void addOwned(VRObject obj)
Own obj


removeOwned

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