Class TdbGraph
THIS CLASS IS EXPERIMENTAL. USE WITH CAUTION! ITS INTERFACE MAY CHANGE IN FUTURE RELEASES.
- Since:
- TRIPjxp 3.1
-
Constructor Summary
ConstructorsConstructorDescriptionTdbGraph
(TdbSession session, TdbDatabaseDesign graphdb) Opens a graph database.TdbGraph
(TdbSession session, String databaseOrCluster) Opens a graph database or cluster of graph databases. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this TdbGraph object and release all resources associated with it, including search sets generated through its use.createEdge
(String name, int sourceRecordId, int targetRecordId, boolean commit) Create an edge in the graph database currently associated with this TdbGraph instance.createEdge
(String name, TdbRecord source, TdbRecord target, boolean commit) Create an edge in the graph database currently associated with this TdbGraph instance.createEdge
(String name, String sourceDatabase, int sourceRecordId, String targetDatabase, int targetRecordId, boolean commit) Create an edge in the graph database currently associated with this TdbGraph instance.createVertex
(String label, TdbRecord reference, boolean commit) Create a vertex record in the graph database currently associated with this TdbGraph instance.createVertex
(String label, String databaseName, int recordId, String recordName, boolean commit) Create a vertex record in the graph database currently associated with this TdbGraph instance.Returns the name of the graph database or cluster associated with this TdbGraph instance.Returns the graph set associated with the entire graph database or cluster associated with this TdbGraph instance.boolean
Returns true if the notification detail type is enabled and false if it is disabled.void
setNotificationType
(TdbGraphNotificationType type, boolean enable) Enable or disable graph analysis notification detail type.Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
-
Constructor Details
-
TdbGraph
Opens a graph database or cluster of graph databases.- Parameters:
session
- Active session objectdatabaseOrCluster
- Name of graph database or cluster- Throws:
TdbException
-
TdbGraph
Opens a graph database.- Parameters:
session
- Active session objectgraphdb
- Database design object representing a graph database- Throws:
TdbException
-
-
Method Details
-
close
Close this TdbGraph object and release all resources associated with it, including search sets generated through its use.- Throws:
TdbException
-
getGraphSet
Returns the graph set associated with the entire graph database or cluster associated with this TdbGraph instance. -
getGraphDatabaseName
Returns the name of the graph database or cluster associated with this TdbGraph instance.- Returns:
- Name of graph database or cluster.
-
setNotificationType
Enable or disable graph analysis notification detail type. Graph analysis notifications are enabled via the TdbSession methods TdbSession.enableNotification and TdbSession.setNotificationSink. In order to receive more than a brief summary when graph analysis notifications are enabled, set the desired notification type to true using this method.- Parameters:
type
- Notification detail type to enable or disableenable
- True to enable and false to disable
-
getNotificationType
Returns true if the notification detail type is enabled and false if it is disabled.- Parameters:
type
- Notification type to check- Returns:
- True if enabled and false if disabled
-
createEdge
public TdbGraphRecord createEdge(String name, TdbRecord source, TdbRecord target, boolean commit) throws TdbException Create an edge in the graph database currently associated with this TdbGraph instance.If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
- Parameters:
name
- Name of edgesource
- Source record for this edgetarget
- Target record for this edgecommit
- Pass true to commit record and false to return it uncommitted.- Returns:
- TdbGraphRecord object representing the graph record
- Throws:
TdbException
-
createEdge
public TdbGraphRecord createEdge(String name, String sourceDatabase, int sourceRecordId, String targetDatabase, int targetRecordId, boolean commit) throws TdbException Create an edge in the graph database currently associated with this TdbGraph instance.This method is used to create edges where the vertex records are located in regular, non-graph databases.
If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
- Parameters:
name
- Name of edgesourceDatabase
- Source record's database namesourceRecordId
- Source record IDtargetDatabase
- Target record's database nametargetRecordId
- Target record IDcommit
- Pass true to commit record and false to return it uncommitted.- Returns:
- TdbGraphRecord object representing the graph record
- Throws:
TdbException
-
createEdge
public TdbGraphRecord createEdge(String name, int sourceRecordId, int targetRecordId, boolean commit) throws TdbException Create an edge in the graph database currently associated with this TdbGraph instance.This method is used to create edges where the vertex records are located within the graph database associated with this object.
If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
- Parameters:
name
- Name of edgesourceRecordId
- Record ID of graph vertex record in this databasetargetRecordId
- Record ID of graph vertex record in this databasecommit
- Pass true to commit record and false to return it uncommitted.- Returns:
- TdbGraphRecord object representing the graph record
- Throws:
TdbException
-
createVertex
public TdbGraphRecord createVertex(String label, TdbRecord reference, boolean commit) throws TdbException Create a vertex record in the graph database currently associated with this TdbGraph instance.If other properties are required data for the vertex, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
- Parameters:
label
- Label for the vertex in this graphreference
- Optional reference to record with additional data for this vertex (pass null if not relevant).commit
- Pass true to commit record and false to return it uncommitted.- Returns:
- TdbGraphRecord object representing the graph record
- Throws:
TdbException
-
createVertex
public TdbGraphRecord createVertex(String label, String databaseName, int recordId, String recordName, boolean commit) throws TdbException Create a vertex record in the graph database currently associated with this TdbGraph instance.If other properties are required data for the vertex, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
If a the vertex is to refer to a record in another database that has additional information on this vertex, all the parameters databaseName, recordId and recordName must be specified. If the database lacks record names, pass null for recordName.
- Parameters:
label
- Label for the vertex in this graphdatabaseName
- Name of database in which a record with additional data for this vertex is located (pass null if not relevant)recordId
- ID of record with additional data for this vertex is located (pass zero if not relevant)recordName
- Name of record with additional data for this vertex is located (pass null if not relevant)commit
- Pass true to commit record and false to return it uncommitted.- Returns:
- TdbGraphRecord object representing the graph record
- Throws:
TdbException
-