|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oss.net.pstream.PortletStreamParameters
Constructor Summary | |
PortletStreamParameters(PortletStreamParameters Params,
java.lang.String Name)
Constructs a new list of parmeters using another parameters object as a template. |
|
PortletStreamParameters(java.lang.String Name)
Constructor which builds an empty parameters object with the exception of it's unique name. |
Method Summary | |
void |
addResponseHeader(java.lang.String key,
java.lang.String value)
Method addResponseHeader appends a new header with the given value, even should that header already exist in the response. |
void |
addRewriter(Rewriter rw)
Method addRewriter adds a new rewriter to the stack. |
boolean |
debug()
Method debug tells you if debug is turned on. |
void |
debug(boolean On)
Method debug. |
void |
endSession()
Resets this object and prepares it for the next proxy request. |
java.lang.String |
getContentBuffer()
Method getContentBuffer returns the ResponseBody as a string, and if it has not yet been fetched it is fetched when this method is called. |
java.lang.String |
getContext()
Method getContext returns the context path, or the buffer if the context path has been rewritten. |
java.lang.String |
getEscapedTargetURI()
Method getEscapedTargetURI returns the target uri escaped to UTF8 with the exception of the URI-specific characters. |
java.lang.String |
getFullRequestHeaderValue(java.lang.String Name)
Method getFullRequestHeaderValue returns the full (unaltered) value from the request header. |
java.lang.String |
getFullResponseHeaderValue(java.lang.String Name)
Method getFullResponseHeaderValue returns the full value of the response header with the given Name, null if that header does not exist. |
java.lang.String |
getHost()
Returns the host name passed in the request header or, if that header has not been set, returns the hostname from the request (and sets the Host header equal to this). |
org.apache.commons.httpclient.HttpMethodBase |
getMethod()
|
java.lang.String |
getName()
Returns the unique name of this configuration set. |
java.lang.String |
getPath()
Method getPath wraps the HttpServletRequest.getPathInfo() method. |
int |
getPort()
Method getPort. |
java.lang.String |
getProtocol()
Method getProtocol. |
java.lang.String |
getRequestHeaderValue(java.lang.String Name)
Method getRequestHeaderValue gets the value of a request header, or gets the first value if there are more than one. |
java.io.InputStream |
getResponseBodyInputStream()
Method getResponseBodyInputStream returns the response body as an input stream. |
java.lang.String |
getResponseHeaderValue(java.lang.String Name)
Method getResponseHeaderValue returns the response header value associated with the given name, the first part only if there are multiple values, null if it doesn't exist. |
RewriterVector |
getRewiters()
Method getRewiters. |
java.lang.String |
getTargetHost()
returns the Hostname of the host this proxy is proxying for. |
java.lang.String |
getTargetPath()
Method getTargetPath returns the path from the target URI object. |
int |
getTargetPort()
Method getTargetPort. |
java.lang.String |
getTargetProtocol()
Method getTargetProtocol. |
java.lang.String |
getTargetQuery()
Method getTargetQuery. |
java.lang.String |
getTargetURI()
Method getTargetURI. |
java.lang.String |
getTargetURLAsString()
Method getTargetURLAsString. |
java.util.HashMap |
getUserRequestHeaders()
Method getUserRequestHeaders. |
java.util.HashMap |
getUserResponseHeaders()
Method getUserResponseHeaders. |
java.lang.String |
getUservar(java.lang.String name)
Method getUservar looks up the value of the given user variable. |
java.util.HashMap |
getUservars()
Method getUservars returns the uservar hashmap. |
void |
presetResponseHeaders()
Method presetResponseHeaders will attempt to set all the response headers from the target host to the client but will simply return if the HttpServletResponse object is null. |
void |
setContentBuffer(java.lang.String ContentBuffer)
Method setContentBuffer sets the buffer for the content. |
void |
setContext(java.lang.String Context)
Method setContext sets the context path buffer. |
void |
setHost(java.lang.String Host)
Sets the host header in the HttpMethodBase |
void |
setResponseHeader(java.lang.String key,
java.lang.String value)
Method setResponseHeader sets the value of a response header with the given name (key). |
void |
setTargetPath(java.lang.String TargetPath)
Method setTargetPath sets the path of the method. |
void |
setTargetQuery(org.apache.commons.httpclient.NameValuePair[] Params)
Method setTargetQuery. |
void |
setTargetQuery(java.lang.String Query)
Method setTargetQuery. |
void |
setTargetURI(java.lang.String TargetURI)
Method setTargetURI sets the target URI in a single go. |
void |
setUserRequestHeader(java.lang.String Name,
java.lang.String Value)
Method setUserRequestHeader sets a new header to be proxied to the target host. |
void |
setUserResponseHeader(java.lang.String Name,
java.lang.String Value)
Method setUserResponseHeader sets a new header to be proxied back to the client. |
void |
setUservar(java.lang.String name,
java.lang.String value)
Method setUservar sets the value of a user variable. |
void |
setUservars(java.util.HashMap UV)
Method setUservars sets the hashmap in this object to point to the hashmap UV. |
void |
startSession(org.apache.commons.httpclient.HttpClient client,
org.apache.commons.httpclient.HttpMethodBase method,
javax.servlet.http.HttpServletRequest Request,
javax.servlet.http.HttpServletResponse Response,
java.util.HashSet BlockHeaders)
Sets the state of this parameters object to active (and makes it immediately unsafe for threading). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PortletStreamParameters(java.lang.String Name)
Name
- The unique name (per config file) of this configuration.public PortletStreamParameters(PortletStreamParameters Params, java.lang.String Name)
Params
- - The parameters to use as a template.Name
- - The unique name for this parameters object to assume.Method Detail |
public void startSession(org.apache.commons.httpclient.HttpClient client, org.apache.commons.httpclient.HttpMethodBase method, javax.servlet.http.HttpServletRequest Request, javax.servlet.http.HttpServletResponse Response, java.util.HashSet BlockHeaders)
client
- The HttpClient which will be used to execute the methods used in this proxy request.
This client is consulted for Host, Protocol and Port rewrite variables.method
- The HttpMethodBase used in this proxy request. The method is consulted for the majority of
rewrite variables. This method also sets all the headers which will be passed to the proxy host, pulling them
from the request object.Request
- The HttpServletRequest object which is consulted for all the request headers which are proxied.Response
- The HttpServletResponse object, which can be null. The response is only passively used by this
object to get and set response headers when asked to do so by other classes. Each of these methods returns safely
if the response is null.BlockHeaders
- A HashSet of headers which will be blocked from the proxy host (not proxied).public void endSession()
public java.lang.String getName()
public org.apache.commons.httpclient.HttpMethodBase getMethod()
public java.lang.String getHost()
public void setHost(java.lang.String Host)
Host
- The value to be set.public java.lang.String getTargetHost()
public int getPort()
public int getTargetPort()
public java.lang.String getTargetProtocol()
public java.lang.String getProtocol()
public java.lang.String getPath()
public java.lang.String getTargetPath()
public void setTargetPath(java.lang.String TargetPath)
TargetPath
- HttpMethodBase.setPath(String TargetPath)public java.lang.String getTargetQuery()
public void setTargetQuery(java.lang.String Query)
Query
- HttpMethodBase.setQueryString(Query)public void setTargetQuery(org.apache.commons.httpclient.NameValuePair[] Params)
Params
- an array of NameValuePair objects passed to HttpMethodBase.setQueryString(Params)public java.lang.String getTargetURI()
public java.lang.String getEscapedTargetURI()
public java.lang.String getTargetURLAsString()
public void addRewriter(Rewriter rw)
rw
- public RewriterVector getRewiters()
public void debug(boolean On)
On
- public boolean debug()
public java.lang.String getUservar(java.lang.String name)
name
- The name of the variable.
public java.util.HashMap getUservars()
public void setUservar(java.lang.String name, java.lang.String value)
name
- The name of the variable.value
- the value to set.public void setUservars(java.util.HashMap UV)
UV
- The new hashmap.public java.util.HashMap getUserRequestHeaders()
public java.util.HashMap getUserResponseHeaders()
public void setUserRequestHeader(java.lang.String Name, java.lang.String Value)
Name
- the name to give the header.Value
- the value to set for the header.public void setUserResponseHeader(java.lang.String Name, java.lang.String Value)
Name
- Value
- public void setTargetURI(java.lang.String TargetURI)
TargetURI
- the URI to set.and/or @see setTargetQuery
public java.lang.String getRequestHeaderValue(java.lang.String Name)
Name
- the name of the header.
public java.lang.String getFullRequestHeaderValue(java.lang.String Name)
Name
- the name of the header.
public java.lang.String getResponseHeaderValue(java.lang.String Name)
Name
- the name of the header.
public java.lang.String getFullResponseHeaderValue(java.lang.String Name)
Name
- the name of the header.
public void setResponseHeader(java.lang.String key, java.lang.String value)
key
- the name of the header to setvalue
- the value of the header to set.public void addResponseHeader(java.lang.String key, java.lang.String value)
key
- the name of the header to append.value
- the value of the header to append.public java.lang.String getContentBuffer() throws PortletStreamException
PortletStreamException
- when this method times out or any other connection error occurs.
This most often happens when getResponseBodyAsString is called on the HttpMethodBase when
there is no response body (such as when a HEAD method was passed or when the response code
was 302 (moved) or 304 (unchanged)).public java.io.InputStream getResponseBodyInputStream() throws PortletStreamException, java.io.IOException
PortletStreamException
- if this method is called and the response code is
302 (moved) or 304 (unchaned) in which case this method should never have been called.
java.io.IOException
- if the stream is unexpectedly closed.public void setContentBuffer(java.lang.String ContentBuffer)
ContentBuffer
- public void presetResponseHeaders()
public java.lang.String getContext()
public void setContext(java.lang.String Context)
Context
- the value to set this buffer to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |