public final class BackOfficeRequestHelper extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
BackOfficeRequestHelper.HttpLock |
(package private) static class |
BackOfficeRequestHelper.HttpMkcol |
(package private) static class |
BackOfficeRequestHelper.HttpPropfind |
(package private) static class |
BackOfficeRequestHelper.HttpUnLock |
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__AUTHORIZED_HEADERS |
private static Set<String> |
__FILTERED_REQUEST_PARAMETERS |
Modifier | Constructor and Description |
---|---|
private |
BackOfficeRequestHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
_addMultipartEntityToBuilder(org.apache.http.entity.mime.MultipartEntityBuilder builder,
String paramName,
Object value) |
private static void |
_addRequestHeaders(Request request,
HttpUriRequest boRequest,
BackOfficeRequestProxyExtensionPoint requestProxyExtensionPoint)
Add headers indicating this is a request from the front-office to the back-office,
specifying the user if applicable.
|
private static void |
_copyCookieHeaders(Request request,
HttpUriRequest boRequest)
Copy cookie headers that were sent by the client into the request
that will be sent to the back-office.
|
private static String |
_getContextQueryPart(SiteUrl url,
String baseServerPath) |
private static String |
_getEditionQueryPart(Request request) |
private static HttpUriRequest |
_getGetHeadOptionsOrUnlockRequest(Request request,
String method,
SiteUrl url,
String baseServerPath,
String baseUrl) |
private static org.apache.http.entity.mime.MultipartEntityBuilder |
_getMultipartEntityBuilder(Request request)
Get the front-office request's parameters as an HttpClient MultipartEntity,
to be added to a POST back-office request.
|
private static String |
_getParameters(Request request)
Get the front-office request's parameters as a String, to be added to
a GET back-office request.
|
private static HttpUriRequest |
_getPostRequest(Map objectModel,
Request request,
SiteUrl url,
String baseServerPath,
String baseUrl) |
private static HttpUriRequest |
_getPutLockPropfindOrMkcolRequest(Map objectModel,
Request request,
String method,
SiteUrl url,
String baseServerPath,
String baseUrl) |
private static HttpUriRequest |
_getRequest(Map objectModel,
Request request,
String method,
SiteUrl url,
String baseServerPath,
String baseUrl) |
static CloseableHttpClient |
getHttpClient()
Build a HttpClient object parametrized
|
static HttpUriRequest |
getRequest(Map objectModel,
String page,
BackOfficeRequestProxyExtensionPoint requestProxyExtensionPoint)
Build a HttpClient request object that will be sent to the back-office to query the page.
|
private static final Pattern __AUTHORIZED_HEADERS
private static final Set<String> __FILTERED_REQUEST_PARAMETERS
private BackOfficeRequestHelper()
public static CloseableHttpClient getHttpClient()
public static HttpUriRequest getRequest(Map objectModel, String page, BackOfficeRequestProxyExtensionPoint requestProxyExtensionPoint) throws IOException
objectModel
- the current object model.page
- the wanted page path.requestProxyExtensionPoint
- The extension point for adding request headers in BO requestIOException
- if an error occurs building the request.private static HttpUriRequest _getRequest(Map objectModel, Request request, String method, SiteUrl url, String baseServerPath, String baseUrl) throws IOException, UnsupportedEncodingException
private static HttpUriRequest _getPostRequest(Map objectModel, Request request, SiteUrl url, String baseServerPath, String baseUrl) throws IOException, UnsupportedEncodingException
private static HttpUriRequest _getPutLockPropfindOrMkcolRequest(Map objectModel, Request request, String method, SiteUrl url, String baseServerPath, String baseUrl) throws IOException
IOException
private static HttpUriRequest _getGetHeadOptionsOrUnlockRequest(Request request, String method, SiteUrl url, String baseServerPath, String baseUrl)
private static String _getEditionQueryPart(Request request)
private static String _getContextQueryPart(SiteUrl url, String baseServerPath)
private static org.apache.http.entity.mime.MultipartEntityBuilder _getMultipartEntityBuilder(Request request) throws IOException
request
- the front-office request.IOException
- if an error occurs extracting the parameters or building the entity.private static void _addMultipartEntityToBuilder(org.apache.http.entity.mime.MultipartEntityBuilder builder, String paramName, Object value) throws IOException
IOException
private static String _getParameters(Request request)
request
- the front-office request.private static void _addRequestHeaders(Request request, HttpUriRequest boRequest, BackOfficeRequestProxyExtensionPoint requestProxyExtensionPoint)
request
- the front-office request.boRequest
- the request object to be sent to the back-office.requestProxyExtensionPoint
- The extension point for adding request headers in BO requestprivate static void _copyCookieHeaders(Request request, HttpUriRequest boRequest)
request
- the front-office request.boRequest
- the request object to be sent to the back-office.