Class G2JNI
- java.lang.Object
-
- com.senzing.g2.engine.G2JNI
-
- All Implemented Interfaces:
G2Engine
,G2Fallible
public class G2JNI extends Object implements G2Engine
Implements theG2Engine
interface to call the native implementations of each function.
-
-
Field Summary
-
Fields inherited from interface com.senzing.g2.engine.G2Engine
G2_ENTITY_BRIEF_DEFAULT_FLAGS, G2_ENTITY_DEFAULT_FLAGS, G2_ENTITY_INCLUDE_ALL_FEATURES, G2_ENTITY_INCLUDE_ALL_RELATIONS, G2_ENTITY_INCLUDE_DISCLOSED_RELATIONS, G2_ENTITY_INCLUDE_ENTITY_NAME, G2_ENTITY_INCLUDE_NAME_ONLY_RELATIONS, G2_ENTITY_INCLUDE_POSSIBLY_RELATED_RELATIONS, G2_ENTITY_INCLUDE_POSSIBLY_SAME_RELATIONS, G2_ENTITY_INCLUDE_RECORD_DATA, G2_ENTITY_INCLUDE_RECORD_FEATURE_IDS, G2_ENTITY_INCLUDE_RECORD_FORMATTED_DATA, G2_ENTITY_INCLUDE_RECORD_JSON_DATA, G2_ENTITY_INCLUDE_RECORD_MATCHING_INFO, G2_ENTITY_INCLUDE_RECORD_SUMMARY, G2_ENTITY_INCLUDE_RELATED_ENTITY_NAME, G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO, G2_ENTITY_INCLUDE_RELATED_RECORD_DATA, G2_ENTITY_INCLUDE_RELATED_RECORD_SUMMARY, G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES, G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS, G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES, G2_EXPORT_DEFAULT_FLAGS, G2_EXPORT_INCLUDE_ALL_ENTITIES, G2_EXPORT_INCLUDE_ALL_RELATIONSHIPS, G2_EXPORT_INCLUDE_DISCLOSED, G2_EXPORT_INCLUDE_NAME_ONLY, G2_EXPORT_INCLUDE_POSSIBLY_RELATED, G2_EXPORT_INCLUDE_POSSIBLY_SAME, G2_EXPORT_INCLUDE_RESOLVED, G2_EXPORT_INCLUDE_SINGLETONS, G2_FIND_PATH_DEFAULT_FLAGS, G2_FIND_PATH_PREFER_EXCLUDE, G2_HOW_ENTITY_DEFAULT_FLAGS, G2_INCLUDE_FEATURE_SCORES, G2_RECORD_DEFAULT_FLAGS, G2_SEARCH_BY_ATTRIBUTES_ALL, G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, G2_SEARCH_BY_ATTRIBUTES_MINIMAL_ALL, G2_SEARCH_BY_ATTRIBUTES_MINIMAL_STRONG, G2_SEARCH_BY_ATTRIBUTES_STRONG, G2_SEARCH_INCLUDE_ALL_ENTITIES, G2_SEARCH_INCLUDE_FEATURE_SCORES, G2_SEARCH_INCLUDE_NAME_ONLY, G2_SEARCH_INCLUDE_POSSIBLY_RELATED, G2_SEARCH_INCLUDE_POSSIBLY_SAME, G2_SEARCH_INCLUDE_RESOLVED, G2_SEARCH_INCLUDE_STATS, G2_WHY_ENTITY_DEFAULT_FLAGS
-
-
Constructor Summary
Constructors Constructor Description G2JNI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addRecord(String dataSourceCode, String recordID, String jsonData, String loadID)
Loads the JSON record with the specified data source code and record ID.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.int
addRecordWithInfoWithReturnedRecordID(String dataSourceCode, String jsonData, String loadID, long flags, StringBuffer recordID, StringBuffer response)
int
addRecordWithReturnedRecordID(String dataSourceCode, StringBuffer recordID, String jsonData, String loadID)
Loads the JSON record.void
clearLastException()
Clears the information about the last error the system received.int
closeExport(long exportHandle)
This function closes an export handle, to clean up system resources.long
countRedoRecords()
Gets the number of redo records waiting to be processed.int
deleteRecord(String dataSourceCode, String recordID, String loadID)
Delete the record that has already been loadedint
deleteRecordWithInfo(String dataSourceCode, String recordID, String loadID, long flags, StringBuffer response)
Delete the record that has already been loaded.int
destroy()
Uninitializes the G2 engine.int
exportConfig(StringBuffer response)
Exports the JSON configuration that is currently loaded into the engine.int
exportConfig(StringBuffer response, Result<Long> configID)
Exports the JSON configuration that is currently loaded into the engine.int
exportCSVEntityReport(String csvColumnList, long flags, Result<Long> exportHandle)
This is used to export entity data from known entities.int
exportJSONEntityReport(long flags, Result<Long> exportHandle)
This is used to export entity data from known entities.int
fetchNext(long exportHandle, StringBuffer response)
This function is used to read entity data from an export handle, one data row at a time.int
findInterestingEntitiesByEntityID(long entityID, long flags, StringBuffer response)
This method is used to find interesting entities close to a specific resolved entity.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.int
getActiveConfigID(Result<Long> configID)
Returns an identifier for the loaded G2 engine configurationint
getEntityByEntityID(long entityID, long flags, StringBuffer response)
This method is used to retrieve information about a specific resolved entity.int
getEntityByEntityID(long entityID, StringBuffer response)
This method is used to retrieve information about a specific resolved entity.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.int
getEntityByRecordID(String dataSourceCode, String recordID, StringBuffer response)
This method is used to retrieve information about the resolved entity containing a particular observation record.String
getLastException()
Returns a string about the last error the system received.int
getLastExceptionCode()
Returns the exception code of the last error the system received.int
getRecord(String dataSourceCode, String recordID, long flags, StringBuffer response)
This method is used to retrieve the stored record.int
getRecord(String dataSourceCode, String recordID, StringBuffer response)
This method is used to retrieve the stored record.int
getRedoRecord(StringBuffer record)
Retrieves a pending redo record from the reevaluation queue.int
getRepositoryLastModifiedTime(Result<Long> lastModifiedTime)
Returns a long integer representing number of seconds since January 1, 1970 12:00am GMT (epoch time).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.int
getVirtualEntityByRecordID(String recordList, StringBuffer response)
This method gives information on how an entity composed of a given set of records would look.int
howEntityByEntityID(long entityID, long flags, StringBuffer response)
This method gives information on how entities were constructed from their base records.int
howEntityByEntityID(long entityID, StringBuffer response)
This method gives information on how entities were constructed from their base records.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.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.int
primeEngine()
May optionally be called to pre-initialize some of the heavier weight internal resources of the G2 engine.int
process(String record)
This method will send a record for processing in g2.int
process(String record, StringBuffer response)
This method will send a record for processing in g2.int
processRedoRecord(StringBuffer record)
Processes a redo record.int
processRedoRecordWithInfo(long flags, StringBuffer record, StringBuffer response)
Processes a redo record.int
processWithInfo(String record, long flags, StringBuffer response)
This method will send a record for processing in g2.int
purgeRepository()
Purges all data in the configured repository WARNING: There is no undoing from this.int
reevaluateEntity(long entityID, long flags)
Reevaluate a resolved entity identified by the specified entity ID.int
reevaluateEntityWithInfo(long entityID, long flags, StringBuffer response)
Reevaluate a resolved entity and return a list of resolved entitiesint
reevaluateRecord(String dataSourceCode, String recordID, long flags)
Reevaluate a record that has already been loadedint
reevaluateRecordWithInfo(String dataSourceCode, String recordID, long flags, StringBuffer response)
Reevaluate a record that has already been loaded.int
reinit(long initConfigID)
Reinitializes with the specified configuration ID.int
replaceRecord(String dataSourceCode, String recordID, String jsonData, String loadID)
Replace the JSON record that has already been loadedint
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 entitiesint
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.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.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.String
stats()
Returns the current internal engine workload statistics for the process.int
whyEntities(long entityID1, long entityID2, long flags, StringBuffer response)
This method determines how two entities are related to each other.int
whyEntities(long entityID1, long entityID2, StringBuffer response)
This method determines how two entities are related to each other.int
whyEntityByEntityID(long entityID, long flags, StringBuffer response)
This method determines why records are included in the resolved entity they belong to.int
whyEntityByEntityID(long entityID, StringBuffer response)
This method determines why records are included in the resolved entity they belong to.int
whyEntityByRecordID(String dataSourceCode, String recordID, long flags, StringBuffer response)
This method determines why records are included in the resolved entity they belong to.int
whyEntityByRecordID(String dataSourceCode, String recordID, StringBuffer response)
This method determines why records are included in the resolved entity they belong to.int
whyRecordInEntity(String dataSourceCode, String recordID, long flags, StringBuffer response)
This method determines why a particular record is included in its resolved entity.int
whyRecordInEntity(String dataSourceCode, String recordID, StringBuffer response)
This method determines why a particular record is included in its resolved entity.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.int
whyRecords(String dataSourceCode1, String recordID1, String dataSourceCode2, String recordID2, StringBuffer response)
This method determines how two records are related to each other.
-
-
-
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 theG2CONFIGFILE
init parameter is absent then the default configuration from the repository is used.- Specified by:
init
in interfaceG2Engine
- Parameters:
moduleName
- A short name given to this instance of the engine objectiniParams
- A JSON string containing configuration parametersverboseLogging
- 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 interfaceG2Engine
- 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.
-
destroy
public int destroy()
Uninitializes the G2 engine.
-
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 interfaceG2Engine
- 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 interfaceG2Engine
- 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.
-
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 interfaceG2Fallible
- 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 interfaceG2Fallible
- Returns:
- An error code
-
clearLastException
public void clearLastException()
Clears the information about the last error the system received.- Specified by:
clearLastException
in interfaceG2Fallible
-
exportConfig
public int exportConfig(StringBuffer response)
Exports the JSON configuration that is currently loaded into the engine.- Specified by:
exportConfig
in interfaceG2Engine
- Parameters:
response
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
response
- TheStringBuffer
to retrieve the JSON configuration document.configID
- TheResult
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 interfaceG2Engine
- 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 interfaceG2Engine
- 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 theDATA_SOURCE
andRECORD_ID
elements, but, if so, they must match the specified parameters.- Specified by:
addRecord
in interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordjsonData
- 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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordjsonData
- 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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordjsonData
- 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 dataSourceCodeflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- A buffer that returns the ID for the recordjsonData
- 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 interfaceG2Engine
- 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 IDjsonData
- 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
- AStringBuffer
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 interfaceG2Engine
- 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 recordresponse
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordloadID
- The observation load ID for the record, can be null and will default todataSourceCode
.- 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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordloadID
- The observation load ID for the record, can be null and will default todataSourceCode
.flags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordflags
- 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 interfaceG2Engine
- Parameters:
entityID
- The ID of the resolved entity to reevaluateflags
- 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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source for the observation.recordID
- The ID for the recordflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The ID of the resolved entity to reevaluateflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
jsonData
- A JSON document containing the attribute information to search forresponse
- AStringBuffer
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 interfaceG2Engine
- Parameters:
jsonData
- A JSON document containing the attribute information to search forflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
jsonData
- A JSON document containing the attribute information to search forsearchProfile
- A search-profile identifierflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The resolved entity to retrieve information forresponse
- AStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The resolved entity to retrieve information forflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source of the observation to search forrecordID
- The record ID of the observation to search forresponse
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source of the observation to search forrecordID
- The record ID of the observation to search forflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The resolved entity to search aroundflags
- The flags to control how the operation is performed.response
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source of the observation to search aroundrecordID
- The record ID of the observation to search aroundflags
- The flags to control how the operation is performed.response
- AStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The entity ID of the subject entity.response
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
entityID1
- The entity ID of the first entity.entityID2
- The entity ID of the second entity.response
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
entityID
- The entity ID.response
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
recordList
- The list of records used to build the virtual entity.response
- TheStringBuffer
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 interfaceG2Engine
- 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
- TheStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source of the observation to search forrecordID
- The record ID of the observation to search forresponse
- AStringBuffer
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 interfaceG2Engine
- Parameters:
dataSourceCode
- The data source of the observation to search forrecordID
- The record ID of the observation to search forflags
- The flags to control how the operation is performed and specifically the content of the response JSON document.response
- AStringBuffer
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 interfaceG2Engine
- 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
- TheResult
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 interfaceG2Engine
- 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
- TheResult
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 interfaceG2Engine
- Parameters:
exportHandle
- The export handle to retrieve data fromresponse
- TheStringBuffer
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 interfaceG2Engine
- 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 interfaceG2Engine
- 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 interfaceG2Engine
- 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
- AStringBuffer
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 interfaceG2Engine
- Parameters:
record
- AStringBuffer
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 interfaceG2Engine
- 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 toG2Engine.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.
-
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 toG2Engine.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 interfaceG2Engine
- Parameters:
record
- An input record to be processed.response
- AStringBuffer
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 toG2Engine.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 interfaceG2Engine
- 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
- AStringBuffer
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.
-
-