Class SessionContext
- java.lang.Object
-
- net.webpdf.wsclient.session.connection.SessionContext
-
public class SessionContext extends Object
An instance of
SessionContextcollects and provides advanced settings for the initialization of a webPDFSession. During it´s existence aSessionwill obey those settings, when making requests to a webPDF server.Be aware: A
Sessionwill deduce it´sSessionContextSettingsfrom aSessionContext. TheSessionContextSettingsof a runningSessioncan not be changed.Be aware: A
SessionContextis not required to serve multipleSessions at a time. It is expected to create a newSessionContextfor each existingSession.
-
-
Constructor Summary
Constructors Constructor Description SessionContext(@NotNull WebServiceProtocol webServiceProtocol, @NotNull URL url)Instantiates a newSessionContextforSessions.
The constructor initializes the non-optional settings, that must be provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable ProxyConfigurationgetProxy()Returns theProxyConfigurationforSessions.
AProxyConfigurationallows to route requests to the server via the defined proxy.intgetSkewTime()Returns a skew time for the token refresh ofSessions.
The skew time helps to avoid using expired authorization tokens.@Nullable TLSContextgetTlsContext()Returns theTLSContextforSessions.
ATLSContextallows to send requests to the server via secured HTTPS connections.@NotNull URLgetUrl()Returns theURLof the server.@NotNull WebServiceProtocolgetWebServiceProtocol()Returns theWebServiceProtocol, that shall be used to communicate with the server.@NotNull SessionContextsetProxy(@Nullable ProxyConfiguration proxyConfiguration)Sets theProxyConfigurationforSessions.
AProxyConfigurationallows to route requests to the server via the defined proxy.@NotNull SessionContextsetSkewTime(int skewTime)Sets a skew time for the token refresh ofSessions.
The skew time helps to avoid using expired authorization tokens.@NotNull SessionContextsetTlsContext(@Nullable TLSContext tlsContext)Sets theTLSContextforSessions.
ATLSContextallows to send requests to the server via secured HTTPS connections.
-
-
-
Constructor Detail
-
SessionContext
public SessionContext(@NotNull @NotNull WebServiceProtocol webServiceProtocol, @NotNull @NotNull URL url)Instantiates a new
SessionContextforSessions.
The constructor initializes the non-optional settings, that must be provided. All further settings are optional, and you may or may not require to set them.Be aware: A
Sessionwill deduce it´sSessionContextSettingsfrom aSessionContext. TheSessionContextSettingsof a runningSessioncan not be changed.Be aware: A
SessionContextis not required to serve multipleSessions at a time. It is expected to create a newSessionContextfor each existingSession.- Parameters:
webServiceProtocol- TheWebServiceProtocolused to communicate with the server.url- TheURLof the server.
-
-
Method Detail
-
getWebServiceProtocol
@NotNull public @NotNull WebServiceProtocol getWebServiceProtocol()
Returns theWebServiceProtocol, that shall be used to communicate with the server.- Returns:
- The
WebServiceProtocol, that shall be used to communicate with the server.
-
getUrl
@NotNull public @NotNull URL getUrl()
Returns theURLof the server.- Returns:
- The
URLof the server.
-
setTlsContext
@NotNull public @NotNull SessionContext setTlsContext(@Nullable @Nullable TLSContext tlsContext)
Sets the
TLSContextforSessions.
ATLSContextallows to send requests to the server via secured HTTPS connections.- Parameters:
tlsContext- TheTLSContext, that shall be used.- Returns:
- This
SessionFactoryitself.
-
getTlsContext
@Nullable public @Nullable TLSContext getTlsContext()
Returns the
TLSContextforSessions.
ATLSContextallows to send requests to the server via secured HTTPS connections.- Returns:
- The
TLSContext, that shall be used.
-
setProxy
@NotNull public @NotNull SessionContext setProxy(@Nullable @Nullable ProxyConfiguration proxyConfiguration)
Sets the
ProxyConfigurationforSessions.
AProxyConfigurationallows to route requests to the server via the defined proxy.- Parameters:
proxyConfiguration- TheProxyConfiguration, that shall be used.- Returns:
- This
SessionFactoryitself.
-
getProxy
@Nullable public @Nullable ProxyConfiguration getProxy()
Returns the
ProxyConfigurationforSessions.
AProxyConfigurationallows to route requests to the server via the defined proxy.- Returns:
- The
ProxyConfiguration, that shall be used.
-
setSkewTime
@NotNull public @NotNull SessionContext setSkewTime(int skewTime)
Sets a skew time for the token refresh of
Sessions.
The skew time helps to avoid using expired authorization tokens. The returned value (in seconds) is subtracted from the expiry time to avoid issues possibly caused by transfer delays.
It can not be guaranteed, but is recommended, that custom implementations ofAuthProviderhandle this accordingly.- Parameters:
skewTime- The skew time in seconds, that shall be used.- Returns:
- This
SessionFactoryitself.
-
getSkewTime
public int getSkewTime()
Returns a skew time for the token refresh of
Sessions.
The skew time helps to avoid using expired authorization tokens. The returned value (in seconds) is subtracted from the expiry time to avoid issues possibly caused by transfer delays.
It can not be guaranteed, but is recommended, that custom implementations ofAuthProviderhandle this accordingly.- Returns:
- The skew time in seconds, that shall be used.
-
-