Package fr.gouv.vitam.storage.driver
Class AbstractConnection
java.lang.Object
fr.gouv.vitam.common.client.DefaultClient
fr.gouv.vitam.storage.driver.AbstractConnection
- All Implemented Interfaces:
BasicClient,MockOrRestClient,VitamAutoCloseable,Connection,AutoCloseable
- Direct Known Subclasses:
ConnectionImpl,FakeDriverImpl.FakeConnectionImpl
This class must be the reference to create new connection implementation compatible with vitam client
-
Field Summary
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractConnection(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory) Constructor using given scheme (http) -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck the status from the servicevoidcheckStatus(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 certificatevoidclose()Close the underneath http clientfinal voidconsumeAnyEntityAndClose(javax.ws.rs.core.Response response) Helper when an error occurs on client usage side to consume response howeverjavax.ws.rs.client.Clientjavax.ws.rs.client.ClientGet the resource path of the server.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.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface fr.gouv.vitam.storage.driver.Connection
bulkPutObjects, checkAccessRequestStatuses, checkObjectAvailability, close, createAccessRequest, getBulkMetadata, getMetadatas, getObject, getOfferLogs, getStorageCapacity, launchOfferLogCompaction, listObjects, objectExistsInOffer, putObject, removeAccessRequest, removeObject
-
Constructor Details
-
AbstractConnection
public AbstractConnection(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory) Constructor using given scheme (http)- Parameters:
driverName- the name of the driverfactory- The client factory
-
-
Method Details
-
getDriverName
- Returns:
- the driverName associated
-
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
Description 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<String, 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
Description copied from interface:MockOrRestClientGet the resource path of the server.- Specified by:
getResourcePathin interfaceMockOrRestClient- Returns:
- the resource path as 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 interfaceAutoCloseable- Specified by:
closein interfaceMockOrRestClient- Specified by:
closein interfaceVitamAutoCloseable
-
toString
-
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
-
getClient
public javax.ws.rs.client.Client getClient() -
getChunkedClient
public javax.ws.rs.client.Client getChunkedClient()
-