Package de.elo.ix.client
Interface IXConnectionIF
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
IXConnection
,IXConnectionWrapper
IXConnection interface. This interface defines the basic methods of the IXConnection class.
-
Method Summary
Modifier and TypeMethodDescriptionactivateRoles
(List<Integer> roleIds) Replace the currently activated functional roles.void
close()
Disconnect the IXConnection object and maybe logout the session.createConnectionForUser
(String runAsName) Creates new connection for a "run as" user, running on the already existent ticket.Convert a java.util.Date into an ISO date related to the current timezone.void
download
(String url, long offset, long length, IXClientIF.ContentStream cstrm) Download bytes from the given URL.void
void
Download a file from the given URL.Encrytps a password used to login or to supply an encryption set password.Return CSRF token to send approved REST requests.Returns the version of the IXClient class, resp.de.elo.ix.client.config.ConfigServiceAuth
Configuration service interface.Get the connection properties.getCONST()
Constants.void
getCONST
(byps.BAsyncResult<IXServicePortC> asyncResult) Constants.Returns the name of the database engine (MSSQL, ORACLE, DB2).Retuns the Indexserver URLde.elo.ix.client.feed.FeedServiceAuth
Get service interface for document feed.getFileExt
(File file) Returns the file extension of the given file name without dot.getFileMd5
(File file) Computes the MD5 hash for the given file.de.elo.ix.client.health.HealthCheckServiceAuth
Get service interface for the health check service.getHttpCookie
(String name) Return HTTP cookie.Get HTTP cookies.Return HTTP session ID.Detect Indexserver version with build number.Return IXID defined in Indexserver options.Deprecated.de.elo.ix.client.ldap.LdapServiceAuth
Get service interface for accessing LDAP.Get LoginResult object.de.elo.ix.client.PackageServiceAuth
Get service interface for package data.de.elo.ix.client.plugin.PluginServiceAuth
Get service interface for accessing plugins.de.elo.ix.client.compatibility.RawStreamServiceAuth
Internal interface for file upload and download.Gets the current server time.Get the session options.Returns the negotiated stream version.de.elo.ix.client.system.SystemInformationAuth
Get service interface for system information.int
Get current user ID.Get current user name.Detect Indexserver version without build number.boolean
Returns true, if the session is expired.Convert an ISO date to a java.util.Date.ix()
Get Indexserver API object.void
logout()
Deprecated.Provide a new connection object with the same session ticket initialized with language en, country US and timezone UTC.normalized
(ClientInfo ci) Provide a new connection object with the same session ticket initialized with language, country and timezone from the givenClientInfo
.Update the current user permissions in this connection object.void
setHttpCookies
(List<HttpCookie> cookies) Set (replace) all HTTP cookies.This function truncates s to the length of max.Upload a file to the given URL.upload
(String url, InputStream is, long contentLength, String contentType) Upload the bytes of a InputStream object to the given URL.
-
Method Details
-
normalized
IXConnectionIF normalized()Provide a new connection object with the same session ticket initialized with language en, country US and timezone UTC.IXConnection conn = ... try (IXConnectionIF connN = conn.normalized()) { ClientInfo c = connN.getLoginResult().getClientInfo(); System.out.println("language=" + c.getLanguage() + ", country=" + c.getCountry() + ", timeZone=" + c.getTimeZone()); // prints: language=en, country=US, timeZone=UTC> }
Sord.IDateIso
andSord.XDateIso
are in timezone UTC. Numeric index fields of typeDocMaskLineC.TYPE_NUMBER_F1
,DocMaskLineC.TYPE_NUMBER_F2
,DocMaskLineC.TYPE_NUMBER_F4
, andDocMaskLineC.TYPE_NUMBER_F6
use a point as decimal separator (1000th grouping separators are not allowed). Numeric fields of typeDocMaskLineC.TYPE_NUMBER
andDocMaskLineC.TYPE_NUMBER_F0
are still interpreted by the server locale. Exception messages produces by IX are returned in English. The normalized connection must be closed after usage. EIX-1988- Returns:
- connection object
- See Also:
-
normalized
Provide a new connection object with the same session ticket initialized with language, country and timezone from the givenClientInfo
. EIX-3311- Parameters:
ci
- Language, country and time zone are used by the resulting connection object.- Returns:
- Connection
- See Also:
-
ix
Get Indexserver API object. Hint: Do not store the returned object in a variable. Always call IXConnection.ix() to obtain the API object. Do not rely on ix() returning an object of type IXConnIXServicePortIF_2.- Returns:
- Indexserver interface object.
-
getLoginResult
LoginResult getLoginResult()Get LoginResult object.- Returns:
- LoginResult object.
-
getUserId
int getUserId()Get current user ID.- Returns:
- User ID.
-
getUserName
String getUserName()Get current user name.- Returns:
- User name.
-
getConnProperties
Properties getConnProperties()Get the connection properties.- Returns:
- Connection properties.
-
getEndpointUrl
String getEndpointUrl()Retuns the Indexserver URL- Returns:
- URL
-
getSessionOptions
IXProperties getSessionOptions()Get the session options. They are requested from the IXConnLogin object.- Returns:
- Session options.
- See Also:
-
getVersion
String getVersion()Detect Indexserver version without build number.- Returns:
- IX-Version
-
getImplVersion
String getImplVersion()Detect Indexserver version with build number.- Returns:
- IX-Version
-
getInterfaceVersion
Deprecated.Detect Indexserver SOAP interface version.- Returns:
- SOAP interface version
-
getClientVersion
String getClientVersion()Returns the version of the IXClient class, resp. the latest binary protocol version the IXClient class can understand.- Returns:
- latest protocol version
- See Also:
-
getStreamVersion
String getStreamVersion()Returns the negotiated stream version.- Returns:
- negotiated protocol version
-
getServerTime
Date getServerTime()Gets the current server time.- Returns:
- Server time.
-
getCONST
Constants.- Returns:
- Constant object.
- Throws:
byps.RemoteException
-
getCONST
Constants.- Parameters:
asyncResult
- Callback interface that receives the result.
-
isoToDate
Convert an ISO date to a java.util.Date. The ISO date is assumed to be in the timezone of the current session.- Parameters:
iso
- ISO date- Returns:
- java.util.Date (always UTC, use java.util.Calendar for formatting)
-
dateToIso
Convert a java.util.Date into an ISO date related to the current timezone.- Parameters:
dt
- Java date object- Returns:
- ISO date
-
upload
Upload a file to the given URL.- Parameters:
url
- Destination URL.file
- File object.- Returns:
- Upload result from DM or IX.
- Throws:
byps.RemoteException
-
upload
String upload(String url, InputStream is, long contentLength, String contentType) throws byps.RemoteException Upload the bytes of a InputStream object to the given URL.- Parameters:
url
- Destination URL.is
- InputStream object to read from.contentLength
- Number of bytes contained inis
.contentType
- MIME type of the data contained inis
.- Throws:
byps.RemoteException
-
download
Download a file from the given URL.- Parameters:
url
- URL to download.file
- The contents are stored in thisFile
object.- Throws:
byps.RemoteException
-
download
void download(String url, long offset, long length, IXClientIF.ContentStream cstrm) throws byps.RemoteException Download bytes from the given URL.- Parameters:
url
- URL to download.offset
- If not 0, the content is loaded beginning at this byte offset.length
- If not -1, only this number of bytes are downloaded.cstrm
- The downloaded bytes are written into this stream object.- Throws:
byps.RemoteException
-
download
- Throws:
byps.RemoteException
-
download
- Throws:
byps.RemoteException
-
encryptPassword
Encrytps a password used to login or to supply an encryption set password.- Parameters:
s
- Plain text password.- Returns:
- Encrypted password.
- Throws:
byps.RemoteException
-
logout
Deprecated.Since the Interface extendsAutoCloseable
, the usage of the methodclose()
should be preferred.Internally calls close(). -
close
void close()Disconnect the IXConnection object and maybe logout the session. The session is logged out if it was not created byIXConnFactory.createFromTicket(ClientInfo)
.- Specified by:
close
in interfaceAutoCloseable
-
getFileExt
Returns the file extension of the given file name without dot.- Parameters:
file
- File object.- Returns:
- File extension.
-
getFileMd5
Computes the MD5 hash for the given file.- Parameters:
file
- File object.- Returns:
- MD5 hash in String format.
- Throws:
IOException
-
getDatabaseEngine
String getDatabaseEngine()Returns the name of the database engine (MSSQL, ORACLE, DB2). If the conected Indexserver is older than 8.0, UNKNOWN is returned.- Returns:
- Database engine name.
-
truncate
This function truncates s to the length of max.If the String s is not truncated, the return value is s itself. Thus, checking s == truncate(s) is sufficient to check, wether the s can be stored - the String.equals function need not to be called.
Example:
IXConnection ix = ...
Sord sord = ...
boolean canStore = sord.getName() == ix.truncate(sord.getName(), ix.getCONST().getSORD().getLnName());
- Parameters:
s
- String to be truncatedmax
- Database column width from a member length value of a constant class.- Returns:
- Truncated String or s.
-
getEventBusApi
EventBusApi getEventBusApi() -
createConnectionForUser
Creates new connection for a "run as" user, running on the already existent ticket.- Parameters:
runAsName
- User name- Returns:
- IXConnection object
- Throws:
byps.RemoteException
-
getFeedService
de.elo.ix.client.feed.FeedServiceAuth getFeedService()Get service interface for document feed.- Returns:
- service interface.
-
getPackageService
de.elo.ix.client.PackageServiceAuth getPackageService()Get service interface for package data.- Returns:
- service interface.
- Since:
- 21.00.000.005
-
getRawStreamService
de.elo.ix.client.compatibility.RawStreamServiceAuth getRawStreamService()Internal interface for file upload and download.- Returns:
- service interface
-
getPluginService
de.elo.ix.client.plugin.PluginServiceAuth getPluginService()Get service interface for accessing plugins.- Returns:
- service interface.
-
getHealthCheckService
de.elo.ix.client.health.HealthCheckServiceAuth getHealthCheckService()Get service interface for the health check service.- Returns:
- service interface.
-
getLdapService
de.elo.ix.client.ldap.LdapServiceAuth getLdapService()Get service interface for accessing LDAP.- Returns:
- service interface.
-
getSystemInformation
de.elo.ix.client.system.SystemInformationAuth getSystemInformation()Get service interface for system information. EIX-3356- Returns:
- service interface
-
getConfigService
de.elo.ix.client.config.ConfigServiceAuth getConfigService()Configuration service interface.- Returns:
- service interface.
-
isExpired
boolean isExpired()Returns true, if the session is expired. The IXConnection object will automatically perform a re-login the next time an API function is called.- Returns:
- true, if session is expired.
-
getAuthenticationType
EAuthenticationType getAuthenticationType() -
getHttpSession
String getHttpSession()Return HTTP session ID. Returns cookie JSESIONID supplied by Tomcat.- Returns:
- Session ID
-
getHttpCookie
Return HTTP cookie. Returns cookie with the given name or null.- Parameters:
name
- Cookie name- Returns:
- Cookie or null, if cookie does not exist.
-
getHttpCookies
List<HttpCookie> getHttpCookies()Get HTTP cookies. EIX-3415- Returns:
- Cookies
-
setHttpCookies
Set (replace) all HTTP cookies. EIX-3415- Parameters:
cookies
- cookies
-
activateRoles
Replace the currently activated functional roles.- Parameters:
roleIds
- IDs of roles to activate.- Returns:
- LoginResult object with updated permissions and group membership.
- Throws:
byps.RemoteException
- Since:
- 20.00.000.003
-
refreshLoginResult
Update the current user permissions in this connection object. This function calls getSessionFromTicket to receive the current LoginResult object that contains the current permissions and group memberships.- Returns:
- LoginResult object with updated permissions and group membership.
- Throws:
byps.RemoteException
- Since:
- 20.00.000.003
-
getApprovedToken
String getApprovedToken()Return CSRF token to send approved REST requests. This token is used to identify CSRF attacks against operations in the rest-plugin. REST operations marked as "Approved" compare this token with the value stored in the servers session object. If the tokens do not match, the request is declined with error 403 (Forbidden). Send this token as HTTP headerSessionManagement.HTTP_SESSION_HEADER_APPROVED
in addition to the cookie returned bygetHttpSession()
in each request.- Returns:
- CSRF token.
-
getInstanceName
String getInstanceName()Return IXID defined in Indexserver options.- Returns:
- Instance name
-
AutoCloseable
, the usage of the methodclose()
should be preferred.