Class SessionFactory
- java.lang.Object
-
- net.webpdf.wsclient.session.SessionFactory
-
public final class SessionFactory extends Object
The
SessionFactoryprovides the means to create aSessionof a matching type, establishing and managing a connection with a webPDF server.
Be Aware: Should you not set an
AuthProvidertheAnonymousAuthProvidershall be used by default, and "anonymous sessions" may or may not be allowed by your webPDF server.
It is never possible to establish a session with the webPDF server without proper authorization.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T_SESSION extends Session>
T_SESSIONcreateInstance(@NotNull SessionContext sessionContext)Creates a HTTP or HTTPSSessionwith a webPDF server, based on the givenSessionContext.static <T_SESSION extends Session>
T_SESSIONcreateInstance(@NotNull SessionContext sessionContext, @NotNull AuthProvider authProvider)Creates a HTTP or HTTPSSessionwith a webPDF server, based on the givenSessionContextandAuthProvider.
-
-
-
Method Detail
-
createInstance
@NotNull public static <T_SESSION extends Session> T_SESSION createInstance(@NotNull @NotNull SessionContext sessionContext) throws ResultException
Creates a HTTP or HTTPS
Sessionwith a webPDF server, based on the givenSessionContext.This factory will either produce a
SoapWebServiceSessionor aRestWebServiceSession. It is not fit to produce custom session types.Be Aware: This shall implicitly use the
AnonymousAuthProvider, and "anonymous sessions" may or may not be allowed by your webPDF server - you should check that first, before using this factory method.
It is never possible to establish a session with the webPDF server without proper authorization.Be Aware: Neither
SessionContext, norAuthProviderare required to serve multipleSessions at a time. It is expected to create a newSessionContextandAuthProviderperSessionyou create.- Parameters:
sessionContext- TheSessionContextcontaining advanced options for the session initialization.- Returns:
- The
Sessionorganizing the communication with the webPDF server. - Throws:
ResultException- Shall be thrown in case establishing theSessionfailed.
-
createInstance
@NotNull public static <T_SESSION extends Session> T_SESSION createInstance(@NotNull @NotNull SessionContext sessionContext, @NotNull @NotNull AuthProvider authProvider) throws ResultException
Creates a HTTP or HTTPS
Sessionwith a webPDF server, based on the givenSessionContextandAuthProvider.This factory will either produce a
SoapWebServiceSessionor aRestWebServiceSession. It is not fit to produce custom session types.Be Aware: Neither
SessionContext, norAuthProviderare required to serve multipleSessions at a time. It is expected to create a newSessionContextandAuthProviderperSessionyou create.- Parameters:
sessionContext- TheSessionContextcontaining advanced options for theSession.authProvider- TheAuthProviderto use for authentication/authorization of theSession.- Returns:
- The
Sessionorganizing the communication with the webPDF server. - Throws:
ResultException- Shall be thrown in case establishing theSessionfailed.
-
-