org.vrspace.server
Class Request

java.lang.Object
  extended byorg.vrspace.util.Message
      extended byorg.vrspace.server.Request
All Implemented Interfaces:
java.lang.Cloneable

public class Request
extends Message
implements java.lang.Cloneable

This class represents a single request from the client. It extends Message to adding request logging capabilites, and also adds Client

See Also:
RequestLog

Field Summary
protected  Client client
           
 java.lang.Exception exception
           
 VRObject object
           
protected  boolean sendObject
           
protected  Session session
           
 
Fields inherited from class org.vrspace.util.Message
arguments, className, eventName, eventValue, isResponse, objectId, path, request, response, time
 
Constructor Summary
Request(Client c, java.lang.String request)
          Creates new Request as specified by request
Request(Client c, VRObject obj)
          This constructor is intended to send object over net
Request(Request r, java.lang.String request)
          This constructor uses client and session info from passed request.
 
Method Summary
 java.lang.Object clone()
           
 Client getClient()
          Returns the originating client
 VRObject getObject()
          Returns wrapped object.
 boolean isEvent()
          Returns true if this request represents an event (VRObject state change) rather than an object.
 boolean sendObject()
          Returns true if this Request contains a VRObject intended for transfer over network.
 java.lang.String toLogEntry()
          Returns request string suitable for logging
 java.lang.String toString()
          If this request contains VRObject, returns its toText(), otherwise returns Message.toString()
 
Methods inherited from class org.vrspace.util.Message
getArguments, getClassName, getEventName, getEventValue, getId, getID, getPath, getRequest, getResponse, getTime, isResponse, parseLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

client

protected Client client

session

protected Session session

sendObject

protected boolean sendObject

exception

public java.lang.Exception exception

object

public VRObject object
Constructor Detail

Request

public Request(Client c,
               java.lang.String request)
Creates new Request as specified by request


Request

public Request(Request r,
               java.lang.String request)
This constructor uses client and session info from passed request. Intended for usage in commands that need to provide feedback over a specific session.


Request

public Request(Client c,
               VRObject obj)
This constructor is intended to send object over net

Method Detail

getClient

public Client getClient()
Returns the originating client


toLogEntry

public java.lang.String toLogEntry()
Returns request string suitable for logging


toString

public java.lang.String toString()
If this request contains VRObject, returns its toText(), otherwise returns Message.toString()

Overrides:
toString in class Message

sendObject

public boolean sendObject()
Returns true if this Request contains a VRObject intended for transfer over network. Set by Client.addObject().


isEvent

public boolean isEvent()
Returns true if this request represents an event (VRObject state change) rather than an object. For now, = !sendObject()


getObject

public VRObject getObject()
Returns wrapped object. May return null before Dispatcher processes request, thus unsafe to use in Client extensions


clone

public java.lang.Object clone()