|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.vrspace.server.VRObject
org.vrspace.server.DBObject
org.vrspace.server.PublicDBObject
org.vrspace.server.OwnedDBObject
org.vrspace.server.Client
Generic Client class. Tracks visible objects, but forwards events to Dispatcher even if client sends events to invisible VRObjects.
Field Summary | |
long |
_lastLogin
|
protected AuthInfo |
authInfo
|
protected Dispatcher |
dispatcher
|
java.lang.String |
name
client name (login) |
protected boolean |
online
|
protected Transform |
pos
|
protected Scene |
scene
|
protected Session |
session
|
protected int |
sessions
|
long |
transform
|
Fields inherited from class org.vrspace.server.DBObject |
db |
Fields inherited from class org.vrspace.server.VRObject |
db_id, primitiveMap, primitives |
Constructor Summary | |
Client()
|
|
Client(Dispatcher d,
AuthInfo a)
Construct a new client. |
Method Summary | |
void |
addObject(VRObject obj)
Add an object to the scene. |
void |
addObserver(java.util.Observer o)
Called when another client observes this one instead of Observable.addObserver() |
void |
addOwned(Owned o)
Interface Owner - own o |
void |
deleteObserver(java.util.Observer o)
called when this another client stops observing this, overrides Observable.deleteObserver() |
protected void |
destroy()
Clean up. |
java.lang.ClassLoader |
getClassLoader()
Returns ClassLoader of this thread |
Dispatcher |
getDispatcher()
Returns Dispatcher |
protected ObjectFilter |
getFilter(Request r,
java.lang.String filter)
|
java.lang.String |
getName()
Get client name |
Transform |
getPos()
This returns client's Transform. |
ObservableProperties |
getProperties()
Convenicence method |
java.lang.String |
getProperty(java.lang.String key)
Convenicence method |
Scene |
getScene()
Returns this client's scene |
Session |
getSession()
this shouldn't be public... |
Transform |
getTransform()
|
long |
getTransformID()
|
protected void |
init()
This is called by the dispatcher after login. |
void |
invalidRequest(Request r)
Called from Dispatcher if request() sent an invalid request |
boolean |
isOnline()
Is client on-line? |
boolean |
isOwner(Owned o)
Interface Owner - owns o? |
boolean |
owns(VRObject o)
Convenience method. |
void |
quit()
Logout. |
void |
removeAll()
Removes all objects from the scene |
void |
removeObject(VRObject obj)
Remove object obj from the scene |
void |
removeOwned(Owned o)
Interface Owner - do not own o |
void |
request(Request r)
A new client request. |
void |
sendResponse(Request r,
java.lang.String response)
Sends the response back to the client TODO: Include more information to the response (originating request id) |
void |
set__password(Request r,
java.lang.String passwd)
Changes password |
void |
set__sceneRange(Request r,
java.lang.String range)
Set Scene range |
void |
set__sceneSize(Request r,
java.lang.String size)
Set Scene size |
void |
set_addFilter(Request r,
java.lang.String filter)
adds class filter usage: my addFilter org.vrspace.server.filter.ClassFilter VrmlFile removes all VrmlFile instances from the scene. Default package name for filters is org.vrspace.server.filter Tries to call constructor with following parameters: - String - Request - none (Class.newInstance) |
void |
set_removeFilter(Request r,
java.lang.String filter)
removes filter |
void |
setProperty(java.lang.String name,
java.lang.String value)
Convenicence method |
void |
setTransform(Transform t)
|
protected void |
setValue(Request r)
This method forwards events to other intances on the net Request is already processed, validated etc. |
void |
update(java.util.Observable o,
java.lang.Object req)
Method update is called from VRObject class notifyObservers() Notifies the client an object in the scene has changed NOTE: o may be null. |
void |
updateAuthInfo(Client c)
Updates AuthInfo. |
void |
updateAuthInfo(Dispatcher dispatcher,
Client client)
A hack until objects are given a reference to their dispatcher on startup. |
void |
updateOwnership(Owned o,
java.lang.Object obj)
Called when : - this client receives an object, scene updates - another ownership change occur |
void |
updateScene()
update the scene |
void |
updateScene(boolean forceUpdate)
update the scene |
void |
updateScene(double x,
double y,
double z,
boolean forceUpdate)
Update the scene with those coordinates, should be called with scene changes |
Methods inherited from class org.vrspace.server.OwnedDBObject |
addOwner, isOwned, notifyOwners, ownershipRequired, processEvent, removeOwner, sendEvent |
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 |
clearChanged, countObservers, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Dispatcher dispatcher
protected AuthInfo authInfo
protected Session session
protected Scene scene
public long transform
public long _lastLogin
protected int sessions
public java.lang.String name
protected Transform pos
protected boolean online
Constructor Detail |
public Client()
public Client(Dispatcher d, AuthInfo a)
Method Detail |
public java.lang.String getName()
public Dispatcher getDispatcher()
public void addObserver(java.util.Observer o)
public void deleteObserver(java.util.Observer o)
public void update(java.util.Observable o, java.lang.Object req)
update
in interface java.util.Observer
public void sendResponse(Request r, java.lang.String response)
public void quit()
public void request(Request r)
public void invalidRequest(Request r)
public void addObject(VRObject obj) throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
public void removeObject(VRObject obj) throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
public void removeAll()
protected void destroy()
protected void init()
public void updateScene() throws VRObjectException
VRObjectException
public void updateScene(boolean forceUpdate) throws VRObjectException
VRObjectException
public void updateScene(double x, double y, double z, boolean forceUpdate) throws VRObjectException
VRObjectException
protected void setValue(Request r)
setValue
in class PublicDBObject
public void addOwned(Owned o)
addOwned
in interface Owner
public void removeOwned(Owned o)
removeOwned
in interface Owner
public boolean isOwner(Owned o)
isOwner
in interface Owner
public boolean owns(VRObject o)
public void updateOwnership(Owned o, java.lang.Object obj)
updateOwnership
in interface Owner
public boolean isOnline()
public Transform getPos()
public void set_addFilter(Request r, java.lang.String filter) throws java.lang.Exception
java.lang.Exception
Scene
,
ClassFilter
protected ObjectFilter getFilter(Request r, java.lang.String filter) throws java.lang.Exception
java.lang.Exception
public void set_removeFilter(Request r, java.lang.String filter) throws java.lang.Exception
java.lang.Exception
Scene
,
#addFilter
public Scene getScene()
public void updateAuthInfo(Client c) throws java.lang.Exception
java.lang.Exception
public void updateAuthInfo(Dispatcher dispatcher, Client client) throws java.lang.Exception
java.lang.Exception
public void set__password(Request r, java.lang.String passwd)
public ObservableProperties getProperties()
Server
public java.lang.String getProperty(java.lang.String key)
Server
public void setProperty(java.lang.String name, java.lang.String value)
Server
public java.lang.ClassLoader getClassLoader()
public void set__sceneSize(Request r, java.lang.String size)
Scene
public void set__sceneRange(Request r, java.lang.String range)
Secene
public Session getSession()
public Transform getTransform()
getTransform
in interface HasTransform
public void setTransform(Transform t)
setTransform
in interface HasTransform
public long getTransformID()
getTransformID
in interface HasTransform
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |