org.gcube.messaging.common.consumer.db
Class AccountingDBManager

java.lang.Object
  extended by org.gcube.messaging.common.consumer.db.DBManager
      extended by org.gcube.messaging.common.consumer.db.AccountingDBManager
All Implemented Interfaces:
java.lang.Runnable

public class AccountingDBManager
extends DBManager
implements java.lang.Runnable

Author:
Andrea Manzi (CERN)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.messaging.common.consumer.db.DBManager
DBManager.BaseConsumer
 
Constructor Summary
AccountingDBManager()
          Default constructor
 
Method Summary
 void open()
          Load the HSQL Database Engine JDBC driver and open the connection to the db.
 void run()
           
 void storeNodeAccoutingInfo(org.gcube.messaging.common.messages.records.IntervalRecord record, org.gcube.messaging.common.messages.NodeAccountingMessage<org.gcube.messaging.common.messages.records.IntervalRecord> message)
          Store Interval record on RI invocation
 void storePortalMessage(org.gcube.messaging.common.messages.PortalAccountingMessage<?> message, org.gcube.messaging.common.messages.records.BaseRecord record)
          Store a generic portal message
 
Methods inherited from class org.gcube.messaging.common.consumer.db.DBManager
backup, close, query, queryAndConsume, queryDBRS, queryJSON, toJSon, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountingDBManager

public AccountingDBManager()
Default constructor

Method Detail

open

public void open()
          throws java.lang.ClassNotFoundException,
                 java.sql.SQLException,
                 java.lang.Exception
Description copied from class: DBManager
Load the HSQL Database Engine JDBC driver and open the connection to the db.

Specified by:
open in class DBManager
Throws:
java.lang.ClassNotFoundException - if the HSQL Database Engine JDBC driver is not loaded
java.sql.SQLException - if the connection to the db fails
java.lang.Exception - if the tables creation fails

storeNodeAccoutingInfo

public void storeNodeAccoutingInfo(org.gcube.messaging.common.messages.records.IntervalRecord record,
                                   org.gcube.messaging.common.messages.NodeAccountingMessage<org.gcube.messaging.common.messages.records.IntervalRecord> message)
Store Interval record on RI invocation

Parameters:
interval - the interval
record - the record
message - the node Accounting message

storePortalMessage

public void storePortalMessage(org.gcube.messaging.common.messages.PortalAccountingMessage<?> message,
                               org.gcube.messaging.common.messages.records.BaseRecord record)
Store a generic portal message

Parameters:
message - the message
record - the base record

run

public void run()
Specified by:
run in interface java.lang.Runnable