NetKernel APIs


com.ten60.netkernel.urrequest
Class URRequest

java.lang.Object
  extended bycom.ten60.netkernel.urrequest.URRequest

public final class URRequest
extends Object

A request made by a requestor to a requestee


Field Summary
static int RQT_ALL
          a request constant as a combined mask for all types
static int RQT_DELETE
          a request to delete a resource
static int RQT_EXISTS
          a request to see if a resource exists
static int RQT_FRAGMENT
          a request to fragment a resource
static int RQT_NEW
          a request to create a new resource
static int RQT_SINK
          a request to set the data for a URI
static int RQT_SOURCE
          a request to get the data for a URI
static int RQT_TRANSREPRESENT
          a request to transpresent data for a resource to a new aspect
static URIdentifier URI_SYSTEM
          our URI
 
Constructor Summary
URRequest(URIdentifier aURI, IURRequestor aRequestor, IRequestorSession aSession, IRequestorContext aContext, int aType, URIdentifier aCWU, URRequest aParent, Class aAspectClass)
          Creates a new instance of URRequest
 
Method Summary
 void addArg(URIdentifier aURI, IURRepresentation aArg)
          Adds a pass-by-value argument to the request
 int argSize()
           
 boolean equals(Object aOther)
           
 IURRepresentation getArg(URIdentifier aURI)
           
 Collection getArgs()
           
 Class getAspectClass()
           
 IRequestorContext getContext()
           
 URIdentifier getCWU()
           
 URRequest getParent()
           
 IURRequestor getRequestor()
           
 IRequestorSession getSession()
           
 List getSuperStack()
          Return the list of super-request contexts
 List getSuperStackClone()
          Return a clone of the list of super-request contexts
 long getTime()
           
 int getType()
           
 URIdentifier getURI()
           
 int hashCode()
           
 boolean isSubRequest(URRequest aOther)
           
 URRequest rewrite(URIdentifier aRewritten)
          rewrite the URI of the given request
 void setCurrentContext(IRequestorContext aContext, List aSuper)
          sets the current context and super list of this
 void setRequestor(IURRequestor aRequestor)
          changes the requestor of this request
 void setSession(IRequestorSession aSession)
          changes the session for this request
 String toString()
          human readable debug representation of the request
static String typeToString(int aType)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RQT_SOURCE

public static final int RQT_SOURCE
a request to get the data for a URI

See Also:
Constant Field Values

RQT_SINK

public static final int RQT_SINK
a request to set the data for a URI

See Also:
Constant Field Values

RQT_EXISTS

public static final int RQT_EXISTS
a request to see if a resource exists

See Also:
Constant Field Values

RQT_DELETE

public static final int RQT_DELETE
a request to delete a resource

See Also:
Constant Field Values

RQT_NEW

public static final int RQT_NEW
a request to create a new resource

See Also:
Constant Field Values

RQT_TRANSREPRESENT

public static final int RQT_TRANSREPRESENT
a request to transpresent data for a resource to a new aspect

See Also:
Constant Field Values

RQT_FRAGMENT

public static final int RQT_FRAGMENT
a request to fragment a resource

See Also:
Constant Field Values

RQT_ALL

public static final int RQT_ALL
a request constant as a combined mask for all types

See Also:
Constant Field Values

URI_SYSTEM

public static final URIdentifier URI_SYSTEM
our URI

Constructor Detail

URRequest

public URRequest(URIdentifier aURI,
                 IURRequestor aRequestor,
                 IRequestorSession aSession,
                 IRequestorContext aContext,
                 int aType,
                 URIdentifier aCWU,
                 URRequest aParent,
                 Class aAspectClass)
Creates a new instance of URRequest

Parameters:
aURI - The URI that is the subject of the request
aRequestor - The requestor
aSession - The session that the request is being made in
aContext - The context that the request is being made in
aType - The type of request
aCWU - The current working uri that relative requests will be made against in the request
aParent - The parent request of this request
Method Detail

typeToString

public static String typeToString(int aType)
Returns:
a human readable representation of the request type

getURI

public URIdentifier getURI()
Returns:
the URI that is the subject of this request

getCWU

public URIdentifier getCWU()
Returns:
the URI that is the current working URI of this request

getRequestor

public IURRequestor getRequestor()
Returns:
the requestor

getSession

public IRequestorSession getSession()
Returns:
The session that the request is being made in

getContext

public IRequestorContext getContext()
Returns:
The context that the request is being made in

getType

public int getType()
Returns:
The type of request

getTime

public long getTime()
Returns:
the Time the request was created

getParent

public URRequest getParent()
Returns:
the parent of this request

getAspectClass

public Class getAspectClass()
Returns:
the java interface that a result to this request should implement

toString

public String toString()
human readable debug representation of the request


rewrite

public URRequest rewrite(URIdentifier aRewritten)
rewrite the URI of the given request

Parameters:
aRewritten - the new URI
Returns:
a new Request with the URI rewritten

argSize

public int argSize()
Returns:
the number of pass-by-value arguments on the request

getArg

public IURRepresentation getArg(URIdentifier aURI)
Returns:
a pass-by-value argument for the given URI

getArgs

public Collection getArgs()
Returns:
the collection of all pass-by-value arguments URIs

addArg

public void addArg(URIdentifier aURI,
                   IURRepresentation aArg)
Adds a pass-by-value argument to the request

Parameters:
aURI - the URI of the argument
aArg - the value of the argument

getSuperStack

public List getSuperStack()
Return the list of super-request contexts


getSuperStackClone

public List getSuperStackClone()
Return a clone of the list of super-request contexts


isSubRequest

public boolean isSubRequest(URRequest aOther)

setCurrentContext

public void setCurrentContext(IRequestorContext aContext,
                              List aSuper)
sets the current context and super list of this


setRequestor

public void setRequestor(IURRequestor aRequestor)
changes the requestor of this request


setSession

public void setSession(IRequestorSession aSession)
changes the session for this request


equals

public boolean equals(Object aOther)

hashCode

public int hashCode()

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.