org.gcube.accounting.usagetracker.persistence
Class UsageTrackerDB

java.lang.Object
  extended by org.gcube.accounting.usagetracker.persistence.UsageTrackerDB

public class UsageTrackerDB
extends Object


Method Summary
 void addConsumerGroup(List<String> consumerGroup)
           
 void addConsumerGroup(String consumerGroup)
           
 void addUsageRecord(org.gcube.accounting.datamodel.UsageRecord ur)
          Add the given usage record
 void clear()
          Remove all Usage Records
 void deleteUsageRecord(String id)
          Delete the UR with the given ID
 Collection<ArrayList<String>> getConsumersGroup()
           
 Long getLastUpdate(String dci)
          Return the last update time for the given DCI.
static UsageTrackerDB getStorage()
          Singleton
 Collection<String> getTrackedGroups()
           
 Collection<String> getTrackedResourceOwners()
           
 Collection<String> getTrackedResourceTypes()
           
 Collection<String> getTrackedUsers()
          Return all usage records in the store
 org.gcube.accounting.datamodel.UsageRecord getUsageRecord(String id)
          Retrieve the UR with the given ID
 Collection<org.gcube.accounting.datamodel.RawUsageRecord> getUsageRecordByQuery(Map<String,org.gcube.accounting.datamodel.query.QueryClause> props)
           
 long size()
          Computes the nr of URs in the store
 void updateUsageRecord(org.gcube.accounting.datamodel.UsageRecord ur)
          Update the given UR (replacement based on id)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStorage

public static UsageTrackerDB getStorage()
                                 throws UnknownHostException
Singleton

Returns:
Throws:
UnknownHostException

size

public long size()
Computes the nr of URs in the store

Returns:

addUsageRecord

public void addUsageRecord(org.gcube.accounting.datamodel.UsageRecord ur)
Add the given usage record

Parameters:
ur -
Throws:
JMSException

updateUsageRecord

public void updateUsageRecord(org.gcube.accounting.datamodel.UsageRecord ur)
Update the given UR (replacement based on id)

Parameters:
ur -

getUsageRecordByQuery

public Collection<org.gcube.accounting.datamodel.RawUsageRecord> getUsageRecordByQuery(Map<String,org.gcube.accounting.datamodel.query.QueryClause> props)

getUsageRecord

public org.gcube.accounting.datamodel.UsageRecord getUsageRecord(String id)
                                                          throws org.gcube.accounting.exception.NotFoundException
Retrieve the UR with the given ID

Throws:
org.gcube.accounting.exception.NotFoundException

deleteUsageRecord

public void deleteUsageRecord(String id)
Delete the UR with the given ID

Parameters:
id -

clear

public void clear()
Remove all Usage Records


getTrackedUsers

public Collection<String> getTrackedUsers()
Return all usage records in the store

Returns:

getTrackedResourceTypes

public Collection<String> getTrackedResourceTypes()

getTrackedResourceOwners

public Collection<String> getTrackedResourceOwners()

getTrackedGroups

public Collection<String> getTrackedGroups()

getLastUpdate

public Long getLastUpdate(String dci)
Return the last update time for the given DCI. FIXME: for the moment the 'end_time' is used since we're using the simulator. Later on, we need to use the 'create_time'

Parameters:
dci -
Returns:

addConsumerGroup

public void addConsumerGroup(String consumerGroup)

addConsumerGroup

public void addConsumerGroup(List<String> consumerGroup)

getConsumersGroup

public Collection<ArrayList<String>> getConsumersGroup()


Copyright © 2013. All Rights Reserved.