Interface IXConnectionIF

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
IXConnection, IXConnectionWrapper

public interface IXConnectionIF extends AutoCloseable
IXConnection interface. This interface defines the basic methods of the IXConnection class.
  • 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> 
       } 
       
       
      This normalized connection object assumes that values of Sord.IDateIso and Sord.XDateIso are in timezone UTC. Numeric index fields of type DocMaskLineC.TYPE_NUMBER_F1, DocMaskLineC.TYPE_NUMBER_F2, DocMaskLineC.TYPE_NUMBER_F4, and DocMaskLineC.TYPE_NUMBER_F6 use a point as decimal separator (1000th grouping separators are not allowed). Numeric fields of type DocMaskLineC.TYPE_NUMBER and DocMaskLineC.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

      IXConnectionIF normalized(ClientInfo ci)
      Provide a new connection object with the same session ticket initialized with language, country and timezone from the given ClientInfo. 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 String 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

      IXServicePortC getCONST() throws byps.RemoteException
      Constants.
      Returns:
      Constant object.
      Throws:
      byps.RemoteException
    • getCONST

      void getCONST(byps.BAsyncResult<IXServicePortC> asyncResult)
      Constants.
      Parameters:
      asyncResult - Callback interface that receives the result.
    • isoToDate

      Date isoToDate(String iso)
      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

      String dateToIso(Date dt)
      Convert a java.util.Date into an ISO date related to the current timezone.
      Parameters:
      dt - Java date object
      Returns:
      ISO date
    • upload

      String upload(String url, File file) throws byps.RemoteException
      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 in is.
      contentType - MIME type of the data contained in is.
      Throws:
      byps.RemoteException
    • download

      void download(String url, File file) throws byps.RemoteException
      Download a file from the given URL.
      Parameters:
      url - URL to download.
      file - The contents are stored in this File 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

      InputStream download(String url, long offset, long length) throws byps.RemoteException
      Throws:
      byps.RemoteException
    • download

      void download(String url, long offset, long length, File file) throws byps.RemoteException
      Throws:
      byps.RemoteException
    • encryptPassword

      String encryptPassword(String s) throws byps.RemoteException
      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 void logout()
      Deprecated.
      Since the Interface extends AutoCloseable, the usage of the method close() 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 by IXConnFactory.createFromTicket(ClientInfo).
      Specified by:
      close in interface AutoCloseable
    • getFileExt

      String getFileExt(File file)
      Returns the file extension of the given file name without dot.
      Parameters:
      file - File object.
      Returns:
      File extension.
    • getFileMd5

      String getFileMd5(File file) throws IOException
      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

      String truncate(String s, int max)
      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 truncated
      max - Database column width from a member length value of a constant class.
      Returns:
      Truncated String or s.
    • getEventBusApi

      EventBusApi getEventBusApi()
    • createConnectionForUser

      IXConnection createConnectionForUser(String runAsName) throws byps.RemoteException
      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

      HttpCookie getHttpCookie(String name)
      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

      void setHttpCookies(List<HttpCookie> cookies)
      Set (replace) all HTTP cookies. EIX-3415
      Parameters:
      cookies - cookies
    • activateRoles

      LoginResult activateRoles(List<Integer> roleIds) throws byps.RemoteException
      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

      LoginResult refreshLoginResult() throws byps.RemoteException
      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 header SessionManagement.HTTP_SESSION_HEADER_APPROVED in addition to the cookie returned by getHttpSession() in each request.
      Returns:
      CSRF token.
    • getInstanceName

      String getInstanceName()
      Return IXID defined in Indexserver options.
      Returns:
      Instance name