Package net.webpdf.wsclient.session.rest
Interface RestSession<T_REST_DOCUMENT extends RestDocument>
-
- Type Parameters:
T_REST_DOCUMENT- TheRestDocumenttype used by thisRestSession
- All Superinterfaces:
AutoCloseable,Session
- All Known Implementing Classes:
AbstractRestSession,RestWebServiceSession
public interface RestSession<T_REST_DOCUMENT extends RestDocument> extends Session
A class implementing
RestSessionestablishes and manages aWebServiceProtocol.RESTconnection with a webPDF server.Information: A
RestSessionprovides simplified access to the uploadedRestDocuments via aDocumentManager.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T_WEBSERVICE extends RestWebService<?,?,?>>
T_WEBSERVICEcreateWebServiceInstance(@NotNull WebServiceType webServiceType)Creates a matchingRestWebServiceinstance to execute a webPDF operation for the current session.@NotNull AdministrationManager<T_REST_DOCUMENT>getAdministrationManager()Returns the activeAdministrationManagerof thisRestSession.@Nullable AuthUserCertificatesgetCertificates()Returns theAuthUserCertificatesof the currently logged-in user of thisRestSession.@NotNull DocumentManager<T_REST_DOCUMENT>getDocumentManager()Returns the activeDocumentManagerof thisRestSession.@NotNull org.apache.hc.client5.http.impl.classic.CloseableHttpClientgetHttpClient()Returns theCloseableHttpClientconnected to the webPDF server via thisRestSession.@Nullable AuthUserCredentialsgetUser()Returns theAuthUserCredentialslogged in via thisRestSession.@Nullable AuthUserCertificatesupdateCertificates(String keystoreName, KeyStorePassword keyStorePassword)Updates theKeyStorePasswords for specific keystore and returns theAuthUserCertificatesfor the currently logged-in user afterward.T_REST_DOCUMENTuploadDocument(@NotNull File source)This is a shortcut forDocumentManager.uploadDocument(File)and uploads the given source to the webPDF server.T_REST_DOCUMENTuploadDocument(@NotNull InputStream source, @NotNull String documentName)This is a shortcut forDocumentManager.uploadDocument(InputStream, String)and uploads the given source to the webPDF server.-
Methods inherited from interface net.webpdf.wsclient.session.Session
close, getAuthProvider, getSessionContext, getURI, getURI, getWebServiceProtocol
-
-
-
-
Method Detail
-
getHttpClient
@NotNull @NotNull org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient()
Returns theCloseableHttpClientconnected to the webPDF server via thisRestSession.- Returns:
- The
CloseableHttpClientconnected to the webPDF server via thisRestSession.
-
getDocumentManager
@NotNull @NotNull DocumentManager<T_REST_DOCUMENT> getDocumentManager()
Returns the activeDocumentManagerof thisRestSession.- Returns:
- The active
DocumentManagerof thisRestSession.
-
uploadDocument
@NotNull T_REST_DOCUMENT uploadDocument(@NotNull @NotNull InputStream source, @NotNull @NotNull String documentName) throws ResultException
This is a shortcut forDocumentManager.uploadDocument(InputStream, String)and uploads the given source to the webPDF server.- Parameters:
source- TheInputStreamto upload to the webPDF server.- Returns:
- The uploaded
RestSession. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
uploadDocument
@NotNull T_REST_DOCUMENT uploadDocument(@NotNull @NotNull File source) throws ResultException
This is a shortcut forDocumentManager.uploadDocument(File)and uploads the given source to the webPDF server.- Parameters:
source- TheInputStreamto upload to the webPDF server.- Returns:
- The uploaded
RestSession. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
getAdministrationManager
@NotNull @NotNull AdministrationManager<T_REST_DOCUMENT> getAdministrationManager()
Returns the activeAdministrationManagerof thisRestSession.- Returns:
- The active
AdministrationManagerof thisRestSession.
-
getUser
@Nullable @Nullable AuthUserCredentials getUser()
Returns theAuthUserCredentialslogged in via thisRestSession.- Returns:
- The
AuthUserCredentialslogged in via thisRestSession.
-
getCertificates
@Nullable @Nullable AuthUserCertificates getCertificates()
Returns theAuthUserCertificatesof the currently logged-in user of thisRestSession.- Returns:
- The
AuthUserCertificatesof the currently logged-in user of thisRestSession.
-
updateCertificates
@Nullable @Nullable AuthUserCertificates updateCertificates(String keystoreName, KeyStorePassword keyStorePassword) throws ResultException
Updates theKeyStorePasswords for specific keystore and returns theAuthUserCertificatesfor the currently logged-in user afterward.- Parameters:
keystoreName- The name of the keystore to be updated.keyStorePassword- TheKeyStorePasswordto unlock the certificates with.- Returns:
- The
AuthUserCertificatesof the logged-in user in thisRestSession. - Throws:
ResultException- Shall be thrown, if the request failed.
-
createWebServiceInstance
@NotNull <T_WEBSERVICE extends RestWebService<?,?,?>> T_WEBSERVICE createWebServiceInstance(@NotNull @NotNull WebServiceType webServiceType) throws ResultException
Creates a matchingRestWebServiceinstance to execute a webPDF operation for the current session.- Type Parameters:
T_WEBSERVICE- TheWebServiceTypeto create an interface for.- Parameters:
webServiceType- TheWebServiceTypeto create an interface for.- Returns:
- A matching
RestWebServiceinstance. - Throws:
ResultException- Shall be thrown, if theRestWebServicecreation failed.
-
-