Class G2JNI

    • Constructor Detail

      • G2JNI

        public G2JNI()
    • Method Detail

      • init

        public int init​(String moduleName,
                        String iniParams,
                        boolean verboseLogging)
        Initializes the G2 Engine API with the specified module name, init parameters and flag indicating verbose logging. If the G2CONFIGFILE init parameter is absent then the default configuration from the repository is used.
        Specified by:
        init in interface G2Engine
        Parameters:
        moduleName - A short name given to this instance of the engine object
        iniParams - A JSON string containing configuration parameters
        verboseLogging - Enable diagnostic logging which will print a massive amount of information to stdout
        Returns:
        Zero (0) on success, non-zero on failure.
      • initWithConfigID

        public int initWithConfigID​(String moduleName,
                                    String iniParams,
                                    long initConfigID,
                                    boolean verboseLogging)
        Initializes the G2 Engine object with the module name, initialization parameters, verbose logging flag and a specific configuration ID identifying the configuration to use.
        Specified by:
        initWithConfigID in interface G2Engine
        Parameters:
        moduleName - The module name with which to initialize.
        iniParams - The JSON initialization parameters.
        initConfigID - The specific configuration ID to initialize with.
        verboseLogging - Whether or not to initialize with verbose logging.
        Returns:
        Zero (0) on success, non-zero on failure.
      • reinit

        public int reinit​(long initConfigID)
        Reinitializes with the specified configuration ID.
        Specified by:
        reinit in interface G2Engine
        Parameters:
        initConfigID - The configuration ID with which to reinitialize.
        Returns:
        Zero (0) on success, non-zero on failure.
      • destroy

        public int destroy()
        Uninitializes the G2 engine.
        Specified by:
        destroy in interface G2Engine
        Returns:
        Zero (0) on success, negative-one (-1) if the engine is not initialized.
      • primeEngine

        public int primeEngine()
        May optionally be called to pre-initialize some of the heavier weight internal resources of the G2 engine.
        Specified by:
        primeEngine in interface G2Engine
        Returns:
        Zero (0) on success and non-zero on failure.
      • purgeRepository

        public int purgeRepository()
        Purges all data in the configured repository WARNING: There is no undoing from this. Make sure your repository is regularly backed up.
        Specified by:
        purgeRepository in interface G2Engine
        Returns:
        Zero (0) on success and non-zero on failure.
      • stats

        public String stats()
        Returns the current internal engine workload statistics for the process. The counters are reset after each call.
        Specified by:
        stats in interface G2Engine
        Returns:
        JSON document of workload statistics
      • getLastException

        public String getLastException()
        Returns a string about the last error the system received. This is most commonly called after an API function returns an error code (non-zero or NULL)
        Specified by:
        getLastException in interface G2Fallible
        Returns:
        An error message
      • getLastExceptionCode

        public int getLastExceptionCode()
        Returns the exception code of the last error the system received. This is most commonly called after an API function returns an error code (non-zero or NULL)
        Specified by:
        getLastExceptionCode in interface G2Fallible
        Returns:
        An error code
      • clearLastException

        public void clearLastException()
        Clears the information about the last error the system received.
        Specified by:
        clearLastException in interface G2Fallible
      • exportConfig

        public int exportConfig​(StringBuffer response)
        Exports the JSON configuration that is currently loaded into the engine.
        Specified by:
        exportConfig in interface G2Engine
        Parameters:
        response - The StringBuffer to retrieve the JSON configuration document.
        Returns:
        Zero (0) on success and non-zero on failure.
      • exportConfig

        public int exportConfig​(StringBuffer response,
                                Result<Long> configID)
        Exports the JSON configuration that is currently loaded into the engine.
        Specified by:
        exportConfig in interface G2Engine
        Parameters:
        response - The StringBuffer to retrieve the JSON configuration document.
        configID - The Result object to store the configuration ID.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getActiveConfigID

        public int getActiveConfigID​(Result<Long> configID)
        Returns an identifier for the loaded G2 engine configuration
        Specified by:
        getActiveConfigID in interface G2Engine
        Parameters:
        configID - The identifier value for the config
        Returns:
        Zero (0) on success and non-zero on failure.
      • getRepositoryLastModifiedTime

        public int getRepositoryLastModifiedTime​(Result<Long> lastModifiedTime)
        Returns a long integer representing number of seconds since January 1, 1970 12:00am GMT (epoch time). This indicates the last time the data repository was modified.
        Specified by:
        getRepositoryLastModifiedTime in interface G2Engine
        Parameters:
        lastModifiedTime - The last modified time of the data repository
        Returns:
        Zero (0) on success and non-zero on failure.
      • addRecord

        public int addRecord​(String dataSourceCode,
                             String recordID,
                             String jsonData,
                             String loadID)
        Loads the JSON record with the specified data source code and record ID. The specified JSON data may contain the DATA_SOURCE and RECORD_ID elements, but, if so, they must match the specified parameters.
        Specified by:
        addRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode
        Returns:
        Zero (0) on success and non-zero on failure.
      • replaceRecord

        public int replaceRecord​(String dataSourceCode,
                                 String recordID,
                                 String jsonData,
                                 String loadID)
        Replace the JSON record that has already been loaded
        Specified by:
        replaceRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode.
        Returns:
        Zero (0) on success and non-zero on failure.
      • replaceRecordWithInfo

        public int replaceRecordWithInfo​(String dataSourceCode,
                                         String recordID,
                                         String jsonData,
                                         String loadID,
                                         long flags,
                                         StringBuffer response)
        Replace the JSON record that has already been loaded and returns a list of modified resolved entities
        Specified by:
        replaceRecordWithInfo in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • addRecordWithReturnedRecordID

        public int addRecordWithReturnedRecordID​(String dataSourceCode,
                                                 StringBuffer recordID,
                                                 String jsonData,
                                                 String loadID)
        Loads the JSON record. This works similarly to the G2_addRecord function, except that instead or requiring the recordID as an input parameter, the recordID is generated internally and returned through the parameter list.
        Specified by:
        addRecordWithReturnedRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - A buffer that returns the ID for the record
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode
        Returns:
        Zero (0) on success and non-zero on failure.
      • addRecordWithInfo

        public int addRecordWithInfo​(String dataSourceCode,
                                     String recordID,
                                     String jsonData,
                                     String loadID,
                                     long flags,
                                     StringBuffer response)
        This method is used to add entity data into the system. This works similarly to the G2_addRecord function, except that instead or requiring the recordID as an input parameter, the recordID is generated internally and returned through the parameter list. A list of modified resolved entities is also returned
        Specified by:
        addRecordWithInfo in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record. If specified, then it will be used, if empty string, then G2 will generate an ID
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be NULL and will default to dataSourceCode.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • addRecordWithInfoWithReturnedRecordID

        public int addRecordWithInfoWithReturnedRecordID​(String dataSourceCode,
                                                         String jsonData,
                                                         String loadID,
                                                         long flags,
                                                         StringBuffer recordID,
                                                         StringBuffer response)
        Specified by:
        addRecordWithInfoWithReturnedRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        jsonData - A JSON document containing the attribute information for the observation.
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        recordID - A buffer that returns the ID for the record
        response - The StringBuffer to write the response JSON document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • deleteRecord

        public int deleteRecord​(String dataSourceCode,
                                String recordID,
                                String loadID)
        Delete the record that has already been loaded
        Specified by:
        deleteRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode.
        Returns:
        Zero (0) on success and non-zero on failure.
      • deleteRecordWithInfo

        public int deleteRecordWithInfo​(String dataSourceCode,
                                        String recordID,
                                        String loadID,
                                        long flags,
                                        StringBuffer response)
        Delete the record that has already been loaded. Returns a list of modified resolved entities
        Specified by:
        deleteRecordWithInfo in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        loadID - The observation load ID for the record, can be null and will default to dataSourceCode.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • reevaluateRecord

        public int reevaluateRecord​(String dataSourceCode,
                                    String recordID,
                                    long flags)
        Reevaluate a record that has already been loaded
        Specified by:
        reevaluateRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        flags - The flags to control how the operation is performed.
        Returns:
        Zero (0) on success and non-zero on failure.
      • reevaluateEntity

        public int reevaluateEntity​(long entityID,
                                    long flags)
        Reevaluate a resolved entity identified by the specified entity ID.
        Specified by:
        reevaluateEntity in interface G2Engine
        Parameters:
        entityID - The ID of the resolved entity to reevaluate
        flags - The flags to control how the operation is performed.
        Returns:
        Zero (0) on success and non-zero on failure.
      • reevaluateRecordWithInfo

        public int reevaluateRecordWithInfo​(String dataSourceCode,
                                            String recordID,
                                            long flags,
                                            StringBuffer response)
        Reevaluate a record that has already been loaded. Returns a list of resolved entities.
        Specified by:
        reevaluateRecordWithInfo in interface G2Engine
        Parameters:
        dataSourceCode - The data source for the observation.
        recordID - The ID for the record
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • reevaluateEntityWithInfo

        public int reevaluateEntityWithInfo​(long entityID,
                                            long flags,
                                            StringBuffer response)
        Reevaluate a resolved entity and return a list of resolved entities
        Specified by:
        reevaluateEntityWithInfo in interface G2Engine
        Parameters:
        entityID - The ID of the resolved entity to reevaluate
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • searchByAttributes

        public int searchByAttributes​(String jsonData,
                                      StringBuffer response)
        This method searches for entities that contain attribute information that are relevant to a set of input search attributes.
        Specified by:
        searchByAttributes in interface G2Engine
        Parameters:
        jsonData - A JSON document containing the attribute information to search for
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • searchByAttributes

        public int searchByAttributes​(String jsonData,
                                      long flags,
                                      StringBuffer response)
        This method searches for entities that contain attribute information that are relevant to a set of input search attributes.
        Specified by:
        searchByAttributes in interface G2Engine
        Parameters:
        jsonData - A JSON document containing the attribute information to search for
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • searchByAttributes

        public int searchByAttributes​(String jsonData,
                                      String searchProfile,
                                      long flags,
                                      StringBuffer response)
        This method searches for entities that contain attribute information that are relevant to a set of input search attributes.
        Specified by:
        searchByAttributes in interface G2Engine
        Parameters:
        jsonData - A JSON document containing the attribute information to search for
        searchProfile - A search-profile identifier
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getEntityByEntityID

        public int getEntityByEntityID​(long entityID,
                                       StringBuffer response)
        This method is used to retrieve information about a specific resolved entity. The information is returned as a JSON document. An entityID may be named ENTITY_ID, RESOLVED_ID, or RELATED_ID in the JSON or CSV function output.
        Specified by:
        getEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The resolved entity to retrieve information for
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Returns zero (0) for success. Returns negative-one (-1) if the response status indicates failure or the G2 module is not initialized. Returns negative-two (-2) if an exception was thrown and caught.
      • getEntityByEntityID

        public int getEntityByEntityID​(long entityID,
                                       long flags,
                                       StringBuffer response)
        This method is used to retrieve information about a specific resolved entity. The information is returned as a JSON document. An entityID may be named ENTITY_ID, RESOLVED_ID, or RELATED_ID in the JSON or CSV function output.
        Specified by:
        getEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The resolved entity to retrieve information for
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Returns zero (0) for success. Returns negative-one (-1) if the response status indicates failure or the G2 module is not initialized. Returns negative-two (-2) if an exception was thrown and caught.
      • getEntityByRecordID

        public int getEntityByRecordID​(String dataSourceCode,
                                       String recordID,
                                       StringBuffer response)
        This method is used to retrieve information about the resolved entity containing a particular observation record.
        Specified by:
        getEntityByRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source of the observation to search for
        recordID - The record ID of the observation to search for
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getEntityByRecordID

        public int getEntityByRecordID​(String dataSourceCode,
                                       String recordID,
                                       long flags,
                                       StringBuffer response)
        This method is used to retrieve information about the resolved entity containing a particular observation record.
        Specified by:
        getEntityByRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source of the observation to search for
        recordID - The record ID of the observation to search for
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findInterestingEntitiesByEntityID

        public int findInterestingEntitiesByEntityID​(long entityID,
                                                     long flags,
                                                     StringBuffer response)
        This method is used to find interesting entities close to a specific resolved entity. The information is returned as a JSON document.
        Specified by:
        findInterestingEntitiesByEntityID in interface G2Engine
        Parameters:
        entityID - The resolved entity to search around
        flags - The flags to control how the operation is performed.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findInterestingEntitiesByRecordID

        public int findInterestingEntitiesByRecordID​(String dataSourceCode,
                                                     String recordID,
                                                     long flags,
                                                     StringBuffer response)
        This method is used to find interesting entities close to a specific resolved entity containing a particular observation record.
        Specified by:
        findInterestingEntitiesByRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source of the observation to search around
        recordID - The record ID of the observation to search around
        flags - The flags to control how the operation is performed.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathByEntityID

        public int findPathByEntityID​(long entityID1,
                                      long entityID2,
                                      int maxDegree,
                                      StringBuffer response)
        This method is used to find a relationship path between entities that are identified by entity ID.
        Specified by:
        findPathByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathByEntityID

        public int findPathByEntityID​(long entityID1,
                                      long entityID2,
                                      int maxDegree,
                                      long flags,
                                      StringBuffer response)
        This method is used to find a relationship path between entities that are identified by entity ID.
        Specified by:
        findPathByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathByRecordID

        public int findPathByRecordID​(String dataSourceCode1,
                                      String recordID1,
                                      String dataSourceCode2,
                                      String recordID2,
                                      int maxDegree,
                                      StringBuffer response)
        This method is used to find a relationship path between entities that are identified by the data source code and record ID of records in each of the entities.
        Specified by:
        findPathByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathByRecordID

        public int findPathByRecordID​(String dataSourceCode1,
                                      String recordID1,
                                      String dataSourceCode2,
                                      String recordID2,
                                      int maxDegree,
                                      long flags,
                                      StringBuffer response)
        This method is used to find a relationship path between entities that are identified by the data source code and record ID of records in each of the entities.
        Specified by:
        findPathByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathExcludingByEntityID

        public int findPathExcludingByEntityID​(long entityID1,
                                               long entityID2,
                                               int maxDegree,
                                               String excludedEntities,
                                               StringBuffer response)

        This method is used to find a relationship path between two entities identified by their entity ID's that excludes one or more entities, also identified by their entity ID's.

        The excluded entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         
        Specified by:
        findPathExcludingByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathExcludingByEntityID

        public int findPathExcludingByEntityID​(long entityID1,
                                               long entityID2,
                                               int maxDegree,
                                               String excludedEntities,
                                               long flags,
                                               StringBuffer response)

        This method is used to find a relationship path between two entities identified by their entity ID's that excludes one or more entities, also identified by their entity ID's.

        The excluded entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         
        Specified by:
        findPathExcludingByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathExcludingByRecordID

        public int findPathExcludingByRecordID​(String dataSourceCode1,
                                               String recordID1,
                                               String dataSourceCode2,
                                               String recordID2,
                                               int maxDegree,
                                               String excludedEntities,
                                               StringBuffer response)

        This method is used to find a relationship path between two entities identified by the data source codes and record IDs of their composite records where that path excludes one or more entities, also identified by the data sourec codes and record IDs of their composite records.

        The excluded entities are identified by the data source codes and record ID's of their composite records in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         
        Specified by:
        findPathExcludingByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathExcludingByRecordID

        public int findPathExcludingByRecordID​(String dataSourceCode1,
                                               String recordID1,
                                               String dataSourceCode2,
                                               String recordID2,
                                               int maxDegree,
                                               String excludedEntities,
                                               long flags,
                                               StringBuffer response)

        This method is used to find a relationship path between two entities identified by the data source codes and record IDs of their composite records where that path excludes one or more entities, also identified by the data sourec codes and record IDs of their composite records.

        The excluded entities are identified by the data source codes and record ID's of their composite records in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         
        Specified by:
        findPathExcludingByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathIncludingSourceByEntityID

        public int findPathIncludingSourceByEntityID​(long entityID1,
                                                     long entityID2,
                                                     int maxDegree,
                                                     String excludedEntities,
                                                     String requiredDsrcs,
                                                     StringBuffer response)

        This method is used to find a relationship path between two entities identified by their entity ID's. The path will exclude the one or more entities, also identified by the specified entity ID's and will require that the path contains at least one of the data sources identified by the one or more specified data sources codes.

        The excluded entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         

        The required set of data sources are identified by their data source codes in a JSON document with the following format:

            { "DATA_SOURCES": [
                "<data_source_code1>",
                "<data_source_code2>",
                . . .
                "<data_source_codeN>"
              ]
            }
         
        Specified by:
        findPathIncludingSourceByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        requiredDsrcs - The JSON document identifying the data sources that must be included on the path.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathIncludingSourceByEntityID

        public int findPathIncludingSourceByEntityID​(long entityID1,
                                                     long entityID2,
                                                     int maxDegree,
                                                     String excludedEntities,
                                                     String requiredDsrcs,
                                                     long flags,
                                                     StringBuffer response)

        This method is used to find a relationship path between two entities identified by their entity ID's. The path will exclude the one or more entities, also identified by the specified entity ID's and will require that the path contains at least one of the data sources identified by the one or more specified data sources codes.

        The excluded entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         

        The required set of data sources are identified by their data source codes in a JSON document with the following format:

            { "DATA_SOURCES": [
                "<data_source_code1>",
                "<data_source_code2>",
                . . .
                "<data_source_codeN>"
              ]
            }
         
        Specified by:
        findPathIncludingSourceByEntityID in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        requiredDsrcs - The JSON document identifying the data sources that must be included on the path.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathIncludingSourceByRecordID

        public int findPathIncludingSourceByRecordID​(String dataSourceCode1,
                                                     String recordID1,
                                                     String dataSourceCode2,
                                                     String recordID2,
                                                     int maxDegree,
                                                     String excludedEntities,
                                                     String requiredDsrcs,
                                                     StringBuffer response)

        This method is used to find a relationship path between two entities identified by the data source codes and record IDs of their composite records. THe path will exclude the one or more entities also identified by the specified data source code and record ID pairs that identify the composite records of the excluded entities and further will require the path contains at least one of the data sources identified by the one or more specified data sources codes.

        The excluded entities are identified by the data source codes and record ID's of their composite records in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         

        The required set of data sources are identified by their data source codes in a JSON document with the following format:

            { "DATA_SOURCES": [
                "<data_source_code1>",
                "<data_source_code2>",
                . . .
                "<data_source_codeN>"
              ]
            }
         
        Specified by:
        findPathIncludingSourceByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        requiredDsrcs - The JSON document identifying the data sources that must be included on the path.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findPathIncludingSourceByRecordID

        public int findPathIncludingSourceByRecordID​(String dataSourceCode1,
                                                     String recordID1,
                                                     String dataSourceCode2,
                                                     String recordID2,
                                                     int maxDegree,
                                                     String excludedEntities,
                                                     String requiredDsrcs,
                                                     long flags,
                                                     StringBuffer response)

        This method is used to find a relationship path between two entities identified by the data source codes and record IDs of their composite records. THe path will exclude the one or more entities also identified by the specified data source code and record ID pairs that identify the composite records of the excluded entities and further will require the path contains at least one of the data sources identified by the one or more specified data sources codes.

        The excluded entities are identified by the data source codes and record ID's of their composite records in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         

        The required set of data sources are identified by their data source codes in a JSON document with the following format:

            { "DATA_SOURCES": [
                "<data_source_code1>",
                "<data_source_code2>",
                . . .
                "<data_source_codeN>"
              ]
            }
         
        Specified by:
        findPathIncludingSourceByRecordID in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code of the first record.
        recordID1 - The record ID of the first record.
        dataSourceCode2 - The data source code of the second record.
        recordID2 - The record ID of the second record.
        maxDegree - The maximum number of degrees for the path search.
        excludedEntities - The JSON document identifying the excluded entities via their entity ID's.
        requiredDsrcs - The JSON document identifying the data sources that must be included on the path.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findNetworkByEntityID

        public int findNetworkByEntityID​(String entityList,
                                         int maxDegree,
                                         int buildOutDegree,
                                         int maxEntities,
                                         StringBuffer response)

        This method is used to find a network of entity relationships, surrounding the paths between a set of entities. The entities are identified by their entity IDs.

        The desired entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         
        Specified by:
        findNetworkByEntityID in interface G2Engine
        Parameters:
        entityList - The JSON document specififying the entity ID's of the desired entities.
        maxDegree - The maximum number of degrees for the path search between the specified entities.
        buildOutDegree - The number of relationship degrees to build out from each of the found entities.
        maxEntities - The maximum number of entities to build out to.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findNetworkByEntityID

        public int findNetworkByEntityID​(String entityList,
                                         int maxDegree,
                                         int buildOutDegree,
                                         int maxEntities,
                                         long flags,
                                         StringBuffer response)

        This method is used to find a network of entity relationships, surrounding the paths between a set of entities. The entities are identified by their entity IDs.

        The desired entities are identified by their entity ID's in a JSON document with the following format:

           {
             "ENTITIES": [
                { "ENTITY_ID": <entity_id1> },
                { "ENTITY_ID": <entity_id2> },
                . . .
                { "ENTITY_ID": <entity_idN> }
             ]
           }
         
        Specified by:
        findNetworkByEntityID in interface G2Engine
        Parameters:
        entityList - The JSON document specififying the entity ID's of the desired entities.
        maxDegree - The maximum number of degrees for the path search between the specified entities.
        buildOutDegree - The number of relationship degrees to build out from each of the found entities.
        maxEntities - The maximum number of entities to build out to.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findNetworkByRecordID

        public int findNetworkByRecordID​(String recordList,
                                         int maxDegree,
                                         int buildOutDegree,
                                         int maxEntities,
                                         StringBuffer response)

        This method is used to find a network of entity relationships, surrounding the paths between a set of entities. The entities are identified by their composite records having the specified data source code and record ID pairs.

        The composite records af the desired entities are identified by the data source code and record ID pairs in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         
        Specified by:
        findNetworkByRecordID in interface G2Engine
        Parameters:
        recordList - The JSON document containing the data source code and record ID pairs for the composite records of the desired entities.
        maxDegree - The maximum number of degrees for the path search between the specified entities.
        buildOutDegree - The number of relationship degrees to build out from each of the found entities.
        maxEntities - The maximum number of entities to build out to.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • findNetworkByRecordID

        public int findNetworkByRecordID​(String recordList,
                                         int maxDegree,
                                         int buildOutDegree,
                                         int maxEntities,
                                         long flags,
                                         StringBuffer response)

        This method is used to find a network of entity relationships, surrounding the paths between a set of entities. The entities are identified by their composite records having the specified data source code and record ID pairs.

        The composite records af the desired entities are identified by the data source code and record ID pairs in a JSON document with the following format:

           {
             "ENTITIES": [
                {
                  "DATA_SOURCE": "<data_source1>",
                  "RECORD_ID":  "<record_id1>"
                },
                {
                  "DATA_SOURCE": "<data_source2>",
                  "RECORD_ID":  "<record_id2>"
                },
                . . .
                {
                  "DATA_SOURCE": "<data_sourceN>",
                  "RECORD_ID":  "<record_idN>"
                }
             ]
           }
         
        Specified by:
        findNetworkByRecordID in interface G2Engine
        Parameters:
        recordList - The JSON document containing the data source code and record ID pairs for the composite records of the desired entities.
        maxDegree - The maximum number of degrees for the path search between the specified entities.
        buildOutDegree - The number of relationship degrees to build out from each of the found entities.
        maxEntities - The maximum number of entities to build out to.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyRecordInEntity

        public int whyRecordInEntity​(String dataSourceCode,
                                     String recordID,
                                     StringBuffer response)
        This method determines why a particular record is included in its resolved entity.
        Specified by:
        whyRecordInEntity in interface G2Engine
        Parameters:
        dataSourceCode - The data source code for the composite record of the subject entity.
        recordID - The record ID for the composite record of the subject entity.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyRecordInEntity

        public int whyRecordInEntity​(String dataSourceCode,
                                     String recordID,
                                     long flags,
                                     StringBuffer response)
        This method determines why a particular record is included in its resolved entity.
        Specified by:
        whyRecordInEntity in interface G2Engine
        Parameters:
        dataSourceCode - The data source code for the composite record of the subject entity.
        recordID - The record ID for the composite record of the subject entity.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntityByRecordID

        public int whyEntityByRecordID​(String dataSourceCode,
                                       String recordID,
                                       StringBuffer response)
        This method determines why records are included in the resolved entity they belong to. The entity for the operation is the one having the record with the specified data source code and record ID.
        Specified by:
        whyEntityByRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source code for the composite record of the subject entity.
        recordID - The record ID for the composite record of the subject entity.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntityByRecordID

        public int whyEntityByRecordID​(String dataSourceCode,
                                       String recordID,
                                       long flags,
                                       StringBuffer response)
        This method determines why records are included in the resolved entity they belong to. The entity for the operation is the one having the record with the specified data source code and record ID.
        Specified by:
        whyEntityByRecordID in interface G2Engine
        Parameters:
        dataSourceCode - The data source code for the composite record of the subject entity.
        recordID - The record ID for the composite record of the subject entity.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntityByEntityID

        public int whyEntityByEntityID​(long entityID,
                                       StringBuffer response)
        This method determines why records are included in the resolved entity they belong to. The entity is identified with the specified entity ID.
        Specified by:
        whyEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The entity ID of the subject entity.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntityByEntityID

        public int whyEntityByEntityID​(long entityID,
                                       long flags,
                                       StringBuffer response)
        This method determines why records are included in the resolved entity they belong to. The entity is identified with the specified entity ID.
        Specified by:
        whyEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The entity ID of the subject entity.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyRecords

        public int whyRecords​(String dataSourceCode1,
                              String recordID1,
                              String dataSourceCode2,
                              String recordID2,
                              StringBuffer response)
        This method determines how two records are related to each other.
        Specified by:
        whyRecords in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code for the first record.
        recordID1 - The record ID for the first record.
        dataSourceCode2 - The data source code for the second record.
        recordID2 - The record ID for the second record.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyRecords

        public int whyRecords​(String dataSourceCode1,
                              String recordID1,
                              String dataSourceCode2,
                              String recordID2,
                              long flags,
                              StringBuffer response)
        This method determines how two records are related to each other.
        Specified by:
        whyRecords in interface G2Engine
        Parameters:
        dataSourceCode1 - The data source code for the first record.
        recordID1 - The record ID for the first record.
        dataSourceCode2 - The data source code for the second record.
        recordID2 - The record ID for the second record.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntities

        public int whyEntities​(long entityID1,
                               long entityID2,
                               StringBuffer response)
        This method determines how two entities are related to each other.
        Specified by:
        whyEntities in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • whyEntities

        public int whyEntities​(long entityID1,
                               long entityID2,
                               long flags,
                               StringBuffer response)
        This method determines how two entities are related to each other.
        Specified by:
        whyEntities in interface G2Engine
        Parameters:
        entityID1 - The entity ID of the first entity.
        entityID2 - The entity ID of the second entity.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • howEntityByEntityID

        public int howEntityByEntityID​(long entityID,
                                       StringBuffer response)
        This method gives information on how entities were constructed from their base records.
        Specified by:
        howEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The entity ID.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • howEntityByEntityID

        public int howEntityByEntityID​(long entityID,
                                       long flags,
                                       StringBuffer response)
        This method gives information on how entities were constructed from their base records.
        Specified by:
        howEntityByEntityID in interface G2Engine
        Parameters:
        entityID - The entity ID.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getVirtualEntityByRecordID

        public int getVirtualEntityByRecordID​(String recordList,
                                              StringBuffer response)
        This method gives information on how an entity composed of a given set of records would look.
        Specified by:
        getVirtualEntityByRecordID in interface G2Engine
        Parameters:
        recordList - The list of records used to build the virtual entity.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getVirtualEntityByRecordID

        public int getVirtualEntityByRecordID​(String recordList,
                                              long flags,
                                              StringBuffer response)
        This method gives information on how an entity composed of a given set of records would look.
        Specified by:
        getVirtualEntityByRecordID in interface G2Engine
        Parameters:
        recordList - The list of records used to build the virtual entity.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - The StringBuffer to write the JSON response document to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getRecord

        public int getRecord​(String dataSourceCode,
                             String recordID,
                             StringBuffer response)
        This method is used to retrieve the stored record.
        Specified by:
        getRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source of the observation to search for
        recordID - The record ID of the observation to search for
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getRecord

        public int getRecord​(String dataSourceCode,
                             String recordID,
                             long flags,
                             StringBuffer response)
        This method is used to retrieve the stored record.
        Specified by:
        getRecord in interface G2Engine
        Parameters:
        dataSourceCode - The data source of the observation to search for
        recordID - The record ID of the observation to search for
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • exportJSONEntityReport

        public int exportJSONEntityReport​(long flags,
                                          Result<Long> exportHandle)
        This is used to export entity data from known entities. This function returns an export-handle that can be read from to get the export data in JSON format. The export-handle should be read using the "G2_fetchNext" function, and closed when work is complete. Each output row contains the exported entity data for a single resolved entity.
        Specified by:
        exportJSONEntityReport in interface G2Engine
        Parameters:
        flags - A bit mask specifying control flags, such as "G2_EXPORT_INCLUDE_SINGLETONS". The default and recommended value is "G2_EXPORT_DEFAULT_FLAGS".
        exportHandle - The Result object for storing the export handle.
        Returns:
        Zero (0) on success and non-zero on failure.
      • exportCSVEntityReport

        public int exportCSVEntityReport​(String csvColumnList,
                                         long flags,
                                         Result<Long> exportHandle)
        This is used to export entity data from known entities. This function returns an export-handle that can be read from to get the export data in CSV format. The export-handle should be read using the "G2_fetchNext" function, and closed when work is complete. The first output row returned by the export-handle contains the JSON column headers as a string. Each following row contains the exported entity data.
        Specified by:
        exportCSVEntityReport in interface G2Engine
        Parameters:
        csvColumnList - Specify "*" to indicate "all columns", specify empty-string to indicate the "standard columns", otherwise specify a comma-sepatated list of column names.
        flags - A bit mask specifying other control flags, such as "G2_EXPORT_INCLUDE_SINGLETONS". The default and recommended value is "G2_EXPORT_DEFAULT_FLAGS".
        exportHandle - The Result object for storing the export handle.
        Returns:
        Returns an export handle that the entity data can be read from.
      • fetchNext

        public int fetchNext​(long exportHandle,
                             StringBuffer response)
        This function is used to read entity data from an export handle, one data row at a time.
        Specified by:
        fetchNext in interface G2Engine
        Parameters:
        exportHandle - The export handle to retrieve data from
        response - The StringBuffer to write the next exported record to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • closeExport

        public int closeExport​(long exportHandle)
        This function closes an export handle, to clean up system resources.
        Specified by:
        closeExport in interface G2Engine
        Parameters:
        exportHandle - The export handle of the export to close.
        Returns:
        Zero (0) on success and non-zero on failure.
      • processRedoRecord

        public int processRedoRecord​(StringBuffer record)
        Processes a redo record.
        Specified by:
        processRedoRecord in interface G2Engine
        Parameters:
        record - TBD: Need to find out if this is an input, an output or both.
        Returns:
        Zero (0) on success and non-zero on failure.
      • processRedoRecordWithInfo

        public int processRedoRecordWithInfo​(long flags,
                                             StringBuffer record,
                                             StringBuffer response)
        Processes a redo record.
        Specified by:
        processRedoRecordWithInfo in interface G2Engine
        Parameters:
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        record - A returned JSON document containing the info.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.
      • getRedoRecord

        public int getRedoRecord​(StringBuffer record)
        Retrieves a pending redo record from the reevaluation queue.
        Specified by:
        getRedoRecord in interface G2Engine
        Parameters:
        record - A StringBuffer to write the redo record to.
        Returns:
        Zero (0) on success and non-zero on failure.
      • countRedoRecords

        public long countRedoRecords()
        Gets the number of redo records waiting to be processed.
        Specified by:
        countRedoRecords in interface G2Engine
        Returns:
        The number of redo records waiting to be processed.
      • process

        public int process​(String record)
        This method will send a record for processing in g2. It is a synchronous call, i.e. it will wait until g2 actually processes the record. This is similar to G2Engine.process(String,StringBuffer) method, but this variant does not return a response. NOTE: there are performance benefits of calling this variant of process that does not require a response.
        Specified by:
        process in interface G2Engine
        Parameters:
        record - An input record to be processed.
        Returns:
        Zero (0) on success and non-zero on failure.
      • process

        public int process​(String record,
                           StringBuffer response)
        This method will send a record for processing in g2. It is a synchronous call, i.e. it will wait until g2 actually processes the record, and then return a response message. This is similar to G2Engine.process(String) method, but this variant returns a response. NOTE: there are performance benefits of calling the variant of process that does not require a response.
        Specified by:
        process in interface G2Engine
        Parameters:
        record - An input record to be processed.
        response - A StringBuffer for returning the response document.
        Returns:
        Zero (0) on success and non-zero on failure.
      • processWithInfo

        public int processWithInfo​(String record,
                                   long flags,
                                   StringBuffer response)
        This method will send a record for processing in g2. It is a synchronous call, i.e. it will wait until g2 actually processes the record. This is similar to G2Engine.process(String,StringBuffer) method, but this variant does not return a response. NOTE: there are performance benefits of calling this variant of process that does not require a response. Also returns a list of modified resolved entities
        Specified by:
        processWithInfo in interface G2Engine
        Parameters:
        record - An input record to be processed.
        flags - The flags to control how the operation is performed and specifically the content of the response JSON document.
        response - A StringBuffer for returning the response document. If an error occurred, an error response is stored here.
        Returns:
        Zero (0) on success and non-zero on failure.