Package net.webpdf.wsclient.session
Class AbstractSession
- java.lang.Object
-
- net.webpdf.wsclient.session.AbstractSession
-
- All Implemented Interfaces:
AutoCloseable,Session
- Direct Known Subclasses:
AbstractRestSession,AbstractSoapSession
public abstract class AbstractSession extends Object implements Session
An instance of
AbstractSessionestablishes and manages aWebServiceProtocolconnection with a webPDF server.
-
-
Constructor Summary
Constructors Constructor Description AbstractSession(@NotNull WebServiceProtocol webServiceProtocol, @NotNull SessionContext serverContext, @NotNull AuthProvider authProvider)Creates a newAbstractRestSessioninstance providing connection information and authorization objects for a webPDF server-clientSession.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull AuthProvidergetAuthProvider()Provides theAuthProviderfor the authorization of theSession´s requests.@NotNull SessionContextSettingsgetSessionContext()Returns theSessionContextSettingsused for this session.@NotNull URIgetURI(@NotNull String subPath)Returns anURIpointing to the webservice interface of the session.@NotNull URIgetURI(@NotNull String subPath, List<org.apache.hc.core5.http.NameValuePair> parameters)Returns anURIpointing to the webservice interface of the session.@NotNull WebServiceProtocolgetWebServiceProtocol()Returns theWebServiceProtocolthisSessionis using.
-
-
-
Constructor Detail
-
AbstractSession
public AbstractSession(@NotNull @NotNull WebServiceProtocol webServiceProtocol, @NotNull @NotNull SessionContext serverContext, @NotNull @NotNull AuthProvider authProvider) throws ResultExceptionCreates a new
AbstractRestSessioninstance providing connection information and authorization objects for a webPDF server-clientSession.Be Aware: Neither
SessionContext, norAuthProviderare required to serve multipleSessions at a time. It is expected to create a newSessionContextandAuthProviderperSessionyou create.- Parameters:
webServiceProtocol- TheWebServiceProtocolused for thisSession.serverContext- TheSessionContextinitializing theSessionContextSettingsof thisSession.authProvider- TheAuthProviderfor authentication/authorization of thisSession.- Throws:
ResultException- Shall be thrown, in case establishing theSessionfailed.
-
-
Method Detail
-
getAuthProvider
@NotNull public @NotNull AuthProvider getAuthProvider()
Provides theAuthProviderfor the authorization of theSession´s requests.- Specified by:
getAuthProviderin interfaceSession- Returns:
AuthProviderfor the authorization of theSession´s requests.
-
getWebServiceProtocol
@NotNull public @NotNull WebServiceProtocol getWebServiceProtocol()
Returns theWebServiceProtocolthisSessionis using.- Specified by:
getWebServiceProtocolin interfaceSession- Returns:
- The
WebServiceProtocolthisSessionis using.
-
getSessionContext
@NotNull public @NotNull SessionContextSettings getSessionContext()
Returns theSessionContextSettingsused for this session.- Specified by:
getSessionContextin interfaceSession- Returns:
- The
SessionContextSettingsused for this session.
-
getURI
@NotNull public @NotNull URI getURI(@NotNull @NotNull String subPath) throws ResultException
Returns anURIpointing to the webservice interface of the session.- Specified by:
getURIin interfaceSession- Parameters:
subPath- The location of the webservice interface on the webPDF server.- Returns:
- an
URIpointing to the webservice interface of the session. - Throws:
ResultException- aResultException
-
getURI
@NotNull public @NotNull URI getURI(@NotNull @NotNull String subPath, List<org.apache.hc.core5.http.NameValuePair> parameters) throws ResultException
Returns anURIpointing to the webservice interface of the session.- Specified by:
getURIin interfaceSession- Parameters:
subPath- The location of the webservice interface on the webPDF server.parameters- Additional Get parameters.- Returns:
- an
URIpointing to the webservice interface of the session. - Throws:
ResultException- aResultException
-
-