org.aselect.system.communication.server
Class ServletRequestWrapper

java.lang.Object
  extended by org.aselect.system.communication.server.ServletRequestWrapper
All Implemented Interfaces:
IProtocolRequest

public class ServletRequestWrapper
extends java.lang.Object
implements IProtocolRequest

Wrapper to communicate in a transparant manner to a HttpServletRequest.

Description:
This class is a Wrapper for the HttpServletRequest which implements IProtocolRequest.

Note: Wrapper is commonly used Design pattern also known as adapter.

Concurrency issues:
-

Author:
Alfa & Ariss

Constructor Summary
ServletRequestWrapper(javax.servlet.http.HttpServletRequest oRequest)
          Create a new instance.
 
Method Summary
 java.io.InputStream getInputStream()
          Get the input stream of the request protocol.
 java.lang.String getMessage()
          Returns an String which contains the request its data.
 java.lang.String getProperty(java.lang.String name)
          Retrieve a property of the request protocol.
 java.lang.String getProtocolName()
          Retrieve the name of the protocol that is wrapped by this wrapper.
 java.lang.String getTarget()
          Retrieve the full servlet address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletRequestWrapper

public ServletRequestWrapper(javax.servlet.http.HttpServletRequest oRequest)
Create a new instance.

Description:
Creates a new instance wrapping oRequest.

Concurrency issues:
-

Preconditions:
oRequest should be created by a servlet container.

Postconditions:
This instance wraps oRequest.

Parameters:
oRequest - The HttpServletRequest that this wrapper wraps.
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Get the input stream of the request protocol. The input stream is buffered in a String.

Specified by:
getInputStream in interface IProtocolRequest
Returns:
InputStream from which the incomming message can be retrieved.
Throws:
java.io.IOException - if InputStream can't be retrieved from the protocol.
See Also:
IProtocolRequest.getInputStream()

getProperty

public java.lang.String getProperty(java.lang.String name)
Retrieve a property of the request protocol.

Specified by:
getProperty in interface IProtocolRequest
Parameters:
name - The property name.
Returns:
The propery value.
See Also:
IProtocolRequest.getProperty(java.lang.String)

getProtocolName

public java.lang.String getProtocolName()
Retrieve the name of the protocol that is wrapped by this wrapper.

Specified by:
getProtocolName in interface IProtocolRequest
Returns:
the full name of the protocol
See Also:
IProtocolRequest.getProtocolName()

getTarget

public java.lang.String getTarget()
Retrieve the full servlet address.

Specified by:
getTarget in interface IProtocolRequest
Returns:
the full URL of the target of the request.
See Also:
IProtocolRequest.getTarget()

getMessage

public java.lang.String getMessage()
Description copied from interface: IProtocolRequest
Returns an String which contains the request its data.

Specified by:
getMessage in interface IProtocolRequest
Returns:
The request data as String.
See Also:
IProtocolRequest.getMessage()


Copyright © 2008 SURFnet BV. All Rights Reserved.