edu.ucsb.adl.middleware.rmi
Class RmiRequest

java.lang.Object
  |
  +--edu.ucsb.adl.middleware.rmi.RmiRequest
All Implemented Interfaces:
javax.servlet.ServletRequest

public final class RmiRequest
extends java.lang.Object
implements javax.servlet.ServletRequest

Stores client and access control information during an RMI method invocation. Currently, only the client's IP address is stored.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/rmi/RCS/RmiRequest.java,v 1.4 2006/06/24 05:33:30 gjanee Exp $

$Log: RmiRequest.java,v $ Revision 1.4 2006/06/24 05:33:30 gjanee
Yet more upgrades to maintain compatibility with the servlet API.

Revision 1.3 2004/03/11 20:21:27 gjanee
Minor upgrade to servlet API 2.4.

Revision 1.2 2002/09/26 04:21:47 gjanee
Minor upgrade to servlet API 2.3.

Revision 1.1 2001/02/20 20:07:09 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Constructor Summary
RmiRequest(java.rmi.server.RemoteServer server)
          Creates an RmiRequest.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns null.
 java.util.Enumeration getAttributeNames()
          Returns an empty Enumeration.
 java.lang.String getCharacterEncoding()
          Returns null.
 int getContentLength()
          Returns -1.
 java.lang.String getContentType()
          Returns null.
 javax.servlet.ServletInputStream getInputStream()
          Throws an IllegalStateException.
 java.lang.String getLocalAddr()
          Returns the local IP address.
 java.util.Locale getLocale()
          Returns the default locale.
 java.util.Enumeration getLocales()
          Returns an Enumeration containing just the default locale.
 java.lang.String getLocalName()
          Returns the local hostname.
 int getLocalPort()
          Returns -1.
 java.lang.String getParameter(java.lang.String name)
          Returns null.
 java.util.Map getParameterMap()
          Returns an empty Hashtable.
 java.util.Enumeration getParameterNames()
          Returns an empty Enumeration.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns null.
 java.lang.String getProtocol()
          Returns "RMI".
 java.io.BufferedReader getReader()
          Throws an IllegalStateException.
 java.lang.String getRealPath(java.lang.String path)
          Deprecated. Talk about being between a rock and a hard place... the compiler complains that this method is deprecated, but it won't treat this class as concrete unless an implementation is provided.
 java.lang.String getRemoteAddr()
          Returns the client's IP address in dotted numeric notation.
 java.lang.String getRemoteHost()
          Returns the client's hostname.
 int getRemotePort()
          Returns -1.
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
          Returns null.
 java.lang.String getScheme()
          Returns "rmi".
 java.lang.String getServerName()
          Returns the local hostname.
 int getServerPort()
          Returns the standard RMI port number, 1099.
 boolean isSecure()
          Returns false.
 void removeAttribute(java.lang.String name)
          Does nothing.
 void setAttribute(java.lang.String name, java.lang.Object o)
          Does nothing.
 void setCharacterEncoding(java.lang.String encoding)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RmiRequest

public RmiRequest(java.rmi.server.RemoteServer server)
           throws java.rmi.RemoteException
Creates an RmiRequest.

Parameters:
server - The RMI server being invoked.
Throws:
java.rmi.RemoteException - If server is not actively being invoked.
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns null.

Specified by:
getAttribute in interface javax.servlet.ServletRequest
Parameters:
name - Unused.
Returns:
null.

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an empty Enumeration.

Specified by:
getAttributeNames in interface javax.servlet.ServletRequest
Returns:
An empty Enumeration.

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns null.

Specified by:
getCharacterEncoding in interface javax.servlet.ServletRequest
Returns:
null.

getContentLength

public int getContentLength()
Returns -1.

Specified by:
getContentLength in interface javax.servlet.ServletRequest
Returns:
-1.

getContentType

public java.lang.String getContentType()
Returns null.

Specified by:
getContentType in interface javax.servlet.ServletRequest
Returns:
null.

getInputStream

