Class SiegfriedClientRest
- java.lang.Object
-
- fr.gouv.vitam.common.client.DefaultClient
-
- fr.gouv.vitam.common.format.identification.siegfried.SiegfriedClientRest
-
- All Implemented Interfaces:
BasicClient,MockOrRestClient,SiegfriedClient,VitamAutoCloseable,java.lang.AutoCloseable
public class SiegfriedClientRest extends DefaultClient implements SiegfriedClient
-
-
Field Summary
-
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestResponse<com.fasterxml.jackson.databind.JsonNode>analysePath(java.nio.file.Path filePath)Call siegfried instance to analyse the given file and format a Json responsevoidcheckStatus()Check the status from the servicevoidcheckStatus(javax.ws.rs.core.MultivaluedHashMap<java.lang.String,java.lang.Object> headers)Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificatevoidclose()Close the underneath http clientvoidconsumeAnyEntityAndClose(javax.ws.rs.core.Response response)Helper when an error occurs on client usage side to consume response howeverjavax.ws.rs.client.ClientgetChunkedClient()javax.ws.rs.client.ClientgetClient()VitamClientFactory<?>getClientFactory()java.lang.StringgetResourcePath()Get the resource path of the server.java.lang.StringgetServiceUrl()Get the service URLjavax.ws.rs.core.Responsemake(VitamRequestBuilder request)javax.ws.rs.core.ResponsemakeSpecifyingUrl(VitamRequestBuilder request)static voidstaticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response)This method consume everything (in particular InputStream) and close the response.RequestResponse<com.fasterxml.jackson.databind.JsonNode>status(java.nio.file.Path filePath)Call Siegfried instance to get disponibility and versionjava.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
analysePath
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> analysePath(java.nio.file.Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException
Description copied from interface:SiegfriedClientCall siegfried instance to analyse the given file and format a Json response- Specified by:
analysePathin interfaceSiegfriedClient- Parameters:
filePath- The file path- Returns:
- the identified format embedded in a RequestResponse
- Throws:
FormatIdentifierTechnicalException- if some error occursFormatIdentifierNotFoundException
-
status
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> status(java.nio.file.Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException
Description copied from interface:SiegfriedClientCall Siegfried instance to get disponibility and version- Specified by:
statusin interfaceSiegfriedClient- Parameters:
filePath- path to an empty folder (can be null)- Returns:
- the identified version embedded in a RequestResponse
- Throws:
FormatIdentifierTechnicalExceptionFormatIdentifierNotFoundException
-
staticConsumeAnyEntityAndClose
public static void staticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response)
This method consume everything (in particular InputStream) and close the response.- Parameters:
response-
-
consumeAnyEntityAndClose
public final void consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
Description copied from interface:MockOrRestClientHelper when an error occurs on client usage side to consume response however- Specified by:
consumeAnyEntityAndClosein interfaceMockOrRestClient
-
checkStatus
public void checkStatus() throws VitamApplicationServerExceptionDescription copied from interface:MockOrRestClientCheck the status from the service- Specified by:
checkStatusin interfaceMockOrRestClient- Throws:
VitamApplicationServerException- if the Server is unavailable
-
checkStatus
public void checkStatus(javax.ws.rs.core.MultivaluedHashMap<java.lang.String,java.lang.Object> headers) throws VitamApplicationServerExceptionDescription copied from interface:MockOrRestClientCheck the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate- Specified by:
checkStatusin interfaceMockOrRestClient- Throws:
VitamApplicationServerException- if the Server is unavailable
-
getResourcePath
public java.lang.String getResourcePath()
Description copied from interface:MockOrRestClientGet the resource path of the server.- Specified by:
getResourcePathin interfaceMockOrRestClient- Returns:
- the resource path as string
-
getServiceUrl
public java.lang.String getServiceUrl()
Description copied from interface:MockOrRestClientGet the service URL- Specified by:
getServiceUrlin interfaceMockOrRestClient- Returns:
- the service URL
-
close
public void close()
Description copied from interface:MockOrRestClientClose the underneath http client- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceMockOrRestClient- Specified by:
closein interfaceVitamAutoCloseable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
makeSpecifyingUrl
public javax.ws.rs.core.Response makeSpecifyingUrl(VitamRequestBuilder request) throws VitamClientInternalException
- Throws:
VitamClientInternalException
-
make
public javax.ws.rs.core.Response make(VitamRequestBuilder request) throws VitamClientInternalException
- Throws:
VitamClientInternalException
-
getClientFactory
public VitamClientFactory<?> getClientFactory()
-
getClient
public javax.ws.rs.client.Client getClient()
-
getChunkedClient
public javax.ws.rs.client.Client getChunkedClient()
-
-