org.opensaml.ws.transport.http
Class HttpServletRequestAdapter

java.lang.Object
  extended by org.opensaml.ws.transport.http.HttpServletRequestAdapter
All Implemented Interfaces:
HTTPInTransport, HTTPTransport, InTransport, Transport

public class HttpServletRequestAdapter
extends Object
implements HTTPInTransport

Adapts an HttpServletRequest to an HTTPInTransport.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opensaml.ws.transport.http.HTTPTransport
HTTPTransport.HTTP_VERSION
 
Constructor Summary
HttpServletRequestAdapter(javax.servlet.http.HttpServletRequest request)
          Constructor.
 
Method Summary
 Object getAttribute(String name)
          Gets a transport-specific attribute.
 String getCharacterEncoding()
          Gets the character encoding of the transport.
 String getHeaderValue(String name)
          Gets the first value of the header with the given name.
 String getHTTPMethod()
          Gets the HTTP method (POST, GET, etc) used.
 InputStream getIncomingStream()
          Gets the incoming stream from the peer.
 org.opensaml.xml.security.credential.Credential getLocalCredential()
          Gets the local credential used to authenticate to the peer.
 String getParameterValue(String name)
          Gets the first value of the named parameter.
 List<String> getParameterValues(String name)
          Gets the values of the named parameter.
 String getPeerAddress()
          Gets the IP address of the peer.
 org.opensaml.xml.security.credential.Credential getPeerCredential()
          Gets the credential offered by the peer to authenticate itself.
 String getPeerDomainName()
          Gets the domain name of the peer.
 int getStatusCode()
          Gets the status code of the request.
 HTTPTransport.HTTP_VERSION getVersion()
          Gets the HTTP version used to receive the message.
 javax.servlet.http.HttpServletRequest getWrappedRequest()
          Gets the adapted request.
 boolean isAuthenticated()
          Gets whether the peer is authenticated.
 boolean isConfidential()
          Gets whether the transport represents a confidential connection (e.g.
 boolean isIntegrityProtected()
          Gets whether the transport represents a connection that protects the integrity of transported content.
 void setAuthenticated(boolean isAuthenticated)
          Sets whether the peer is authenticated.
 void setConfidential(boolean isConfidential)
          Sets whether the transport represents a confidential connection.
 void setIntegrityProtected(boolean isIntegrityProtected)
          Sets whether the transport represents a connection that protects the integrity of transported content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServletRequestAdapter

public HttpServletRequestAdapter(javax.servlet.http.HttpServletRequest request)
Constructor.

Parameters:
request - servlet request to adap
Method Detail

getAttribute

public Object getAttribute(String name)
Gets a transport-specific attribute.

Specified by:
getAttribute in interface Transport
Parameters:
name - name of the attribute
Returns:
attribute value

getCharacterEncoding

public String getCharacterEncoding()
Gets the character encoding of the transport.

Specified by:
getCharacterEncoding in interface Transport
Returns:
character encoding of the transport

getHeaderValue

public String getHeaderValue(String name)
Gets the first value of the header with the given name.

Specified by:
getHeaderValue in interface HTTPTransport
Parameters:
name - header name
Returns:
first value of the header with the given name, or null

getHTTPMethod

public String getHTTPMethod()
Gets the HTTP method (POST, GET, etc) used.

Specified by:
getHTTPMethod in interface HTTPTransport
Returns:
HTTP method used

getIncomingStream

public InputStream getIncomingStream()
Gets the incoming stream from the peer.

Specified by:
getIncomingStream in interface InTransport
Returns:
incoming stream from the peer

getLocalCredential

public org.opensaml.xml.security.credential.Credential getLocalCredential()
Gets the local credential used to authenticate to the peer.

Specified by:
getLocalCredential in interface Transport
Returns:
local credential used to authenticate to the peer

getParameterValue

public String getParameterValue(String name)
Gets the first value of the named parameter. If the request is GET, this is a decoded URL parameter. If the request is POST-based, it is a parameter from the POST body.

Specified by:
getParameterValue in interface HTTPTransport
Parameters:
name - parameter name
Returns:
parameter value

getParameterValues

public List<String> getParameterValues(String name)
Gets the values of the named parameter. If the request is GET, this is a decoded URL parameter. If the request is POST-based, it is a parameter from the POST body.

Specified by:
getParameterValues in interface HTTPTransport
Parameters:
name - parameter name
Returns:
parameter values

getPeerAddress

public String getPeerAddress()
Gets the IP address of the peer.

Specified by:
getPeerAddress in interface HTTPInTransport
Returns:
IP address of the peer

getPeerCredential

public org.opensaml.xml.security.credential.Credential getPeerCredential()
Gets the credential offered by the peer to authenticate itself.

Specified by:
getPeerCredential in interface Transport
Returns:
credential offered by the peer to authenticate itself

getPeerDomainName

public String getPeerDomainName()
Gets the domain name of the peer.

Specified by:
getPeerDomainName in interface HTTPInTransport
Returns:
domain name of the peer

getStatusCode

public int getStatusCode()
Gets the status code of the request. This method is not supported for this transport implementation. It always returns -1;

Specified by:
getStatusCode in interface HTTPTransport
Returns:
status code of the request

getVersion

public HTTPTransport.HTTP_VERSION getVersion()
Gets the HTTP version used to receive the message. This method is not supported for this transport implementation. It always returns null;

Specified by:
getVersion in interface HTTPTransport
Returns:
HTTP version used to receive the message

getWrappedRequest

public javax.servlet.http.HttpServletRequest getWrappedRequest()
Gets the adapted request.

Returns:
adapted request

isAuthenticated

public boolean isAuthenticated()
Gets whether the peer is authenticated.

Specified by:
isAuthenticated in interface Transport
Returns:
whether the peer is authenticated

isConfidential

public boolean isConfidential()
Gets whether the transport represents a confidential connection (e.g. an SSL connection).

Specified by:
isConfidential in interface Transport
Returns:
whether the transport represents a confidential connection

setAuthenticated

public void setAuthenticated(boolean isAuthenticated)
Sets whether the peer is authenticated.

Specified by:
setAuthenticated in interface Transport
Parameters:
isAuthenticated - whether the peer is authenticated

setConfidential

public void setConfidential(boolean isConfidential)
Sets whether the transport represents a confidential connection. This method is not supported for this transport implementation.

Specified by:
setConfidential in interface Transport
Parameters:
isConfidential - whether the transport represents a confidential connection

isIntegrityProtected

public boolean isIntegrityProtected()
Gets whether the transport represents a connection that protects the integrity of transported content.

Specified by:
isIntegrityProtected in interface Transport
Returns:
whether the transport represents a connection that protects the integrity of transported content

setIntegrityProtected

public void setIntegrityProtected(boolean isIntegrityProtected)
Sets whether the transport represents a connection that protects the integrity of transported content.

Specified by:
setIntegrityProtected in interface Transport
Parameters:
isIntegrityProtected - whether the transport represents a connection that protects the integrity of transported content


Copyright © 2006-2013 Internet2. All Rights Reserved.