public javax.servlet.ServletInputStream getInputStream()
Throws an IllegalStateException.

Specified by:
getInputStream in interface javax.servlet.ServletRequest
Returns:
Never.
Throws:
java.lang.IllegalStateException - Always.

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns null.

Specified by:
getParameter in interface javax.servlet.ServletRequest
Parameters:
name - Unused.
Returns:
null.

getParameterNames

public java.util.Enumeration getParameterNames()
Returns an empty Enumeration.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Returns:
An empty Enumeration.

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns null.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Parameters:
name - Unused.
Returns:
null.

getProtocol

public java.lang.String getProtocol()
Returns "RMI".

Specified by:
getProtocol in interface javax.servlet.ServletRequest
Returns:
"RMI".

getScheme

public java.lang.String getScheme()
Returns "rmi".

Specified by:
getScheme in interface javax.servlet.ServletRequest
Returns:
"rmi".

getServerName

public java.lang.String getServerName()
Returns the local hostname.

Specified by:
getServerName in interface javax.servlet.ServletRequest
Returns:
The local hostname.

getServerPort

public int getServerPort()
Returns the standard RMI port number, 1099.

Specified by:
getServerPort in interface javax.servlet.ServletRequest
Returns:
1099.

getReader

public java.io.BufferedReader getReader()
Throws an IllegalStateException.

Specified by:
getReader in interface javax.servlet.ServletRequest
Returns:
Never.
Throws:
java.lang.IllegalStateException - Always.

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the client's IP address in dotted numeric notation.

Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest
Returns:
The IP address.

getRemoteHost

public java.lang.String getRemoteHost()
Returns the client's hostname.

Specified by:
getRemoteHost in interface javax.servlet.ServletRequest
Returns:
The hostname.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object o)
Does nothing.

Specified by:
setAttribute in interface javax.servlet.ServletRequest
Parameters:
name - Unused.
o - Unused.

removeAttribute

public void removeAttribute(java.lang.String name)
Does nothing.

Specified by:
removeAttribute in interface javax.servlet.ServletRequest
Parameters:
name - Unused.

getLocale

public java.util.Locale getLocale()
Returns the default locale.

Specified by:
getLocale in interface javax.servlet.ServletRequest
Returns:
The default locale.

getLocales

public java.util.Enumeration getLocales()
Returns an Enumeration containing just the default locale.

Specified by:
getLocales in interface javax.servlet.ServletRequest
Returns:
An Enumeration.

isSecure

public boolean isSecure()
Returns false.

Specified by:
isSecure in interface javax.servlet.ServletRequest
Returns:
false.

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
Returns null.

Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest
Parameters:
path - Unused.
Returns:
null.

getRealPath

public java.lang.String getRealPath(java.lang.String path)
Deprecated. Talk about being between a rock and a hard place... the compiler complains that this method is deprecated, but it won't treat this class as concrete unless an implementation is provided.

Returns null.

Specified by:
getRealPath in interface javax.servlet.ServletRequest
Parameters:
path - Unused.
Returns:
null.

setCharacterEncoding

public void setCharacterEncoding(java.lang.String encoding)
Does nothing.

Specified by:
setCharacterEncoding in interface javax.servlet.ServletRequest
Parameters:
encoding - Unused.

getParameterMap

public java.util.Map getParameterMap()
Returns an empty Hashtable.

Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Returns:
An empty Hashtable.

getLocalPort

public int getLocalPort()
Returns -1.

Specified by:
getLocalPort in interface javax.servlet.ServletRequest
Returns:
-1.

getLocalAddr

public java.lang.String getLocalAddr()
Returns the local IP address.

Specified by:
getLocalAddr in interface javax.servlet.ServletRequest
Returns:
The address.

getLocalName

public java.lang.String getLocalName()
Returns the local hostname.

Specified by:
getLocalName in interface javax.servlet.ServletRequest
Returns:
The local hostname.

getRemotePort

public int getRemotePort()
Returns -1.

Specified by:
getRemotePort in interface javax.servlet.ServletRequest
Returns:
-1.