Class DefaultApache31ProxyEngine
java.lang.Object
de.hybris.platform.xyformsservices.proxy.orbeonservices.impl.DefaultApache31ProxyEngine
- All Implemented Interfaces:
ProxyEngine
ProxyEngine implementation for Orbeon. Used Apache HttpClient 3.1.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Integerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected UrlRewriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractNamespace(javax.servlet.http.HttpServletRequest request) Extracts the namespace coming from client.protected ConfigurationServiceprotected StringgetHostPart(String url) Gets the host part of an URL, including protocol, host, port with no trailing slash.protected org.apache.http.client.HttpClientprotected StringgetPrefixFromRequest(javax.servlet.http.HttpServletRequest request) Gets the prefix from the request URI address.protected booleanisTextFile(String contentType) Returns true if the given contentType refers to a text file.voidproxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String namespace, String url, boolean forceGetMethod, Map<String, String> headers) Proxies contentprotected voidsendRequestHeaders(Set<String> headers, javax.servlet.http.HttpServletRequest request, org.apache.http.client.methods.HttpRequestBase httpMethod) Sends headers from the request to the remote server.protected voidsendResponseHeaders(Set<String> headers, org.apache.http.Header[] responseHeaders, javax.servlet.http.HttpServletResponse response) Get headers from remote connection and copies them back to the current response.voidsetConfigurationService(ConfigurationService configurationService) voidsetHeadersFrom(List<String> headersFrom) voidsetHeadersTo(List<String> headersTo) voidsetHttpClient(org.apache.http.client.HttpClient httpClient) voidsetUrlRewriter(UrlRewriter urlRewriter)
-
Field Details
-
DEFAULT_CHARSET
-
ORBEON_PREFIX
- See Also:
-
ORBEON_PREFIX_PLUS_SLASH
- See Also:
-
POST_METHOD
- See Also:
-
PUT_METHOD
- See Also:
-
GET_METHOD
- See Also:
-
LOCATION_HEADER
- See Also:
-
CONTENT_TYPE_HEADER
- See Also:
-
HOST_PART_INDEX
-
urlRewriter
-
headersTo
-
headersFrom
-
-
Constructor Details
-
DefaultApache31ProxyEngine
public DefaultApache31ProxyEngine()
-
-
Method Details
-
extractNamespace
Extracts the namespace coming from client.- Specified by:
extractNamespacein interfaceProxyEngine- Parameters:
request-
-
proxy
public void proxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String namespace, String url, boolean forceGetMethod, Map<String, String> headers) throws ProxyExceptionDescription copied from interface:ProxyEngineProxies content- Specified by:
proxyin interfaceProxyEngine- Parameters:
request- TheHttpServletRequestassociated to the callresponse- TheHttpServletResponseassociated to the callnamespace- Used for HTML element's id generationurl- The url to be calledforceGetMethod- Useful when proxying content, when false it uses the same method used in the original request.headers- Extra headers to be passed to the connection, useful for authentication headers.- Throws:
ProxyException
-
getHostPart
Gets the host part of an URL, including protocol, host, port with no trailing slash.- Parameters:
url-
-
getPrefixFromRequest
Gets the prefix from the request URI address.- Parameters:
request-
-
isTextFile
Returns true if the given contentType refers to a text file.- Parameters:
contentType-
-
sendRequestHeaders
protected void sendRequestHeaders(Set<String> headers, javax.servlet.http.HttpServletRequest request, org.apache.http.client.methods.HttpRequestBase httpMethod) Sends headers from the request to the remote server.- Parameters:
headers- headers that should be sentrequest- Request to take header values from.httpMethod- httpMethod
-
sendResponseHeaders
protected void sendResponseHeaders(Set<String> headers, org.apache.http.Header[] responseHeaders, javax.servlet.http.HttpServletResponse response) Get headers from remote connection and copies them back to the current response.- Parameters:
headers- headers that should be copied backresponseHeaders- Remote response Headersresponse- Response to copy header values to.
-
setUrlRewriter
-
setHeadersTo
-
setHeadersFrom
-
getHttpClient
protected org.apache.http.client.HttpClient getHttpClient() -
setHttpClient
public void setHttpClient(org.apache.http.client.HttpClient httpClient) -
getConfigurationService
-
setConfigurationService
-