Package de.elo.ix.client
Class IXConnection
java.lang.Object
de.elo.ix.client.IXConnection
- All Implemented Interfaces:
IXConnectionIF
,java.lang.AutoCloseable
public class IXConnection extends java.lang.Object implements IXConnectionIF, java.lang.AutoCloseable
Indexserver connection class.
An object of this class represents a connection to the Indexserver for
a single user.
Instances of this class are usually created by an IXConnFactory object.
Example:
Properties props = IXConnFactory.createConnProps(tp.url, 2, 10 * 60);
Properties sessOpts = IXConnFactory.createSessionOptions("MyApp", "1.0", "");
connFact = new IXConnFactory(props, sessOpts);
IXServicePortC CONST = connFact.getCONST();
IXConnection conn = connFact.create("Fritz", "geheim", "MYPC", null);
EditInfo ed = conn.ix.checkoutDoc(docId, null, EditInfoC.mbSordDoc, LockC.NO);
...conn.logout();
Hint: do not rely on IXConnection being a class. Future versions of the API might define IXConnection as an interface.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<IXConnectionCloseListener>
afterCloseListener
Listeners to be called after a connection has been closed.protected IXAuthenticationIF
auth
protected de.elo.ix.client.BClient_Indexserver
bclient
protected java.util.List<IXConnectionCloseListener>
beforeCloseListener
Listeners to be called before a connection is closed.protected IXConnFactory
connFact
Deprecated.protected IXConnLoginBYPS
connLogin
Deprecated.protected java.util.Properties
connProps
Connection properties.protected IXServicePortC
CONST
protected java.lang.String
databaseEngine
Database engine name.protected EventBusApi
eventBusApi
protected java.lang.String
implVersion
Indexserver version and build number.protected IXConnIXServicePortIF_2
ixVal
Encapsulated Indexserver interface that obtains interface functions without ClientInfo parameter.protected IXConnectionIF
normalizedConnection
Cached normalized connection created bynormalized()
.protected java.lang.String
url
Indexserver URL -
Constructor Summary
Constructors Modifier Constructor Description protected
IXConnection(IXConnection rhs, IXAuthenticationIF auth, byps.BTransport transport)
Copy constructor.protected
IXConnection(IXConnFactory connFact, de.elo.ix.client.BClient_Indexserver bclient, IXAuthenticationIF auth, java.lang.String url, java.util.Properties connProps)
Constructor. -
Method Summary
Modifier and Type Method Description LoginResult
activateRoles(java.util.List<java.lang.Integer> roleIds)
Replace the currently activated functional roles.void
addAfterCloseListener(IXConnectionCloseListener lsn)
Add callback interface that is called after connection has been closed.void
addAuthenticationListener(IXAuthenticationListener lsn)
Add callback interface that is called if authentication is renewed.void
addBeforeCloseListener(IXConnectionCloseListener lsn)
Add callback interface that is called before connection is closed.ApplyForNotificationsInfo
applyForNotifications(ApplyForNotificationsInfo info, de.elo.ix.client.notify.BSkeleton_ClientNotification clientNotification)
Specify, which notifications should be sent by the server.void
close()
Disconnect the IXConnection object and maybe logout the session.IXConnection
createConnectionForUser(java.lang.String runAsName)
Creates new connection for a "run as" user, running on the already existent ticket.protected IXConnectionIF
createNormalizedConnection()
Create a normalized connection object.java.lang.String
dateToIso(java.util.Date dt)
Convert a java.util.Date into an ISO date related to the current timezone.java.io.InputStream
download(java.lang.String downloadUrl, long offset, long length)
void
download(java.lang.String url, long offset, long length, IXClientIF.ContentStream cstrm)
Download bytes from the given URL.void
download(java.lang.String url, long offset, long length, java.io.File file)
void
download(java.lang.String url, java.io.File file)
Download a file from the given URL.java.lang.String
encryptPassword(java.lang.String s)
Encrytps a password used to login or to supply an encryption set password.java.lang.String
getApprovedToken()
Return CSRF token to send approved REST requests.EAuthenticationType
getAuthenticationType()
java.lang.String
getClientVersion()
Returns the version of the IXClient class, resp. the latest binary protocol version the IXClient class can understand.java.util.Properties
getConnProperties()
Get the connection properties.IXServicePortC
getCONST()
Constants.void
getCONST(byps.BAsyncResult<IXServicePortC> asyncResult)
Constants.java.lang.String
getDatabaseEngine()
Returns the name of the database engine (MSSQL, ORACLE, DB2).java.lang.String
getEndpointUrl()
Retuns the Indexserver URLEventBusApi
getEventBusApi()
de.elo.ix.client.feed.FeedServiceAuth
getFeedService()
Get service interface for document feed.java.lang.String
getFileExt(java.io.File file)
Returns the file extension of the given file name without dot.java.lang.String
getFileExt(java.lang.String fileName)
java.lang.String
getFileMd5(java.io.File file)
Computes the MD5 hash for the given file.de.elo.ix.client.fio.FioServiceAuth
getFioService()
de.elo.ix.client.health.HealthCheckServiceAuth
getHealthCheckService()
Get service interface for the health check service.java.net.HttpCookie
getHttpCookie(java.lang.String name)
Get HTTP session cookie.java.lang.String
getHttpSession()
Return HTTP session ID.java.lang.String
getImplVersion()
Detect Indexserver version with build number.java.lang.String
getInterfaceVersion()
Detect Indexserver SOAP interface version.de.elo.ix.client.ldap.LdapServiceAuth
getLdapService()
Get service interface for accessing LDAP.IXConnLogin
getLogin()
Deprecated.LoginResult
getLoginResult()
Get LoginResult object.int
getMajorVersion()
de.elo.ix.client.myelo.MyELOServiceAuth
getMyELOService()
de.elo.ix.client.plugin.PluginServiceAuth
getPluginService()
Get service interface for accessing plugins.de.elo.ix.client.compatibility.RawStreamServiceAuth
getRawStreamService()
java.util.Date
getServerTime()
Gets the current server time.IXProperties
getSessionOptions()
Get the session options.java.lang.String
getStreamVersion()
Returns the negotiated stream version.de.elo.ix.client.system.SystemInformationAuth
getSystemInformation()
int
getUserId()
Get current user ID.java.lang.String
getUserName()
Get current user name.java.lang.String
getVersion()
Detect Indexserver version without build number.protected void
internalLogout()
boolean
isExpired()
Returns true, if the session is expired.java.util.Date
isoToDate(java.lang.String iso)
Convert an ISO date to a java.util.Date.IXConnIXServicePortIF_2
ix()
Get Indexserver API object.void
logout()
Deprecated.Use close instead.static java.lang.String[]
makeRawStreamServiceParamsFromUrl(java.lang.String url)
IXConnectionIF
normalized()
Provide a new connection object with the same session ticket initialized with language en, country US and timezone UTC.LoginResult
refreshLoginResult()
Update the current user permissions in this connection object.void
removeAfterCloseListener(IXConnectionCloseListener lsn)
Remove callback interface that is called after connection has been closed.void
removeAuthenticationListener(IXAuthenticationListener lsn)
Remove callback interface for authentication.void
removeBeforeCloseListener(IXConnectionCloseListener lsn)
Remove callback interface that is called before connection is closed.void
setFeedNotification(de.elo.ix.client.feed.BSkeleton_FeedNotification feedNotification)
Set notification interface for document feed events.void
setLostReverseConnectionHandler(byps.BLostConnectionHandler lostConnectionHandler)
Assign callback interface that is called if the connection is lost.static java.lang.String
staticDateToIso(java.util.Date dt, boolean toUtc)
Convert a java.util.Date object into a ISO date string.static java.util.Date
staticIsoToDate(java.lang.String iso, boolean isUtc)
Convert an ISO date into a java.util.Date object.java.lang.String
toString()
java.lang.String
truncate(java.lang.String s, int max)
This function truncates s to the length of max.java.lang.String
upload(java.lang.String url, java.io.File file)
Upload a file to the given URL.java.lang.String
upload(java.lang.String url, java.io.InputStream is, long contentLength, java.lang.String contentType)
Upload the bytes of a InputStream object to the given URL.
-
Field Details
-
ixVal
Encapsulated Indexserver interface that obtains interface functions without ClientInfo parameter. Use this object to access the Indexserver. -
connProps
protected java.util.Properties connPropsConnection properties. This properties are the same that have beed supplied to the IXConnFactory object. -
databaseEngine
protected java.lang.String databaseEngineDatabase engine name. -
implVersion
protected java.lang.String implVersionIndexserver version and build number. -
eventBusApi
-
bclient
protected final de.elo.ix.client.BClient_Indexserver bclient -
auth
-
url
protected final java.lang.String urlIndexserver URL -
CONST
-
connLogin
Deprecated.Compatibilty with API 7.0 and 8.0. -
connFact
Deprecated.Compatibilty with API 7.0 and 8.0. -
beforeCloseListener
Listeners to be called before a connection is closed. -
afterCloseListener
Listeners to be called after a connection has been closed. -
normalizedConnection
Cached normalized connection created bynormalized()
. EIX-1988
-
-
Constructor Details
-
IXConnection
protected IXConnection(IXConnFactory connFact, de.elo.ix.client.BClient_Indexserver bclient, IXAuthenticationIF auth, java.lang.String url, java.util.Properties connProps)Constructor. Usually, objects of the IXConnection class are instanciate by one of the create methods of the IXConnFactory class.- Parameters:
connFact
- IXConnFactory object used in getLogin() to obtain an ELO 8.0 compatible IXConnLogin object. Can be null, if getLogin() is not used.bclient
- BClient objectauth
- Authentication callback interfaceurl
- Indexserver URLconnProps
- Connection properties.
-
IXConnection
Copy constructor. This constructor is used to create a normalized connection.- Parameters:
rhs
- base connectionauth
- authentication handlertransport
- BYPS transport
-
-
Method Details
-
ix
Description copied from interface:IXConnectionIF
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.- Specified by:
ix
in interfaceIXConnectionIF
- Returns:
- Indexserver interface object.
-
getLoginResult
Description copied from interface:IXConnectionIF
Get LoginResult object.- Specified by:
getLoginResult
in interfaceIXConnectionIF
- Returns:
- LoginResult object.
-
getUserId
public int getUserId()Description copied from interface:IXConnectionIF
Get current user ID.- Specified by:
getUserId
in interfaceIXConnectionIF
- Returns:
- User ID.
-
getUserName
public java.lang.String getUserName()Description copied from interface:IXConnectionIF
Get current user name.- Specified by:
getUserName
in interfaceIXConnectionIF
- Returns:
- User name.
-
getConnProperties
public java.util.Properties getConnProperties()Description copied from interface:IXConnectionIF
Get the connection properties.- Specified by:
getConnProperties
in interfaceIXConnectionIF
- Returns:
- Connection properties.
-
getEndpointUrl
public java.lang.String getEndpointUrl()Description copied from interface:IXConnectionIF
Retuns the Indexserver URL- Specified by:
getEndpointUrl
in interfaceIXConnectionIF
- Returns:
- URL
-
getSessionOptions
Description copied from interface:IXConnectionIF
Get the session options. They are requested from the IXConnLogin object.- Specified by:
getSessionOptions
in interfaceIXConnectionIF
- Returns:
- Session options.
- See Also:
SessionOptions
-
getVersion
public java.lang.String getVersion()Description copied from interface:IXConnectionIF
Detect Indexserver version without build number.- Specified by:
getVersion
in interfaceIXConnectionIF
- Returns:
- IX-Version
-
getMajorVersion
public int getMajorVersion()- Returns:
- MajorVersion as int
-
getImplVersion
public java.lang.String getImplVersion()Description copied from interface:IXConnectionIF
Detect Indexserver version with build number.- Specified by:
getImplVersion
in interfaceIXConnectionIF
- Returns:
- IX-Version
-
getInterfaceVersion
public java.lang.String getInterfaceVersion()Description copied from interface:IXConnectionIF
Detect Indexserver SOAP interface version.- Specified by:
getInterfaceVersion
in interfaceIXConnectionIF
- Returns:
- SOAP interface version
-
getClientVersion
public java.lang.String getClientVersion()Description copied from interface:IXConnectionIF
Returns the version of the IXClient class, resp. the latest binary protocol version the IXClient class can understand.- Specified by:
getClientVersion
in interfaceIXConnectionIF
- Returns:
- latest protocol version
- See Also:
IXConnectionIF.getStreamVersion()
-
getStreamVersion
public java.lang.String getStreamVersion()Description copied from interface:IXConnectionIF
Returns the negotiated stream version.- Specified by:
getStreamVersion
in interfaceIXConnectionIF
- Returns:
- negotiated protocol version
-
getServerTime
public java.util.Date getServerTime() throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Gets the current server time.- Specified by:
getServerTime
in interfaceIXConnectionIF
- Returns:
- Server time.
- Throws:
byps.RemoteException
-
getCONST
Description copied from interface:IXConnectionIF
Constants.- Specified by:
getCONST
in interfaceIXConnectionIF
- Returns:
- Constant object.
- Throws:
byps.RemoteException
-
getCONST
Description copied from interface:IXConnectionIF
Constants.- Specified by:
getCONST
in interfaceIXConnectionIF
- Parameters:
asyncResult
- Callback interface that receives the result.
-
isoToDate
public java.util.Date isoToDate(java.lang.String iso)Description copied from interface:IXConnectionIF
Convert an ISO date to a java.util.Date. The ISO date is assumed to be in the timezone of the current session.- Specified by:
isoToDate
in interfaceIXConnectionIF
- Parameters:
iso
- ISO date- Returns:
- java.util.Date (always UTC, use java.util.Calendar for formatting)
-
dateToIso
public java.lang.String dateToIso(java.util.Date dt)Description copied from interface:IXConnectionIF
Convert a java.util.Date into an ISO date related to the current timezone.- Specified by:
dateToIso
in interfaceIXConnectionIF
- Parameters:
dt
- Java date object- Returns:
- ISO date
-
staticIsoToDate
public static java.util.Date staticIsoToDate(java.lang.String iso, boolean isUtc)Convert an ISO date into a java.util.Date object. Examples:iso isUtc return 20100401000000 false Thu Apr 01 00:00:00 CEST 2010 20100401000000 true Thu Apr 01 02:00:00 CEST 2010 - Parameters:
iso
- ISO dateisUtc
- true, if ISO date is in the UTC timezone.- Returns:
- Date object
-
staticDateToIso
public static java.lang.String staticDateToIso(java.util.Date dt, boolean toUtc)Convert a java.util.Date object into a ISO date string. Examples:dt toUtc return Tue Apr 13 21:33:58 CEST 2010 false 20100413213358 Tue Apr 13 21:33:58 CEST 2010 true 20100413193358 - Parameters:
dt
- Date objecttoUtc
- true, if the returned string should contain an UTC date.- Returns:
- ISO date
-
makeRawStreamServiceParamsFromUrl
public static java.lang.String[] makeRawStreamServiceParamsFromUrl(java.lang.String url) -
upload
public java.lang.String upload(java.lang.String url, java.io.File file) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Upload a file to the given URL.- Specified by:
upload
in interfaceIXConnectionIF
- Parameters:
url
- Destination URL.file
- File object.- Returns:
- Upload result from DM or IX.
- Throws:
byps.RemoteException
-
upload
public java.lang.String upload(java.lang.String url, java.io.InputStream is, long contentLength, java.lang.String contentType) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Upload the bytes of a InputStream object to the given URL.- Specified by:
upload
in interfaceIXConnectionIF
- 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
public void download(java.lang.String url, java.io.File file) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Download a file from the given URL.- Specified by:
download
in interfaceIXConnectionIF
- Parameters:
url
- URL to download.file
- The contents are stored in thisFile
object.- Throws:
byps.RemoteException
-
download
public void download(java.lang.String url, long offset, long length, IXClientIF.ContentStream cstrm) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Download bytes from the given URL.- Specified by:
download
in interfaceIXConnectionIF
- 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
public java.io.InputStream download(java.lang.String downloadUrl, long offset, long length) throws byps.RemoteException- Specified by:
download
in interfaceIXConnectionIF
- Throws:
byps.RemoteException
-
download
public void download(java.lang.String url, long offset, long length, java.io.File file) throws byps.RemoteException- Specified by:
download
in interfaceIXConnectionIF
- Throws:
byps.RemoteException
-
encryptPassword
public java.lang.String encryptPassword(java.lang.String s) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Encrytps a password used to login or to supply an encryption set password.- Specified by:
encryptPassword
in interfaceIXConnectionIF
- Parameters:
s
- Plain text password.- Returns:
- Encrypted password.
- Throws:
byps.RemoteException
-
logout
@Deprecated public void logout()Deprecated.Use close instead.Description copied from interface:IXConnectionIF
Internally calls close().- Specified by:
logout
in interfaceIXConnectionIF
-
close
public void close()Description copied from interface:IXConnectionIF
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceIXConnectionIF
-
internalLogout
protected void internalLogout() -
getFileExt
public java.lang.String getFileExt(java.lang.String fileName) -
getFileExt
public java.lang.String getFileExt(java.io.File file)Description copied from interface:IXConnectionIF
Returns the file extension of the given file name without dot.- Specified by:
getFileExt
in interfaceIXConnectionIF
- Parameters:
file
- File object.- Returns:
- File extension.
-
getFileMd5
public java.lang.String getFileMd5(java.io.File file) throws java.io.IOExceptionDescription copied from interface:IXConnectionIF
Computes the MD5 hash for the given file.- Specified by:
getFileMd5
in interfaceIXConnectionIF
- Parameters:
file
- File object.- Returns:
- MD5 hash in String format.
- Throws:
java.io.IOException
-
getDatabaseEngine
public java.lang.String getDatabaseEngine()Description copied from interface:IXConnectionIF
Returns the name of the database engine (MSSQL, ORACLE, DB2). If the conected Indexserver is older than 8.0, UNKNOWN is returned.- Specified by:
getDatabaseEngine
in interfaceIXConnectionIF
- Returns:
- Database engine name.
-
truncate
public java.lang.String truncate(java.lang.String s, int max)Description copied from interface:IXConnectionIF
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());
- Specified by:
truncate
in interfaceIXConnectionIF
- Parameters:
s
- String to be truncatedmax
- Database column width from a member length value of a constant class.- Returns:
- Truncated String or s.
-
getEventBusApi
- Specified by:
getEventBusApi
in interfaceIXConnectionIF
-
createConnectionForUser
public IXConnection createConnectionForUser(java.lang.String runAsName) throws byps.RemoteExceptionDescription copied from interface:IXConnectionIF
Creates new connection for a "run as" user, running on the already existent ticket.- Specified by:
createConnectionForUser
in interfaceIXConnectionIF
- Parameters:
runAsName
- User name- Returns:
- IXConnection object
- Throws:
byps.RemoteException
-
getFeedService
public de.elo.ix.client.feed.FeedServiceAuth getFeedService()Description copied from interface:IXConnectionIF
Get service interface for document feed.- Specified by:
getFeedService
in interfaceIXConnectionIF
- Returns:
- service interface.
-
getMyELOService
public de.elo.ix.client.myelo.MyELOServiceAuth getMyELOService() -
getSystemInformation
public de.elo.ix.client.system.SystemInformationAuth getSystemInformation() -
getHealthCheckService
public de.elo.ix.client.health.HealthCheckServiceAuth getHealthCheckService()Description copied from interface:IXConnectionIF
Get service interface for the health check service.- Specified by:
getHealthCheckService
in interfaceIXConnectionIF
- Returns:
- service interface.
-
setFeedNotification
public void setFeedNotification(de.elo.ix.client.feed.BSkeleton_FeedNotification feedNotification) throws byps.RemoteExceptionSet notification interface for document feed events.- Parameters:
feedNotification
- serivce interface- Throws:
byps.RemoteException
-
getRawStreamService
public de.elo.ix.client.compatibility.RawStreamServiceAuth getRawStreamService()- Specified by:
getRawStreamService
in interfaceIXConnectionIF
-
getPluginService
public de.elo.ix.client.plugin.PluginServiceAuth getPluginService()Description copied from interface:IXConnectionIF
Get service interface for accessing plugins.- Specified by:
getPluginService
in interfaceIXConnectionIF
- Returns:
- service interface.
-
getLdapService
public de.elo.ix.client.ldap.LdapServiceAuth getLdapService()Description copied from interface:IXConnectionIF
Get service interface for accessing LDAP.- Specified by:
getLdapService
in interfaceIXConnectionIF
- Returns:
- service interface.
-
applyForNotifications
public ApplyForNotificationsInfo applyForNotifications(ApplyForNotificationsInfo info, de.elo.ix.client.notify.BSkeleton_ClientNotification clientNotification) throws byps.RemoteExceptionSpecify, which notifications should be sent by the server.- Parameters:
info
- Parameter object or null, if only the current settings should be returned.clientNotification
- BSkeleton object with an implementation for the requested notifications.- Returns:
- previous settings
- Throws:
byps.RemoteException
- Since:
- 9.00.000.012
-
getLogin
Deprecated.Compatibility with ELO 7.0, ELO 8.0- Returns:
- IXConnLogin object
-
isExpired
public boolean isExpired()Description copied from interface:IXConnectionIF
Returns true, if the session is expired. The IXConnection object will automatically perform a re-login the next time an API function is called.- Specified by:
isExpired
in interfaceIXConnectionIF
- Returns:
- true, if session is expired.
-
getAuthenticationType
- Specified by:
getAuthenticationType
in interfaceIXConnectionIF
-
setLostReverseConnectionHandler
public void setLostReverseConnectionHandler(byps.BLostConnectionHandler lostConnectionHandler)Assign callback interface that is called if the connection is lost.- Parameters:
lostConnectionHandler
- listener object
-
addAuthenticationListener
Add callback interface that is called if authentication is renewed.- Parameters:
lsn
-
-
removeAuthenticationListener
Remove callback interface for authentication.- Parameters:
lsn
-
-
addBeforeCloseListener
Add callback interface that is called before connection is closed.- Parameters:
lsn
-
-
addAfterCloseListener
Add callback interface that is called after connection has been closed.- Parameters:
lsn
-
-
removeBeforeCloseListener
Remove callback interface that is called before connection is closed.- Parameters:
lsn
-
-
removeAfterCloseListener
Remove callback interface that is called after connection has been closed.- Parameters:
lsn
-
-
getFioService
public de.elo.ix.client.fio.FioServiceAuth getFioService() -
getHttpSession
public java.lang.String getHttpSession()Return HTTP session ID. Returns cookie JSESIONID supplied by Tomcat.- Specified by:
getHttpSession
in interfaceIXConnectionIF
- Returns:
- Session ID
-
getHttpCookie
public java.net.HttpCookie getHttpCookie(java.lang.String name)Get HTTP session cookie. Gets the cookie with the given name.- Specified by:
getHttpCookie
in interfaceIXConnectionIF
- Parameters:
name
- Cookie name, e.g. HConstants.HTTP_COOKIE_JSESSIONID- Returns:
- Session cookie.
-
activateRoles
public LoginResult activateRoles(java.util.List<java.lang.Integer> roleIds) throws byps.RemoteExceptionReplace the currently activated functional roles.- Specified by:
activateRoles
in interfaceIXConnectionIF
- Parameters:
roleIds
- IDs of roles to activate.- Returns:
- LoginResult object with updated permissions and group membership.
- Throws:
byps.RemoteException
-
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.- Specified by:
refreshLoginResult
in interfaceIXConnectionIF
- Returns:
- LoginResult object with updated permissions and group membership.
- Throws:
byps.RemoteException
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getApprovedToken
public java.lang.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 byIXConnectionIF.getHttpSession()
in each request.- Specified by:
getApprovedToken
in interfaceIXConnectionIF
- Returns:
- CSRF token.
-
createNormalizedConnection
Create a normalized connection object.- Returns:
- normalized connection
-
normalized
Provide a new connection object with the same session ticket initialized with language en, country US and timezone UTC. The returned normalized connection has itsClientInfo
values set as: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> } This normalized connection object assumes that values of
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.- Specified by:
normalized
in interfaceIXConnectionIF
- Returns:
- connection object
-