public class ProxyContext
extends org.apache.commons.chain.impl.ContextBase
Context
implementation to be used in
a reverse proxy service execution.org.apache.commons.chain.Context}
,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ProxyContext(RequestContext requestContext)
Constructs a
ProxyContext for the given RequestContext . |
ProxyContext(RequestContext requestContext,
Map map)
Constructs a
ProxyContext for the given RequestContext
with putting all entries into the ProxyContext from the initial map . |
Modifier and Type | Method and Description |
---|---|
void |
addException(Exception e)
Adds an exception caught during the current reverse proxy processing.
|
ContentRewriter |
getContentRewriter()
Returns the
ContentRewriter instance used in the current reverse proxy processing context. |
org.apache.http.client.CookieStore |
getCookieStore()
Returns the
CookieStore instance used in this reverse proxy processing context. |
static ProxyContext |
getCurrentProxyContext()
Returns the current
ProxyContext instance in the static thread local variable. |
List<Exception> |
getExceptions()
Returns a list of exception(s) caught during the current reverse proxy processing.
|
org.apache.http.client.HttpClient |
getHttpClient()
Returns the internal
HttpClient instance used in this reverse proxy processing context. |
org.apache.http.client.methods.HttpRequestBase |
getHttpRequest()
Returns the
HttpRequestBase instance used in the current reverse proxy processing context. |
org.apache.http.HttpResponse |
getHttpResponse()
Returns the
HttpResponse instance used in the current reverse proxy processing context. |
String |
getLocalPath()
Returns the local path info in this reverse proxy processing context.
|
ProxyMappingRegistry |
getProxyMappingRegistry()
Returns the reverse proxy mapping registry in this reverse proxy processing context.
|
URI |
getRemoteURI()
Returns the remote target URI in this reverse proxy processing context.
|
RequestContext |
getRequestContext()
Returns the
RequestContext instance in this reverse proxy processing context. |
ProxyMapping |
getResolvedMapping()
Returns the resolved reverse proxy mapping in this reverse proxy processing context.
|
boolean |
hasException()
Returns true if there's any exception caught during the current reverse proxy processing.
|
static void |
removeCurrentProxyContext()
Removes the current
ProxyContext instance from the static thread local variable. |
void |
setContentRewriter(ContentRewriter contentRewriter)
Sets the
ContentRewriter instance to be used in the current reverse proxy processing context. |
void |
setCookieStore(org.apache.http.client.CookieStore cookieStore)
Sets the
CookieStore instance to be used in this reverse proxy processing context. |
static void |
setCurrentProxyContext(ProxyContext proxyContext)
Sets the current
ProxyContext instance in the static thread local variable. |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Sets the internal
HttpClient instance to be used in this reverse proxy processing context. |
void |
setHttpRequest(org.apache.http.client.methods.HttpRequestBase httpRequest)
Sets the
HttpRequestBase instance to be used in the current reverse proxy processing context. |
void |
setHttpResponse(org.apache.http.HttpResponse httpResponse)
Sets the
HttpResponse instance to be used in the current reverse proxy processing context. |
void |
setLocalPath(String localPath)
Sets the local path info in this reverse proxy processing context.
|
void |
setProxyMappingRegistry(ProxyMappingRegistry proxyMappingRegistry)
Sets the reverse proxy mapping registry in this reverse proxy processing context.
|
void |
setRemoteURI(URI remoteURI)
Sets the remote target URI in this reverse proxy processing context.
|
void |
setResolvedMapping(ProxyMapping resolvedMapping)
Sets the resolved reverse proxy mapping in this reverse proxy processing context.
|
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
clone, containsKey, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsKey, equals, hashCode, size
public ProxyContext(RequestContext requestContext)
ProxyContext
for the given RequestContext
.requestContext
- public ProxyContext(RequestContext requestContext, Map map)
ProxyContext
for the given RequestContext
with putting all entries into the ProxyContext
from the initial map
.requestContext
- map
- public static ProxyContext getCurrentProxyContext()
ProxyContext
instance in the static thread local variable.
In some cases, a component, during the reverse proxy processing, might not have an access
to the ProxyContext
instance. In that case, that kind of component might
want to invoke this method to retrieve the current ProxyContext
instance.public static void setCurrentProxyContext(ProxyContext proxyContext)
ProxyContext
instance in the static thread local variable.proxyContext
- public static void removeCurrentProxyContext()
ProxyContext
instance from the static thread local variable.public RequestContext getRequestContext()
RequestContext
instance in this reverse proxy processing context.public ProxyMappingRegistry getProxyMappingRegistry()
public void setProxyMappingRegistry(ProxyMappingRegistry proxyMappingRegistry)
proxyMappingRegistry
- public ProxyMapping getResolvedMapping()
public void setResolvedMapping(ProxyMapping resolvedMapping)
resolvedMapping
- public String getLocalPath()
public void setLocalPath(String localPath)
localPath
- public URI getRemoteURI()
public void setRemoteURI(URI remoteURI)
remoteURI
- public org.apache.http.client.HttpClient getHttpClient()
HttpClient
instance used in this reverse proxy processing context.public void setHttpClient(org.apache.http.client.HttpClient httpClient)
HttpClient
instance to be used in this reverse proxy processing context.httpClient
- public org.apache.http.client.CookieStore getCookieStore()
CookieStore
instance used in this reverse proxy processing context.public void setCookieStore(org.apache.http.client.CookieStore cookieStore)
CookieStore
instance to be used in this reverse proxy processing context.cookieStore
- public org.apache.http.client.methods.HttpRequestBase getHttpRequest()
HttpRequestBase
instance used in the current reverse proxy processing context.public void setHttpRequest(org.apache.http.client.methods.HttpRequestBase httpRequest)
HttpRequestBase
instance to be used in the current reverse proxy processing context.httpRequest
- public org.apache.http.HttpResponse getHttpResponse()
HttpResponse
instance used in the current reverse proxy processing context.public void setHttpResponse(org.apache.http.HttpResponse httpResponse)
HttpResponse
instance to be used in the current reverse proxy processing context.httpResponse
- public ContentRewriter getContentRewriter()
ContentRewriter
instance used in the current reverse proxy processing context.public void setContentRewriter(ContentRewriter contentRewriter)
ContentRewriter
instance to be used in the current reverse proxy processing context.contentRewriter
- public boolean hasException()
public void addException(Exception e)
e
- Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.