Class: Pacer::Orient::DbListener
- Inherits:
-
Object
- Object
- Pacer::Orient::DbListener
- Includes:
- ODatabaseListener
- Defined in:
- lib/pacer-orient/db_listener.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Instance Method Summary collapse
-
#initialize(graph) ⇒ DbListener
constructor
A new instance of DbListener.
- #onAfterTxCommit(db) ⇒ Object
- #onAfterTxRollback(db) ⇒ Object
- #onBeforeTxBegin(db) ⇒ Object
- #onBeforeTxCommit(db) ⇒ Object
- #onBeforeTxRollback(db) ⇒ Object
- #onClose(db) ⇒ Object
- #onCorruptionRepairDatabase(db, iReason, iWhatWillbeFixed) ⇒ Object
- #onCreate(db) ⇒ Object
- #onDelete(db) ⇒ Object
- #onOpen(db) ⇒ Object
Constructor Details
#initialize(graph) ⇒ DbListener
Returns a new instance of DbListener.
10 11 12 13 |
# File 'lib/pacer-orient/db_listener.rb', line 10 def initialize(graph) # TDOO: use graph factory? @graph = graph end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
8 9 10 |
# File 'lib/pacer-orient/db_listener.rb', line 8 def graph @graph end |
Instance Method Details
#onAfterTxCommit(db) ⇒ Object
47 48 |
# File 'lib/pacer-orient/db_listener.rb', line 47 def onAfterTxCommit(db) end |
#onAfterTxRollback(db) ⇒ Object
30 31 |
# File 'lib/pacer-orient/db_listener.rb', line 30 def onAfterTxRollback(db) end |
#onBeforeTxBegin(db) ⇒ Object
24 25 |
# File 'lib/pacer-orient/db_listener.rb', line 24 def onBeforeTxBegin(db) end |
#onBeforeTxCommit(db) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pacer-orient/db_listener.rb', line 33 def onBeforeTxCommit(db) data = TxDataWrapper.new db, graph pp transaction: { getAllRecordEntries: data.entries, length: data.entries.length, contents: data.entries.to_a } pp created_v: data.created_v pp created_e: data.created_e pp changed_v: data.changed_v pp changed_e: data.changed_e pp deleted_v: data.deleted_v pp deleted_e: data.deleted_e end |
#onBeforeTxRollback(db) ⇒ Object
27 28 |
# File 'lib/pacer-orient/db_listener.rb', line 27 def onBeforeTxRollback(db) end |
#onClose(db) ⇒ Object
50 51 |
# File 'lib/pacer-orient/db_listener.rb', line 50 def onClose(db) end |
#onCorruptionRepairDatabase(db, iReason, iWhatWillbeFixed) ⇒ Object
53 54 55 |
# File 'lib/pacer-orient/db_listener.rb', line 53 def onCorruptionRepairDatabase(db, iReason, iWhatWillbeFixed) return false end |
#onCreate(db) ⇒ Object
15 16 |
# File 'lib/pacer-orient/db_listener.rb', line 15 def onCreate(db) end |
#onDelete(db) ⇒ Object
18 19 |
# File 'lib/pacer-orient/db_listener.rb', line 18 def onDelete(db) end |
#onOpen(db) ⇒ Object
21 22 |
# File 'lib/pacer-orient/db_listener.rb', line 21 def onOpen(db) end |