public class BatchReportClientRest extends DefaultClient implements BatchReportClient
Modifier and Type | Field and Description |
---|---|
protected static String |
INTERNAL_SERVER_ERROR |
STATUS_URL
Constructor and Description |
---|
BatchReportClientRest(VitamClientFactoryInterface<?> factory)
Constructor using given scheme (http)
|
Modifier and Type | Method and Description |
---|---|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
appendReportEntries(ReportBody reportBody)
Append report entries
|
void |
checkStatus()
Check the status from the service
|
void |
checkStatus(javax.ws.rs.core.MultivaluedHashMap<String,Object> headers)
Check the status from the service
used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
cleanupReport(String processId,
ReportType reportType)
Clean all entries with the given process Id tenant and reportType
|
void |
close()
Close the underneath http client
|
void |
consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
Helper when an error occurs on client usage side to consume response however
|
protected VitamClientException |
createExceptionFromResponse(javax.ws.rs.core.Response response)
Handle all errors and throw a VitamClientException in case the response does not contains a vitamError type
result.
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
generateEliminationActionAccessionRegisterReport(String processId,
ReportExportRequest reportExportRequest)
Generate elimination action accession register for deleted units by status and process Id.
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
generateEliminationActionDistinctObjectGroupInUnitReport(String processId,
ReportExportRequest reportExportRequest)
Generate elimination action district object groups for units by status and process Id.
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
generateEliminationActionObjectGroupReport(String processId,
ReportExportRequest reportExportRequest)
Generate elimination action object group report for the specified process Id
Report is stored in JSONL format in workspace.
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
generateEliminationActionUnitReport(String processId,
ReportExportRequest reportExportRequest)
Generate elimination action unit report for the specified process Id
Report is stored in JSONL format in workspace.
|
protected javax.ws.rs.client.Client |
getClient(boolean chunked) |
String |
getResourcePath()
Get the resource path of the server.
|
String |
getServiceUrl()
Get the service URL
|
VitamClientFactory<?> |
getVitamClientFactory() |
protected Future<javax.ws.rs.core.Response> |
performAsyncRequest(String httpMethod,
String path,
javax.ws.rs.core.MultivaluedHashMap<String,Object> headers,
Object body,
javax.ws.rs.core.MediaType contentType,
javax.ws.rs.core.MediaType accept)
Perform an Async HTTP request to the server with full control of action on caller
|
protected <T> Future<T> |
performAsyncRequest(String httpMethod,
String path,
javax.ws.rs.core.MultivaluedHashMap<String,Object> headers,
Object body,
javax.ws.rs.core.MediaType contentType,
javax.ws.rs.core.MediaType accept,
javax.ws.rs.client.InvocationCallback<T> callback)
Perform an Async HTTP request to the server with callback
|
protected javax.ws.rs.core.Response |
performRequest(String httpMethod,
String path,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
javax.ws.rs.core.MediaType accept)
Perform a HTTP request to the server for synchronous call
|
protected javax.ws.rs.core.Response |
performRequest(String httpMethod,
String path,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
Object body,
javax.ws.rs.core.MediaType contentType,
javax.ws.rs.core.MediaType accept)
Perform a HTTP request to the server for synchronous call
|
protected javax.ws.rs.core.Response |
performRequest(String httpMethod,
String path,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
Object body,
javax.ws.rs.core.MediaType contentType,
javax.ws.rs.core.MediaType accept,
boolean chunkedMode)
Perform a HTTP request to the server for synchronous call
|
static void |
staticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response)
This method consume everything (in particular InpuStream) and close the response.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
protected static final String INTERNAL_SERVER_ERROR
public BatchReportClientRest(VitamClientFactoryInterface<?> factory)
factory
- The client factorypublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> generateEliminationActionUnitReport(String processId, ReportExportRequest reportExportRequest) throws VitamClientInternalException
BatchReportClient
generateEliminationActionUnitReport
in interface BatchReportClient
processId
- the given process Id to aggregatereportExportRequest
- report export requestVitamClientInternalException
- VitamClientInternalExceptionpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> generateEliminationActionObjectGroupReport(String processId, ReportExportRequest reportExportRequest) throws VitamClientInternalException
BatchReportClient
generateEliminationActionObjectGroupReport
in interface BatchReportClient
processId
- processIdreportExportRequest
- report export requestVitamClientInternalException
- VitamClientInternalExceptionpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> generateEliminationActionDistinctObjectGroupInUnitReport(String processId, ReportExportRequest reportExportRequest) throws VitamClientInternalException
BatchReportClient
generateEliminationActionDistinctObjectGroupInUnitReport
in interface BatchReportClient
reportExportRequest
- report export requestVitamClientInternalException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> appendReportEntries(ReportBody reportBody) throws VitamClientInternalException
BatchReportClient
appendReportEntries
in interface BatchReportClient
reportBody
- the given entry document.VitamClientInternalException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> generateEliminationActionAccessionRegisterReport(String processId, ReportExportRequest reportExportRequest) throws VitamClientInternalException
BatchReportClient
generateEliminationActionAccessionRegisterReport
in interface BatchReportClient
reportExportRequest
- report export requestVitamClientInternalException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> cleanupReport(String processId, ReportType reportType) throws VitamClientInternalException
BatchReportClient
cleanupReport
in interface BatchReportClient
processId
- the given process IdreportType
- report typeVitamClientInternalException
protected javax.ws.rs.client.Client getClient(boolean chunked) throws IllegalStateException
IllegalStateException
public final void consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
MockOrRestClient
consumeAnyEntityAndClose
in interface MockOrRestClient
public static final void staticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response)
response
- public void checkStatus() throws VitamApplicationServerException
MockOrRestClient
checkStatus
in interface MockOrRestClient
VitamApplicationServerException
- if the Server is unavailablepublic void checkStatus(javax.ws.rs.core.MultivaluedHashMap<String,Object> headers) throws VitamApplicationServerException
MockOrRestClient
checkStatus
in interface MockOrRestClient
VitamApplicationServerException
- if the Server is unavailableprotected javax.ws.rs.core.Response performRequest(String httpMethod, String path, javax.ws.rs.core.MultivaluedMap<String,Object> headers, javax.ws.rs.core.MediaType accept) throws VitamClientInternalException
httpMethod
- HTTP method to use for requestpath
- URL to requestheaders
- headers HTTP to add to request, may be nullaccept
- asked type of responseVitamClientInternalException
protected javax.ws.rs.core.Response performRequest(String httpMethod, String path, javax.ws.rs.core.MultivaluedMap<String,Object> headers, Object body, javax.ws.rs.core.MediaType contentType, javax.ws.rs.core.MediaType accept) throws VitamClientInternalException
httpMethod
- HTTP method to use for requestpath
- URL to requestheaders
- headers HTTP to add to request, may be nullbody
- body content of type contentType, may be nullcontentType
- the media type of the body to send, null if body is nullaccept
- asked type of responseVitamClientInternalException
protected javax.ws.rs.core.Response performRequest(String httpMethod, String path, javax.ws.rs.core.MultivaluedMap<String,Object> headers, Object body, javax.ws.rs.core.MediaType contentType, javax.ws.rs.core.MediaType accept, boolean chunkedMode) throws VitamClientInternalException
httpMethod
- HTTP method to use for requestpath
- URL to requestheaders
- headers HTTP to add to request, may be nullbody
- body content of type contentType, may be nullcontentType
- the media type of the body to send, null if body is nullaccept
- asked type of responsechunkedMode
- True use default client, else False use non Chunked mode clientVitamClientInternalException
protected <T> Future<T> performAsyncRequest(String httpMethod, String path, javax.ws.rs.core.MultivaluedHashMap<String,Object> headers, Object body, javax.ws.rs.core.MediaType contentType, javax.ws.rs.core.MediaType accept, javax.ws.rs.client.InvocationCallback<T> callback) throws VitamClientInternalException
T
- the type of the Future result (generally Response)httpMethod
- HTTP method to use for requestpath
- URL to requestheaders
- headers HTTP to add to request, may be nullbody
- body content of type contentType, may be nullcontentType
- the media type of the body to send, null if body is nullaccept
- asked type of responsecallback
- VitamClientInternalException
protected Future<javax.ws.rs.core.Response> performAsyncRequest(String httpMethod, String path, javax.ws.rs.core.MultivaluedHashMap<String,Object> headers, Object body, javax.ws.rs.core.MediaType contentType, javax.ws.rs.core.MediaType accept) throws VitamClientInternalException
httpMethod
- HTTP method to use for requestpath
- URL to requestheaders
- headers HTTP to add to request, may be nullbody
- body content of type contentType, may be nullcontentType
- the media type of the body to send, null if body is nullaccept
- asked type of responseVitamClientInternalException
protected VitamClientException createExceptionFromResponse(javax.ws.rs.core.Response response)
response
- responsepublic String getResourcePath()
MockOrRestClient
getResourcePath
in interface MockOrRestClient
public String getServiceUrl()
MockOrRestClient
getServiceUrl
in interface MockOrRestClient
public void close()
MockOrRestClient
close
in interface MockOrRestClient
close
in interface VitamAutoCloseable
close
in interface AutoCloseable
public VitamClientFactory<?> getVitamClientFactory()
Copyright © 2018 Vitam. All rights reserved.