Package net.webpdf.wsclient.session.rest
Class RestWebServiceSession
- java.lang.Object
-
- net.webpdf.wsclient.session.AbstractSession
-
- net.webpdf.wsclient.session.rest.AbstractRestSession<RestWebServiceDocument>
-
- net.webpdf.wsclient.session.rest.RestWebServiceSession
-
- All Implemented Interfaces:
AutoCloseable,RestSession<RestWebServiceDocument>,Session
public class RestWebServiceSession extends AbstractRestSession<RestWebServiceDocument>
An instance of
RestWebServiceSessionestablishes and manages aWebServiceProtocol.RESTconnection with a webPDF server.Information: A
RestWebServiceSessionprovides simplified access to the uploadedRestDocuments via a specializedRestWebServiceDocumentManager.
-
-
Constructor Summary
Constructors Constructor Description RestWebServiceSession(@NotNull SessionContext serverContext, @NotNull AuthProvider authProvider)Creates a newRestWebServiceSessioninstance providing connection information, authorization objects and aRestWebServiceDocumentManagerfor a webPDF server-clientRestSession.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NotNull AdministrationManager<RestWebServiceDocument>createAdministrationManager()Creates a newAdministrationManagermatching thisRestSession.protected @NotNull DocumentManager<RestWebServiceDocument>createDocumentManager()Creates a newRestWebServiceDocumentManager.<T_WEBSERVICE extends RestWebService<?,?,?>>
T_WEBSERVICEcreateWebServiceInstance(@NotNull WebServiceType webServiceType)Creates a matchingRestWebServiceinstance to execute a webPDF operation for the current session.@NotNull RestWebServiceDocumentuploadDocument(@NotNull File source)This is a shortcut forDocumentManager.uploadDocument(File)and uploads the given source to the webPDF server.@NotNull RestWebServiceDocumentuploadDocument(@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 class net.webpdf.wsclient.session.rest.AbstractRestSession
close, getAdministrationManager, getCertificates, getDocumentManager, getHttpClient, getUser, updateCertificates
-
Methods inherited from class net.webpdf.wsclient.session.AbstractSession
getAuthProvider, getSessionContext, getURI, getURI, getWebServiceProtocol
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.webpdf.wsclient.session.Session
getAuthProvider, getSessionContext, getURI, getURI, getWebServiceProtocol
-
-
-
-
Constructor Detail
-
RestWebServiceSession
public RestWebServiceSession(@NotNull @NotNull SessionContext serverContext, @NotNull @NotNull AuthProvider authProvider) throws ResultExceptionCreates a new
RestWebServiceSessioninstance providing connection information, authorization objects and aRestWebServiceDocumentManagerfor a webPDF server-clientRestSession.Be Aware: Neither
SessionContext, norAuthProviderare required to serve multipleSessions at a time. It is expected to create a newSessionContextandAuthProviderperSessionyou create.- Parameters:
serverContext- TheSessionContextinitializing theSessionContextSettingsof thisRestSession.authProvider- TheAuthProviderfor authentication/authorization of thisRestSession.- Throws:
ResultException- Shall be thrown, in case establishing the session failed.
-
-
Method Detail
-
uploadDocument
@NotNull public @NotNull RestWebServiceDocument 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
RestWebServiceDocument. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
uploadDocument
@NotNull public @NotNull RestWebServiceDocument 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
RestWebServiceDocument. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
createDocumentManager
@NotNull protected @NotNull DocumentManager<RestWebServiceDocument> createDocumentManager()
Creates a newRestWebServiceDocumentManager.- Specified by:
createDocumentManagerin classAbstractRestSession<RestWebServiceDocument>- Returns:
- The created
RestWebServiceDocumentManager.
-
createAdministrationManager
@NotNull protected @NotNull AdministrationManager<RestWebServiceDocument> createAdministrationManager()
Creates a newAdministrationManagermatching thisRestSession.- Specified by:
createAdministrationManagerin classAbstractRestSession<RestWebServiceDocument>- Returns:
- The created
AdministrationManager.
-
createWebServiceInstance
@NotNull public <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.
-
-