Interface D2Session



  • public interface D2Session
    Representation of session object in D2000 application server.
    • Method Detail

      • callRPC

        FutureEvent<sk.ipesoft.d2000.base.UnivalValue<?>[]> callRPC​(boolean useJava,
                                                                    int processHobj,
                                                                    int eventHobj,
                                                                    int eventInstance,
                                                                    java.lang.String procedureName,
                                                                    sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure synchronously and return result of the call.

        Note: Result of the call is an array with the same length as arguments but only values of INOUT parameters are set. Positions of IN parameters are set to null.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of event (default 0)
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
        Returns:
        future array with values of output parameters
      • callRPC

        FutureEvent<sk.ipesoft.d2000.base.UnivalValue<?>[]> callRPC​(boolean useJava,
                                                                    int processHobj,
                                                                    int eventHobj,
                                                                    int eventInstance,
                                                                    int interfaceHobj,
                                                                    java.lang.String procedureName,
                                                                    sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure synchronously and return result of the call.

        Note: Result of the call is an array with the same length as arguments but only values of INOUT parameters are set. Positions of IN parameters are set to null.

        Warning: It is impossible to implement ESL interface in internal Java. Combination of argument values useJava == true and interfaceHobj != 0 therefore always addresses nonexistent RPC.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of event (default 0)
        interfaceHobj - HOBJ of ESL interface that defines called RPC
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
        Returns:
        future array with values of output parameters
      • callRPC

        FutureEvent<sk.ipesoft.d2000.base.UnivalValue<?>[]> callRPC​(boolean useJava,
                                                                    int processHobj,
                                                                    int eventHobj,
                                                                    java.lang.String procedureName,
                                                                    sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure synchronously and return result of the call.

        Note: Result of the call is an array with the same length as arguments but only values of INOUT parameters are set. Positions of IN parameters are set to null.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
        Returns:
        future array with values of output parameters
      • callRPCNoreplyBeginBatchConversation

        RPCConversationContext callRPCNoreplyBeginBatchConversation​(boolean useJava,
                                                                    int processHobj,
                                                                    int eventHobj,
                                                                    int eventInstance,
                                                                    int interfaceHobj,
                                                                    java.lang.String procedureName,
                                                                    sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure asynchronously and begin batch conversation.

        Batch conversation is one-way conversation where initiator sends a batch of messages but does not receive any notification or message from target.

        Parameters:
        useJava - true if target is in D2000 internal java
        processHobj - HOBJ of EVH
        eventHobj - HOBJ of Event
        eventInstance - number of Event instance or 0
        interfaceHobj - HOBJ of ESL interface if RPC is implementation
        procedureName - name of target procedure
        arguments - arguments of RPC call
        Returns:
        conversation context
      • callRPCNoreplyBeginConversation

        RPCConversationContext callRPCNoreplyBeginConversation​(boolean useJava,
                                                               int processHobj,
                                                               int eventHobj,
                                                               int eventInstance,
                                                               int interfaceHobj,
                                                               java.lang.String procedureName,
                                                               sk.ipesoft.d2000.base.UnivalValue<?>[] arguments,
                                                               RPCConversationHandler conversationHandler)
        Call RPC procedure asynchronously and begin standard conversation.

        In standard conversation both partners are available to send messages and are notified on partners state.

        Parameters:
        useJava - true if target is in D2000 internal java
        processHobj - HOBJ of EVH
        eventHobj - HOBJ of Event
        eventInstance - number of Event instance or 0
        interfaceHobj - HOBJ of ESL interface if RPC is implementation
        procedureName - name of target procedure
        arguments - arguments of RPC call
        conversationHandler - handler for receiving messages from target
        Returns:
        conversation context
      • callRPCNoreplyBeginConversation

        RPCConversationContext callRPCNoreplyBeginConversation​(boolean useJava,
                                                               int processHobj,
                                                               int eventHobj,
                                                               int eventInstance,
                                                               int interfaceHobj,
                                                               java.lang.String procedureName,
                                                               sk.ipesoft.d2000.base.UnivalValue<?>[] arguments,
                                                               RPCConversationManagedHandler conversationHandler)
        Call RPC procedure asynchronously and begin standard conversation.

        In standard conversation both partners are available to send messages and are notified on partners state.

        Parameters:
        useJava - true if target is in D2000 internal java
        processHobj - HOBJ of EVH
        eventHobj - HOBJ of Event
        eventInstance - number of Event instance or 0
        interfaceHobj - HOBJ of ESL interface if RPC is implementation
        procedureName - name of target procedure
        arguments - arguments of RPC call
        conversationHandler - handler for receiving messages from target
        Returns:
        conversation context
      • callRPCNoreplyBeginEndConversation

        void callRPCNoreplyBeginEndConversation​(boolean useJava,
                                                int processHobj,
                                                int eventHobj,
                                                int eventInstance,
                                                int interfaceHobj,
                                                java.lang.String procedureName,
                                                sk.ipesoft.d2000.base.UnivalValue<?>[] arguments,
                                                RPCConversationHandler conversationHandler)
        Call RPC procedure asynchronously and begin conversation with closing initiators side immediately.

        Initiating message is a request that is also the last message from the initiator. Target is supposed to respond in one or several messages although it is not being notified on initiators state.

        Parameters:
        useJava - true if target is in D2000 internal java
        processHobj - HOBJ of EVH
        eventHobj - HOBJ of Event
        eventInstance - number of Event instance or 0
        interfaceHobj - HOBJ of ESL interface if RPC is implementation
        procedureName - name of target procedure
        arguments - arguments of RPC call
        conversationHandler - handler for receiving messages from target
      • callRPCNoreplyBeginEndConversation

        void callRPCNoreplyBeginEndConversation​(boolean useJava,
                                                int processHobj,
                                                int eventHobj,
                                                int eventInstance,
                                                int interfaceHobj,
                                                java.lang.String procedureName,
                                                sk.ipesoft.d2000.base.UnivalValue<?>[] arguments,
                                                RPCConversationManagedHandler conversationHandler)
        Call RPC procedure asynchronously and begin conversation with closing initiators side immediately.

        Initiating message is a request that is also the last message from the initiator. Target is supposed to respond in one or several messages although it is not being notified on initiators state.

        Parameters:
        useJava - true if target is in D2000 internal java
        processHobj - HOBJ of EVH
        eventHobj - HOBJ of Event
        eventInstance - number of Event instance or 0
        interfaceHobj - HOBJ of ESL interface if RPC is implementation
        procedureName - name of target procedure
        arguments - arguments of RPC call
        conversationHandler - handler for receiving messages from target
      • callRPCNoreply

        void callRPCNoreply​(boolean useJava,
                            int processHobj,
                            int eventHobj,
                            int eventInstance,
                            java.lang.String procedureName,
                            sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure asynchronously.

        Warning: Asynchronous call of a RPC only means that a request is sent from JAPI to Kernel. No information considering success of the delivery of the request or execution of RPC is returned. Not even in case of wrong name of RPC, type mismatch of an argument, stopped EVH or nonexistent Event.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of event (default 0)
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
      • callRPCNoreply

        void callRPCNoreply​(boolean useJava,
                            int processHobj,
                            int eventHobj,
                            int eventInstance,
                            int interfaceHobj,
                            java.lang.String procedureName,
                            sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure asynchronously.

        Warning: Asynchronous call of a RPC only means that a request is sent from JAPI to Kernel. No information considering success of the delivery of the request or execution of RPC is returned. Not even in case of wrong name of RPC, type mismatch of an argument, stopped EVH or nonexistent Event.

        Warning: It is impossible to implement ESL interface in internal Java. Combination of argument values useJava == true and interfaceHobj != 0 therefore always addresses nonexistent RPC.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of event (default 0)
        interfaceHobj - HOBJ of ESL interface that defines called RPC
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
      • callRPCNoreply

        void callRPCNoreply​(boolean useJava,
                            int processHobj,
                            int eventHobj,
                            java.lang.String procedureName,
                            sk.ipesoft.d2000.base.UnivalValue<?>[] arguments)
        Call RPC procedure asynchronously.

        Warning: Asynchronous call of a RPC only means that a request is sent from JAPI to Kernel. No information considering success of the delivery of the request or execution of RPC is returned. Not even in case of wrong name of RPC, type mismatch of an argument, stopped EVH or nonexistent Event.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        procedureName - name of target RPC procedure
        arguments - arguments of procedure call
      • callSBA

        FutureEvent<byte[]> callSBA​(int processHobj,
                                    int eventHobj,
                                    int eventInstance,
                                    java.lang.String procedureName,
                                    byte[] data)
        Call RPC procedure with synchronous ByteArray signature and return result of the call.

        Called RPC has one formal parameter of byte[] type and byte[] as its return type. Called RPC cannot be implemented in ESL, since there is no language construction for using type byte[].

        Parameters:
        processHobj - HOBJ of event process where procedure is located
        eventHobj - HOBJ of event script
        eventInstance - instance number of event script instance (default is 0)
        procedureName - name of the RPC
        data - argument of the call
        Returns:
        future byte array returned from the RPC
      • callSBANoreply

        void callSBANoreply​(int processHobj,
                            int eventHobj,
                            int eventInstance,
                            java.lang.String procedureName,
                            byte[] data)
        Call RPC procedure with asynchronous ByteArray signature.

        Called RPC has one formal parameter of byte[] type and void as its return type. Called RPC cannot be implemented in ESL, since there is no language construction for using type byte[].

        Warning: Asynchronous call of a RPC only means that a request is sent from JAPI to Kernel. No information considering success of the delivery of the request or execution of RPC is returned. Not even in case of wrong name of RPC, type mismatch of an argument, stopped EVH or nonexistent Event.

        Parameters:
        processHobj - HOBJ of event process where procedure is located
        eventHobj - HOBJ of event script
        eventInstance - instance number of event script instance (default is 0)
        procedureName - name of the RPC
        data - argument of the call
      • changeConsoleInfo

        FutureEvent<D2ConsoleInfo> changeConsoleInfo​(java.lang.String oldConsole,
                                                     java.lang.String newConsole)
        Create, change or delete console in list of consoles for NamedDevice licensing model and get changed list of consoles.

        To create new console set oldConsole to null and newConsole to new unique identifier. To edit existing console set oldConsole to current name of the console and newConsole to new unique identifier. To delete existing console set oldConsole to current name of the console and newConsole to null.

        Parameters:
        oldConsole - current name of console or null
        newConsole - new unique name of console or null
        Returns:
        future list of consoles after it has been modified
      • changePassword

        FutureEvent<ChangePasswordResult> changePassword​(java.lang.String oldPassword,
                                                         java.lang.String newPassword)
        Change password of current user.
        Parameters:
        oldPassword - users current password
        newPassword - users new password
        Returns:
        future result of operation in kernel
      • close

        FutureEvent<D2JapiErrorCode> close​()
        Close the session instance and delete its counterpart ".DCC" object from D2000 DODM. Instance should not be used after being closed.
        Returns:
        Future errorcode signaling that close operation has been finished
      • consoleInfo

        @Deprecated
        FutureEvent<D2ConsoleInfo> consoleInfo​()
        Deprecated. As of R39, replaced by getConsoleInfo()
        Get list of consoles for NamedDevice licensing model.
        Returns:
        future list of consoles
      • createDictionaryConvertor

        Convertor createDictionaryConvertor​()
        Create new instance of dictionary convertor for session default language.
        Returns:
        dictionary convertor for specified language
      • createDictionaryTranslator

        Translator createDictionaryTranslator​()
        Create new instance of dictionary translator for session default language.
        Returns:
        dictionary translator for specified language
      • execRTICommand

        FutureEvent<java.lang.String> execRTICommand​(D2RTIProviderHandle providerHandle,
                                                     java.lang.String command)
        Execute RTI (Runtime Information) command on RTI provider and get result of the execution.

        Note: One can obtain valid value for providerHandle as a result of getRTIProviders(int).

        Warning: RTI commands are for internal use only and are not publicly documented.

        Parameters:
        providerHandle - handle to RTI context
        command - RTI command
        Returns:
        result of executed RTI command
      • getApplicationTimeZone

        java.util.TimeZone getApplicationTimeZone​()
        Get time zone of D2000 kernel. May return local time zone if kernel doesn't provide time zone information.
        Returns:
        default application time zone
      • getArchiveValues

        FutureEvent<java.lang.Boolean> getArchiveValues​(int archivedObjectHobj,
                                                        int rowIndex,
                                                        int columnIndex,
                                                        java.util.Date beginTime,
                                                        java.util.Date endTime,
                                                        int oversampleStep,
                                                        int limitDataLength,
                                                        ArchiveDataListener dataListener)
        Get values of archived object from D2000 archive with data and description listener.

        Note: Values are sent from archive in chunks, because result may contain too many values for one message. Chunks are received asynchronously by dataListener. Chunks and values within one chunk are ordered chronologically.

        Note: Result of the call indicating success of the call is available via returned future only after the first call to either ArchiveDataListener.onArchiveData(UnivalValue[], boolean) or ArchiveDataListener.onError(D2JapiErrorCode)

        Parameters:
        archivedObjectHobj - HOBJ of archived object
        rowIndex - one-based index of row in case of archived structured value, zero otherwise
        columnIndex - one-based index of column in case of archived structured value, zero otherwise
        beginTime - beginning of requested time interval in UTC
        endTime - end of requested time interval in UTC
        oversampleStep - number of seconds for oversampling archived data or zero for raw archived data
        limitDataLength - maximal number of returned values totaling all chunks or negative value for unlimited number
        dataListener - listener for receiving chunks of archived values and description of archive object
        Returns:
        future boolean indicating success of accessing archived data
      • getArchiveValues

        FutureEvent<ArchiveDataProvider> getArchiveValues​(int archivedObjectHobj,
                                                          int rowIndex,
                                                          int columnIndex,
                                                          java.util.Date beginTime,
                                                          java.util.Date endTime,
                                                          int oversampleStepSeconds,
                                                          int limitDataLength)
        Get values of archived object from D2000 archive with data provider.

        Note: Values are sent from archive in chunks, because result may contain too many values for one message. Returned data provider makes them available also in chunks since each call to ArchiveDataProvider.waitForData() or ArchiveDataProvider.waitForData(long) return next chunk.

        Parameters:
        archivedObjectHobj - HOBJ of archived object
        rowIndex - one-based index of row in case of archived structured value, zero otherwise
        columnIndex - one-based index of column in case of archived structured value, zero otherwise
        beginTime - beginning of requested time interval in UTC
        endTime - end of requested time interval in UTC
        oversampleStepSeconds - number of seconds for oversampling archived data or zero for raw archived data
        limitDataLength - maximal number of returned values totaling all chunks or negative value for unlimited number
        Returns:
        future data provider
      • getArchiveValuesThroughStatisticalFunction

        FutureEvent<sk.ipesoft.d2000.base.UnivalValue<?>[]> getArchiveValuesThroughStatisticalFunction​(int archivedObjectHobj,
                                                                                                       int rowIndex,
                                                                                                       int columnIndex,
                                                                                                       java.util.Date beginTime,
                                                                                                       java.util.Date endTime,
                                                                                                       int oversampleStepSeconds,
                                                                                                       int deepTimeSeconds,
                                                                                                       ArchiveStatisticalFunction function,
                                                                                                       int validityThresholdPercentage,
                                                                                                       ArchiveIntegralUnit integralUnit,
                                                                                                       double referenceValue)
        Get values of archived object from D2000 archive transformed through chosen statistical function.

        Result array contains following values:
        For every i in range 0 .. floor((endTime - beginTime) / oversampleStep)
        result[i] = function(archivedValues[(beginTime + i * oversampleStep - deepTime) .. (beginTime + i * oversampleStep)])

        Parameters:
        archivedObjectHobj - HOBJ of archived object
        rowIndex - one-based index of row in case of archived structured value, zero otherwise
        columnIndex - one-based index of column in case of archived structured value, zero otherwise
        beginTime - beginning of requested time interval in UTC
        endTime - end of requested time interval in UTC
        oversampleStepSeconds - number of seconds for oversampling archived data or zero for raw archived data
        deepTimeSeconds - number of seconds that one computation of result takes
        function - type of statistical function to use
        validityThresholdPercentage - number in range 0 .. 100 expressing required minimal percentage of valid values within deepTime range to mark the result valid value. Otherwise it is marked weak.
        integralUnit - parameter for integral function. It is ignored and can be null otherwise.
        referenceValue - parameter for certain types of functions.
        Returns:
        future array of unival values
      • getAuditResourceGroupOperations

        void getAuditResourceGroupOperations​(java.util.Date fromTimeStamp,
                                             int fromSerialNumber,
                                             java.util.Date toTimeStamp,
                                             int toSerialNumber,
                                             int countLimit,
                                             java.lang.String userName,
                                             java.lang.String resourceGroupName,
                                             java.lang.String processName,
                                             java.lang.String computerName,
                                             AuditResourceGroupOperationType operationType,
                                             AuditResourceGroupListener listener)
        Obatin filtered list of audited activities concerning D2000 resource group objects.

        Note: each audited record has unique identifier composed of writeTime and serialNumber. writeTime is time (with miliseconds resolution) of the record being persisted. serialNumber is used to distinguish records persisted at the same time with first of them having serialNumber == 0 and each next having it increased by one.

        Filtering by writeTime and serialNumber works as follows:

        • fromTimeStamp == D && fromSerialNumber == N includes all records with (writeTime == D && serialNumber >= N) || (writeTime > D)
        • toTimeStamp == D && toSerialNumber == N includes all records with (writeTime < D) || (writeTime == D || serialNumber < N)

        Warning: Returned list is limited in size explicitly by parameter sizeLimit and also implicitly by Kernel. It is therefore possible that only limited number of records from the begining of the of chronologically ordered list of all items that fit the filtering criteria is returned. To make sure, that there are no more records available, one should call the method in cycle described in pseudocode for parameters set to:

        • fromTimeStamp == BT
        • fromSerialNumber == BN
        • toTimeStamp == ER
        • toSerialNumber == EN
        • values of other parameters are not interesting in this example, they are just simply kept the same all the time
         
         SET result WITH empty list
         SET currentBT WITH BT
         SET currentBN WITH BN
         LOOP
           singleResult = getOperations(currentBT, currentBN, ET, EN, ...)
           IF singleResult IS EMPTY
           THEN
             BREAK LOOP
           ELSE
             APPEND singleResult INTO result
             SET lastItem WITH LAST FROM singleResult
             SET currentBT WITH lastItem.writeTime
             SET currentBN WITH lastItem.serialNumber + 1
           END IF
         END LOOP
         
         
        Parameters:
        fromTimeStamp - mandatory inclusive lower bound for filtering by writeTime in UTC
        fromSerialNumber - mandatory inclusive lower bound for filtering by serialNumber
        toTimeStamp - mandatory inclusive upper bound for filtering by writeTime in UTC
        toSerialNumber - mandatory exclusive upper bound for filtering by serialNumber
        countLimit - mandatory limit the maximum count of returned item.
        userName - optional limit on specified userName or null for any.
        resourceGroupName - optional limit on specified resorceGroupName or null for any.
        processName - optional limit on specified processName or null for any.
        computerName - optional limit on specified computerName or null for any.
        operationType - optional limit on specified operationType or null for any.
        listener - reference to listener that will receive data in chunks
      • getAuditUserOperations

        void getAuditUserOperations​(java.util.Date fromTimeStamp,
                                    int fromSerialNumber,
                                    java.util.Date toTimeStamp,
                                    int toSerialNumber,
                                    int countLimit,
                                    java.lang.String userName,
                                    java.lang.String processName,
                                    java.lang.String computerName,
                                    AuditUserOperationType operationType,
                                    AuditUserListener listener)
        Obatin filtered list of audited activities concerning D2000 user objects.

        Note: each audited record has unique identifier composed of writeTime and serialNumber. writeTime is time (with miliseconds resolution) of the record being persisted. serialNumber is used to distinguish records persisted at the same time with first of them having serialNumber == 0 and each next having it increased by one.

        Filtering by writeTime and serialNumber works as follows:

        • fromTimeStamp == D && fromSerialNumber == N includes all records with (writeTime == D && serialNumber >= N) || (writeTime > D)
        • toTimeStamp == D && toSerialNumber == N includes all records with (writeTime < D) || (writeTime == D || serialNumber < N)

        Warning: Returned list is limited in size explicitly by parameter sizeLimit and also implicitly by Kernel. It is therefore possible that only limited number of records from the begining of the of chronologically ordered list of all items that fit the filtering criteria is returned. To make sure, that there are no more records available, one should call the method in cycle described in pseudocode for parameters set to:

        • fromTimeStamp == BT
        • fromSerialNumber == BN
        • toTimeStamp == ER
        • toSerialNumber == EN
        • values of other parameters are not interesting in this example, they are just simply kept the same all the time
         
         SET result WITH empty list
         SET currentBT WITH BT
         SET currentBN WITH BN
         LOOP
           singleResult = getOperations(currentBT, currentBN, ET, EN, ...)
           IF singleResult IS EMPTY
           THEN
             BREAK LOOP
           ELSE
             APPEND singleResult INTO result
             SET lastItem WITH LAST FROM singleResult
             SET currentBT WITH lastItem.writeTime
             SET currentBN WITH lastItem.serialNumber + 1
           END IF
         END LOOP
         
         
        Parameters:
        fromTimeStamp - mandatory inclusive lower bound for filtering by writeTime in UTC
        fromSerialNumber - mandatory inclusive lower bound for filtering by serialNumber
        toTimeStamp - mandatory inclusive upper bound for filtering by writeTime in UTC
        toSerialNumber - mandatory exclusive upper bound for filtering by serialNumber
        countLimit - mandatory limit the maximum count of returned item.
        userName - optional limit on specified userName or null for any.
        processName - optional limit on specified processName or null for any.
        computerName - optional limit on specified computerName or null for any.
        operationType - optional limit on specified operationType or null for any.
        listener - reference to listener that will receive data in chunks
      • getConnector

        D2Connector getConnector​()
        Get actual connector used by this session.
        Returns:
        connector instance
      • getConsoleInfo

        FutureEvent<D2ConsoleInfo> getConsoleInfo​()
        Get list of consoles for NamedDevice licensing model.
        Returns:
        future list of consoles
      • getDebugInfoCategories

        FutureEvent<DebugInfoCategory[]> getDebugInfoCategories​(int processHobj)
        Retrieves list of debug categories (levels) supported by existing and running D2000 process.
        Parameters:
        processHobj - HOBJ of process
        Returns:
        future array of supported debug categories
      • getHobj

        int getHobj​()
        Get HOBJ - unique indentifier of the session's counter part ".DCC" object within D2000 DODM.
        Returns:
        HOBJ of the session object
      • getLicenseStatus

        FutureEvent<D2LicenseStatus> getLicenseStatus​()
        Get information about current license state.
        Returns:
        future state of current license
      • getLoggedUserInformation

        LoggedUserInformation getLoggedUserInformation​()
        Get information about D2000 user account that has been used to authenticate current session.
        Returns:
        information about used user account
      • getMetainfo

        java.lang.String getMetainfo​()
        Get metainfo for current session.
        Returns:
        metainfo
      • getName

        java.lang.String getName​()
        Get name of the session as provided in D2SessionParameters.

        This name is used as a base of process name by D2000 kernel. Kernel however appends more text so that the process name uniquely identifies the process object within DODM. Kernel appends extension ".DCC" to the process name to distinguish it as a "D2000 Connector Client". It may optionally insert "_XXXX" (where XXXX stands for arbitrary number) in between provided name and extension in case that the process of the same name already exsists within the DODM.

        Returns:
        name of the session
      • getObjectInfo

        FutureEvent<D2ObjectInfo> getObjectInfo​(java.lang.String objectName)
        Get current configuration of an object in D2000 DODM identified by name.
        Parameters:
        objectName - name of the object
        Returns:
        future current configuration
      • getObjectInfo

        FutureEvent<D2ObjectInfo> getObjectInfo​(int objectHobj)
        Get current configuration of an object in D2000 DODM identified by HOBJ.
        Parameters:
        objectHobj - HOBJ of the object
        Returns:
        future current configuration
      • getRTIProviders

        FutureEvent<D2RTIProviderHandle[]> getRTIProviders​(int processHobj)
        Get list of RTI provider handles for D2000 process identified by HOBJ.

        Warning: RTI commands are for internal use only and are not publicly documented.

        Parameters:
        processHobj - HOBJ of process
        Returns:
        future array of RTI provider handles
      • getRedundancyState

        RedundancyStateType getRedundancyState​()
        Get current redundancy state;
        Returns:
        redundancy state
      • getStructDefInfo

        D2StructureDefinitionInfo getStructDefInfo​(int hobj)
        Get structure definition data for existing "SD." object identified by HOBJ.
        Parameters:
        hobj - HOBJ of "SD." object
        Returns:
        structure definition
      • getStructDefInfo

        D2StructureDefinitionInfo getStructDefInfo​(java.lang.String objectName)
        Get structure definition data for existing "SD." object identified by object name.
        Parameters:
        objectName - name of the object
        Returns:
        structure definition
      • getStructDefInfoList

        java.util.List<D2StructureDefinitionInfo> getStructDefInfoList​()
        Get all structure definitions in one list.
        Returns:
        list of all structure definitions
      • getSupportedTellComands

        FutureEvent<D2TellCmdInfo[]> getSupportedTellComands​(java.lang.String processName)
        Get array of tell commands supported by D2000 process identified by its name.
        Parameters:
        processName - name of process
        Returns:
        future array of supported tell commands
      • getSupportedTellComands

        FutureEvent<D2TellCmdInfo[]> getSupportedTellComands​(int processId)
        Get list of tell commands supported by D2000 process identified by its HOBJ.
        Parameters:
        processId - HOBJ of process
        Returns:
        future array of supported tell commands
      • isConnected

        boolean isConnected​()
        Get connection state of the session instance.
        Returns:
        true if connected; false otherwise
      • openCono

        FutureEvent<D2Cono> openCono​(int processHobj,
                                     D2ConoEntryEventListener eventListener)
        Open CONO (console output) of running D2000 process identified by its HOBJ and get handle to it.

        Opened CONO notifies eventListener with every new entry, when process creates it. Processes also keep history of last CONO entries, thus the listener receives this history immediately after opening the CONO.

        Parameters:
        processHobj - HOBJ of the process
        eventListener - listener for receiving CONO entries
        Returns:
        future handle to opened CONO
      • openObject

        FutureEvent<D2Object> openObject​(int hobj,
                                         D2ObjectEventsListener eventListener)
        Open existing object in D2000 DODM.

        Current value of the object is returned from method call and furter changes are notified into eventListener.

        Parameters:
        hobj - HOBJ of opened object
        eventListener - listener, where changes of object's value will be sent
        Returns:
        future opened object reference
      • openProcessList

        FutureEvent<D2ProcessList> openProcessList​(D2ProcessListEventsListener eventsListener)
        Open D2000 ProcessList.

        Current list of processes is returned from method call and further changes are notified into eventsListener.

        Parameters:
        eventsListener - listener for receiving changes in list of processes
        Returns:
        future list of current processes
      • setRPCConversationManagedHandlerType

        void setRPCConversationManagedHandlerType​(java.lang.Class<? extends RPCConversationManagedHandler> type)
        Process RPCConversationMethodBinding annotations on type and register appropriate RPC Conversation Handler Factories for discovered methods.

        Arbitrary number of type's methods can be annotated with RPCConversationMethodBinding and methods without annotation are allowed. It is however sensible that at least one method is annotated for conversation begin (beginBatch, beginEnd), because no RPC Conversation Handler Factory would be registered otherwise.

        Parameters:
        type - reference to annotated type.
      • removeRPCListener

        void removeRPCListener​(java.lang.String rpcListenerName)
        Unregister RPC listener by it's name. RPC listener has been previously registered in setRPCListener(String, ExecRPCListener).
        Parameters:
        rpcListenerName - identifier of the listener
      • removeSBAListener

        void removeSBAListener​(java.lang.String sbaListenerName)
        Unregister SBA listener by it's name. SBA listener has been previously registered in setSBAListener(String, ExecSBAListener).
        Parameters:
        sbaListenerName - identifier of the listener
      • sendByteArray

        @Deprecated
        FutureEvent<byte[]> sendByteArray​(int processHobj,
                                          int eventHobj,
                                          int eventInstance,
                                          java.lang.String procedureName,
                                          byte[] data)
        Deprecated. As of R39, replaced by callSBA(int, int, int, java.lang.String, byte[])
        Call RPC procedure with synchronous ByteArray signature and return result of the call.

        Called RPC has one formal parameter of byte[] type and byte[] as its return type. Called RPC cannot be implemented in ESL, since there is no language construction for using type byte[].

        Parameters:
        processHobj - HOBJ of event process where procedure is located
        eventHobj - HOBJ of event script
        eventInstance - instance number of event script instance (default is 0)
        procedureName - name of the RPC
        data - argument of the call
        Returns:
        future byte array returned from the RPC
      • sendByteArrayNoreply

        @Deprecated
        void sendByteArrayNoreply​(int processHobj,
                                  int eventHobj,
                                  int eventInstance,
                                  java.lang.String procedureName,
                                  byte[] data)
        Call RPC procedure with asynchronous ByteArray signature.

        Called RPC has one formal parameter of byte[] type and void as its return type. Called RPC cannot be implemented in ESL, since there is no language construction for using type byte[].

        Warning: Asynchronous call of a RPC only means that a request is sent from JAPI to Kernel. No information considering success of the delivery of the request or execution of RPC is returned. Not even in case of wrong name of RPC, type mismatch of an argument, stopped EVH or nonexistent Event.

        Parameters:
        processHobj - HOBJ of event process where procedure is located
        eventHobj - HOBJ of event script
        eventInstance - instance number of event script instance (default is 0)
        procedureName - name of the RPC
        data - argument of the call
      • setDebugInfo

        void setDebugInfo​(int processHobj,
                          DebugInfoCategory[] debugInfo)
        Set debug level of existing and running process identified by HOBJ. Debug level set by this method is valid only during runtime of target process. After process is restarted, debug level is on default again. The only way how to verify results of this method call, is consequent call of getDebugInfoCategories(int).
        Parameters:
        processHobj - HOBJ of process
        debugInfo - debug info data to set.
      • redim

        FutureEvent<java.lang.Void> redim​(int hobj,
                                          int newRowCount)
        Synchronously change row count of D2000 structured variable. Operation changes configuration. Values of deleted rows are erased, values in appended rows are initialized to invalid.
        Parameters:
        hobj - HOBJ of structured variable object
        newRowCount - new number of rows.
        Returns:
        future that completes when operation is confirmed by kernel.
      • redimAsync

        void redimAsync​(int hobj,
                        int newRowCount)
        Asynchronously change row count of D2000 structured variable. Operation changes configuration. Values of deleted rows are erased, values in appended rows are initialized to invalid.
        Parameters:
        hobj - HOBJ of structured variable object
        newRowCount - new number of rows.
      • setObjectValue

        FutureEvent<java.lang.Void> setObjectValue​(int hobj,
                                                   int rowIndex,
                                                   int columnIndex,
                                                   boolean changeReferences,
                                                   sk.ipesoft.d2000.base.UnivalValue<?> value)
        Synchronously set new value to the object or cell of structured value. Operation is performed with the same privilege as from HI.exe.

        To change value of:
        scalar value object
        set both rowIndex and columnIndex to zero. univalType of value must match of that declared in the object.
        values in all cells in structured variable
        set both rowIndex and columnIndex to zero. rowCount of new value must match that of structured variable object. structureId of value must match that of structured variable
        values in a single row of structured variable
        set one-based rowIndex to positive number and columnIndex to zero. structureId of value must match that of structured variable
        value of a single cell in structured variable
        set one-based rowIndex and columnIndex to positive values. univalType of value must match that of affected cell.

        Parameter changeReferences is considered only when changing value of object-typed cell. You can either change value of referenced object or redirect reference to different object.
        Parameters:
        hobj - HOBJ of affected object
        rowIndex - one-based index of affected row or zero.
        columnIndex - one-based index of affected cell or zero.
        changeReferences - true to redirect reference or false to change value of referenced object.
        value - new value of affected object.
        Returns:
        future that completes when operation is confirmed by kernel.
      • setObjectValueAsync

        void setObjectValueAsync​(int hobj,
                                 int rowIndex,
                                 int columnIndex,
                                 boolean changeReferences,
                                 sk.ipesoft.d2000.base.UnivalValue<?> value)
        Asynchronously set new value to the object or cell of structured value. Operation is performed with the same privilege as from HI.exe.

        To change value of:
        scalar value object
        set both rowIndex and columnIndex to zero. univalType of value must match of that declared in the object.
        values in all cells in structured variable
        set both rowIndex and columnIndex to zero. rowCount of new value must match that of structured variable object. structureId of value must match that of structured variable
        values in a single row of structured variable
        set one-based rowIndex to positive number and columnIndex to zero. structureId of value must match that of structured variable
        value of a single cell in structured variable
        set one-based rowIndex and columnIndex to positive values. univalType of value must match that of affected cell.

        Parameter changeReferences is considered only when changing value of object-typed cell. You can either change value of referenced object or redirect reference to different object.
        Parameters:
        hobj - HOBJ of affected object
        rowIndex - one-based index of affected row or zero.
        columnIndex - one-based index of affected cell or zero.
        changeReferences - true to redirect reference or false to change value of referenced object.
        value - new value of affected object.
      • setRPCConversationHandlerFactory

        void setRPCConversationHandlerFactory​(java.lang.String rpcConversationName,
                                              RPCConversationHandlerFactory factory)
        Register factory object that produces RPC conversation handler on receiving asynchronous RPC call that begins RPC conversation.
        Parameters:
        rpcConversationName - name of RPC
        factory - factory instance that produces conversation handlers
      • setRPCListener

        void setRPCListener​(java.lang.String rpcListenerName,
                            ExecRPCListener listener)
        Register listener for receiving callRPC events from D2000.

        Note: rpcListenerName should be unique within the Session, otherwise previously set listener will be replaced with current listener.

        RPC listener is a callable alike Event's RPC, although it doesn't define its formal parameters. It can be called from ESL, internal Java or other JAPI Session. Compared to calling callRPC(boolean, int, int, int, int, String, UnivalValue[]) one would set parameters according the following rules:

        • useJava = true
        • processHobj = HOBJ of called Session
        • eventHobj = 0
        • eventInstance = 0
        • interfaceHobj = 0
        • procedureName = rpcListenerName
        • arguments = arguments
        Parameters:
        rpcListenerName - name of the RPC listener, used as identifier by D2000 for addressing it. The name must comply to the following regular expression: [a-zA-Z][a-zA-Z0-9_.]+
        listener - listener for receiving RPC calls
      • setSBAListener

        void setSBAListener​(java.lang.String sbaListenerName,
                            ExecSBAListener listener)
        Register listener for receiving callSBA events from D2000.

        SBA listener is a callable alike Event's RPC, although it has its formal parameters implicitly predefined to (byte[] buffer). It can be called from internal Java or other JAPI Session but not from ESL, since there is no language construction for using byte array type. Compared to calling sendByteArray(int, int, int, String, byte[]) one would set parameters according the following rules:

        • processHobj = HOBJ of called Session
        • eventHobj = 0
        • eventInstance = 0
        • procedureName = sbaListenerName
        • data = data
        Parameters:
        sbaListenerName - name of the SBA listener, used as identifier by D2000 for addressing it. The name must comply to the following regular expression: [a-zA-Z][a-zA-Z0-9_.]+
        listener - listener for receiving SBA calls
      • tellCommand

        FutureEvent<java.lang.String> tellCommand​(java.lang.String processName,
                                                  java.lang.String command)
        Send tell command to D2000 process identified by its name and get its result.
        Parameters:
        processName - name of the process
        command - tell command
        Returns:
        future result of tell command
      • tellCommand

        FutureEvent<java.lang.String> tellCommand​(int processId,
                                                  java.lang.String command)
        Send tell command to D2000 process identified by its HOBJ and get its result.
        Parameters:
        processId - HOBJ of the process
        command - tell command
        Returns:
        future result of tell command
      • testRPC

        FutureEvent<java.lang.Boolean> testRPC​(boolean useJava,
                                               int processHobj,
                                               int eventHobj,
                                               int eventInstance,
                                               int interfaceHobj,
                                               java.lang.String procedureName,
                                               RpcParameterType[] parameterTypes)
        Test and get validity of RPC address and signature within.

        Warning: Test is performed against current configuration of D2000 instance, which may change in time.

        Warning: It is impossible to implement ESL interface in internal Java. Combination of argument values useJava == true and interfaceHobj != 0 therefore always addresses nonexistent RPC.

        Parameters:
        useJava - set to true for RPC in internal Java or to false for RPC in ESL
        processHobj - HOBJ of EVH (event handler) where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of Event (default 0)
        interfaceHobj - HOBJ of ESL interface that defines called RPC
        procedureName - name of target RPC procedure
        parameterTypes - definition of formal parameters
        Returns:
        future boolean expressing current validity of RPC address and signature
      • testSBA

        FutureEvent<java.lang.Boolean> testSBA​(int processHobj,
                                               int eventHobj,
                                               int eventInstance,
                                               java.lang.String procedureName,
                                               boolean synchronous)
        Test and get validity of RPC address with synchronous or asynchronous ByteArray signature.

        Tested RPC has one formal parameter of byte[] type and either byte[] for synchronous or void for asynchronous as its return type. RPC with ByteArray signature cannot be implemented in ESL, since there is no language construction for using type byte[].

        Warning: Test is performed against current configuration of D2000 instance, which may change in time.

        Parameters:
        processHobj - HOBJ of EVH where RPC is located
        eventHobj - base or destination HOBJ of Event object
        eventInstance - instance number of Event (default 0)
        procedureName - name of target RPC procedure
        synchronous - true for testing synchronous signature or false for asynchronous signature
        Returns:
        future boolean expressing current validity of RPC address and signature