oracle.soap.server
Class UserContext

java.lang.Object
  |
  +--oracle.soap.server.UserContext

public class UserContext
extends java.lang.Object

UserContext defines the user context for a SOAP service request. Several attributes are pre-defined, and set and get methods are provided for those. In addition, the provider may define additional attributes using getAttribute and setAttribute.

Note that the HttpServlet and HttpSession do not really belong here, but they are required by the JavaProvider.


Constructor Summary
UserContext()
          Default constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns the attribute with the given name, or null if there is no attribute by that name.
 java.util.Enumeration getAttributeNames()
          Returns an Enumeration containing the attribute names available within this SOAP context.
 java.lang.Object getCertificate()
          Returns the user certificate.
 javax.servlet.http.HttpServlet getHttpServlet()
          Returns the HTTP servlet.
 javax.servlet.http.HttpSession getHttpSession()
          Returns the HTTP session.
 java.lang.String getRemoteAddress()
          Returns the Internet Protocol (IP) address of the client that sent the request.
 java.lang.String getRemoteHost()
          Returns the host name of the client that sent the request.
 java.lang.String getRequestURI()
          Returns the URI of the request.
 boolean getSecureChannel()
          Returns an indication whether the channel is secure.
 java.lang.String getUsername()
          Returns the protocol-specific username.
 void removeAttribute(java.lang.String name)
          Removes the attribute with the given name from the context.
 void setAttribute(java.lang.String name, java.lang.Object object)
          Binds an object to a given attribute name in this SOAP context.
 void setCertificate(java.lang.Object certificate)
          Set the user certificate.
 void setHttpServlet(javax.servlet.http.HttpServlet servlet)
          Set the HTTP servlet.
 void setHttpSession(javax.servlet.http.HttpSession session)
          Set the HTTP session.
 void setRemoteAddress(java.lang.String remoteAddress)
          Set the remote IP address of the client
 void setRemoteHost(java.lang.String remoteHost)
          Set the host name of the client making the SOAP request
 void setRequestURI(java.lang.String uri)
          Set the URI of the request.
 void setSecureChannel(boolean secureChannel)
          Set the indicator of whether the channel is secure.
 void setUsername(java.lang.String username)
          Set the protocol-specific username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserContext

public UserContext()
Default constructor.
Method Detail

getRequestURI

public java.lang.String getRequestURI()
Returns the URI of the request.
Returns:
the URI of the request.

setRequestURI

public void setRequestURI(java.lang.String uri)
Set the URI of the request.
Parameters:
uri - Request URI

getCertificate

public java.lang.Object getCertificate()
Returns the user certificate.
Returns:
The user certificate for the user making SOAP request, or null if this attribute is not set.

setCertificate

public void setCertificate(java.lang.Object certificate)
Set the user certificate.
Parameters:
certificate - The user certificate for the user making the SOAP request.

getHttpServlet

public javax.servlet.http.HttpServlet getHttpServlet()
Returns the HTTP servlet.
Returns:
The HttpServlet that is processing the SOAP request, or null if the servlet attribute is not set.

setHttpServlet

public void setHttpServlet(javax.servlet.http.HttpServlet servlet)
Set the HTTP servlet.
Parameters:
servlet - The HttpServlet that is processing the SOAP request.

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Returns the HTTP session.
Returns:
The HttpSession for the SOAP request, or null if the session attribute is not set.

setHttpSession

public void setHttpSession(javax.servlet.http.HttpSession session)
Set the HTTP session.
Parameters:
servlet - The HttpSession for the SOAP request.

getRemoteAddress

public java.lang.String getRemoteAddress()
Returns the Internet Protocol (IP) address of the client that sent the request.
Returns:
The remote client's IP address.

setRemoteAddress

public void setRemoteAddress(java.lang.String remoteAddress)
Set the remote IP address of the client
Parameters:
remoteAddress - The IP address of the client making the SOAP request.

getRemoteHost

public java.lang.String getRemoteHost()
Returns the host name of the client that sent the request.
Returns:
The remote client's host name.

setRemoteHost

public void setRemoteHost(java.lang.String remoteHost)
Set the host name of the client making the SOAP request
Parameters:
remoteHost - The host name of the client making the SOAP request.

getSecureChannel

public boolean getSecureChannel()
Returns an indication whether the channel is secure.
Returns:
true if the channel is secure, else false.

setSecureChannel

public void setSecureChannel(boolean secureChannel)
Set the indicator of whether the channel is secure.
Parameters:
secureChannel - true if the channel is secure, else false.

getUsername

public java.lang.String getUsername()
Returns the protocol-specific username.
Returns:
The protocol-specific username for the SOAP request, or null if this attribute is not set.

setUsername

public void setUsername(java.lang.String username)
Set the protocol-specific username.
Parameters:
username - The protocol-specific username for the SOAP request.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns the attribute with the given name, or null if there is no attribute by that name.
Parameters:
name - A String specifying the name of the attribute.
Returns:
An Object containing the value of the attribute, or null if no attribute exists matching the given name.
See Also:
getAttributeNames()

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an Enumeration containing the attribute names available within this SOAP context.
Returns:
An Enumeration of attribute names.
See Also:
getAttribute(java.lang.String)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object object)
Binds an object to a given attribute name in this SOAP context. If the name specified is already used for an attribute, this method will remove the old attribute and bind the name to the new attribute. Neither the name nor the object may be null.
Parameters:
name - A non-null String specifying the name of the attribute.
object - An non-null Object representing the attribute to be bound.

removeAttribute

public void removeAttribute(java.lang.String name)
Removes the attribute with the given name from the context. After removal, subsequent calls to getAttribute(java.lang.String) to retrieve the attribute's value will return null.
Parameters:
name - A String specifying the name of the attribute to be removed.
object - An Object representing the attribute to be bound.


Copyright 2001 Oracle SOAP. All Rights Reserved.