public class RestSession extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close session on webPDF server
|
@Nullable org.apache.http.auth.Credentials |
getCredentials()
Returns the
Credentials authorizing this session. |
@Nullable DataFormat |
getDataFormat()
Returns the
DataFormat accepted by this session. |
@NotNull DocumentManager |
getDocumentManager()
Returns the
DocumentManager managing source and target document for this session. |
@NotNull org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
Returns the
CloseableHttpClient connected to the server via this session. |
@Nullable ProxyConfiguration |
getProxy()
Returns the currently set
ProxyConfiguration. |
@Nullable TLSContext |
getTlsContext()
Returns the currently set TLS context.
|
@Nullable Token |
getToken()
Returns the session
Token of this session. |
@NotNull URI |
getURI(@NotNull String subPath)
Returns an
URI pointing to the webservice interface of the session. |
@NotNull URI |
getURI(@NotNull String subPath,
List<org.apache.http.NameValuePair> parameters)
Returns an
URI pointing to the webservice interface of the session. |
@Nullable User |
getUser()
Returns the
User settings for the current session |
@NotNull WebServiceProtocol |
getWebServiceProtocol()
Returns the
WebServiceProtocol this session is using. |
void |
login()
Login into the server and get a token
|
void |
login(@Nullable Token token)
Login into the server with an existing session token
|
void |
setCredentials(@Nullable org.apache.http.auth.Credentials credentials)
Sets the
Credentials authorizing this session. |
void |
setDataFormat(@Nullable DataFormat dataFormat)
Sets the
DataFormat accepted by this session. |
void |
setProxy(@Nullable ProxyConfiguration proxy)
Set a
ProxyConfiguration. |
@Nullable public @Nullable Token getToken()
Token of this session.Token of this session.public void setProxy(@Nullable
@Nullable ProxyConfiguration proxy)
throws ResultException
ProxyConfiguration.setProxy in interface Sessionproxy - The ProxyConfiguration, that shall be set.ResultException - Shall be thrown, when resolving the proxy failed.@NotNull public @NotNull org.apache.http.impl.client.CloseableHttpClient getHttpClient()
CloseableHttpClient connected to the server via this session.CloseableHttpClient connected to the server via this session.@NotNull public @NotNull DocumentManager getDocumentManager()
DocumentManager managing source and target document for this session.DocumentManager managing source and target document for this session.public void setDataFormat(@Nullable
@Nullable DataFormat dataFormat)
DataFormat accepted by this session.dataFormat - The DataFormat accepted by this session.public void close()
throws IOException
IOException - a IOExceptionpublic void login(@Nullable
@Nullable Token token)
throws IOException
token - the token to refresh the session withIOException - HTTP access errorpublic void login()
throws IOException
IOException - HTTP access error@Nullable public @Nullable User getUser()
User settings for the current sessionUser settings for the current session@Nullable public @Nullable TLSContext getTlsContext()
getTlsContext in interface Session@Nullable public @Nullable ProxyConfiguration getProxy()
ProxyConfiguration.getProxy in interface SessionProxyConfiguration.@NotNull public @NotNull WebServiceProtocol getWebServiceProtocol()
WebServiceProtocol this session is using.getWebServiceProtocol in interface SessionWebServiceProtocol this session is using.@NotNull public @NotNull URI getURI(@NotNull @NotNull String subPath) throws ResultException
URI pointing to the webservice interface of the session.getURI in interface SessionsubPath - The location of the webservice interface on the webPDF server.URI pointing to the webservice interface of the session.ResultException - a ResultException@NotNull public @NotNull URI getURI(@NotNull @NotNull String subPath, List<org.apache.http.NameValuePair> parameters) throws ResultException
URI pointing to the webservice interface of the session.subPath - The location of the webservice interface on the webPDF server.parameters - Additional Get parameters.URI pointing to the webservice interface of the session.ResultException - a ResultException@Nullable public @Nullable org.apache.http.auth.Credentials getCredentials()
Credentials authorizing this session.getCredentials in interface SessionCredentials authorizing this session.public void setCredentials(@Nullable
@Nullable org.apache.http.auth.Credentials credentials)
Credentials authorizing this session.setCredentials in interface Sessioncredentials - The Credentials authorizing this session.@Nullable public @Nullable DataFormat getDataFormat()
DataFormat accepted by this session.getDataFormat in interface SessionDataFormat accepted by this session.Copyright © 2017–2020 SoftVision Development GmbH, Fulda, Germany. All rights reserved.