org.gcube.accounting.ut
Class UsageTrackerRestAPI

java.lang.Object
  extended by org.gcube.accounting.ut.UsageTrackerRestAPI

public class UsageTrackerRestAPI
extends Object

A client-side class for accessing the usage tracker


Constructor Summary
UsageTrackerRestAPI(String uri)
           
 
Method Summary
 void clear()
          Deprecated. this operation is for development/testing purposes only. It will be removed in future releases
 void deleteUsageRecord(UsageRecord record)
           
 Collection<JobUsageRecord> getJobrecords(String query)
          Return the job usage records matching the given query.
 Collection<NetworkUsageRecord> getNetworkRecords(String query)
          Return the network usage records matching the given query.
 Collection<NetworkUsageRecord> getNetworkRecordsByQuery(String query)
          Deprecated. use getUsageRecords(query) instead
 Collection<StorageRecord> getStorageRecords(String query)
          Return the storage usage records matching the given query.
 Collection<StorageRecord> getStorageRecordsByQuery(String query)
          Deprecated. use getUsageRecords(query) instead
 Collection<Consumer> getTrackedConsumers()
           
 Collection<UpdateInfo> getUpdateInfo()
          Query the Usage Tracker for update information from each infrastructure (resource owner)
 Collection<UsageRecord> getUsageRecordByProperty(String key, String value)
          Deprecated. use getUsageRecordsByQuery instead
 Collection<UsageRecord> getUsageRecords(String query)
          Return the usage records matching the given query.
 Collection<UsageRecord> getUsageRecordsByQuery(String query)
          Deprecated. use getUsageRecords(query) instead
 Collection<User> getUsers()
          Deprecated. this operation is for development/testing purposes only. It will be removed in future releases
 Collection<VMUsageRecord> getVMRecords(String query)
          Return the VM usage records matching the given query.
 Collection<VMUsageRecord> getVMRecordsByQuery(String query)
          Deprecated. use getUsageRecords(query) instead
 void insertUsageRecord(AbstractDelegateUsageRecord ur)
          Insert the new given usage record
 void insertUsageRecord(JobUsageRecord ur)
          Insert the given job-specific usage record
 void insertUsageRecord(NetworkUsageRecord ur)
          Insert the given network-specific usage record
 void insertUsageRecord(StorageRecord ur)
          Insert the given storage-specific usage record
 void insertUsageRecord(UsageRecord ur)
          Insert the new given usage record
 void insertUsageRecord(VMUsageRecord ur)
          Insert the given VM-specific usage record
 void insertUsageRecords(Collection<UsageRecord> records)
          Insert a set of usage records
 void setUserToken(String username, String password)
           
 void setUserToken(String username, String password, String delegator)
           
 void updateUsageRecord(AbstractDelegateUsageRecord ur)
          Update an existing usage record.
 void updateUsageRecord(UsageRecord ur)
          Update an existing usage record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageTrackerRestAPI

public UsageTrackerRestAPI(String uri)
Parameters:
uri - the uri of the Usage Tracker
Method Detail

insertUsageRecords

public void insertUsageRecords(Collection<UsageRecord> records)
Insert a set of usage records

Parameters:
records -

insertUsageRecord

public void insertUsageRecord(UsageRecord ur)
Insert the new given usage record

Parameters:
ur -

insertUsageRecord

public void insertUsageRecord(AbstractDelegateUsageRecord ur)
Insert the new given usage record

Parameters:
ur -

insertUsageRecord

public void insertUsageRecord(VMUsageRecord ur)
Insert the given VM-specific usage record

Parameters:
ur -

insertUsageRecord

public void insertUsageRecord(NetworkUsageRecord ur)
Insert the given network-specific usage record

Parameters:
ur -

insertUsageRecord

public void insertUsageRecord(StorageRecord ur)
Insert the given storage-specific usage record

Parameters:
ur -

insertUsageRecord

public void insertUsageRecord(JobUsageRecord ur)
Insert the given job-specific usage record

Parameters:
ur -

updateUsageRecord

public void updateUsageRecord(UsageRecord ur)
Update an existing usage record. The match with the esisting record in the usage tracker is based on the record id

Parameters:
ur -

updateUsageRecord

public void updateUsageRecord(AbstractDelegateUsageRecord ur)
Update an existing usage record. The match with the esisting record in the usage tracker is based on the record id

Parameters:
ur -

getUsageRecords

public Collection<UsageRecord> getUsageRecords(String query)
Return the usage records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getUsageRecordsByQuery

public Collection<UsageRecord> getUsageRecordsByQuery(String query)
Deprecated. use getUsageRecords(query) instead

Return the usage records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getVMRecords

public Collection<VMUsageRecord> getVMRecords(String query)
Return the VM usage records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getVMRecordsByQuery

public Collection<VMUsageRecord> getVMRecordsByQuery(String query)
Deprecated. use getUsageRecords(query) instead

Return the VM usage records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getNetworkRecords

public Collection<NetworkUsageRecord> getNetworkRecords(String query)
Return the network usage records matching the given query.

Parameters:
query - must be the form: name=value&name>value&kname=value&...
Returns:

getNetworkRecordsByQuery

public Collection<NetworkUsageRecord> getNetworkRecordsByQuery(String query)
Deprecated. use getUsageRecords(query) instead

Return the network records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getStorageRecords

public Collection<StorageRecord> getStorageRecords(String query)
Return the storage usage records matching the given query.

Parameters:
query - must be the form: name=value&name>value&kname=value&...
Returns:

getStorageRecordsByQuery

public Collection<StorageRecord> getStorageRecordsByQuery(String query)
Deprecated. use getUsageRecords(query) instead

Return the storage records matching the given query.

Parameters:
query - must have the form: name=value&name>value&kname=value&...
Returns:

getJobrecords

public Collection<JobUsageRecord> getJobrecords(String query)
Return the job usage records matching the given query.

Parameters:
query - must be the form: name=value&name>value&kname=value&...
Returns:

getUpdateInfo

public Collection<UpdateInfo> getUpdateInfo()
Query the Usage Tracker for update information from each infrastructure (resource owner)

Returns:

getUsers

public Collection<User> getUsers()
Deprecated. this operation is for development/testing purposes only. It will be removed in future releases

Return the list of users with an associated usage record

Returns:

getTrackedConsumers

public Collection<Consumer> getTrackedConsumers()

clear

public void clear()
Deprecated. this operation is for development/testing purposes only. It will be removed in future releases

Remove all elements in the Usage Tracker


getUsageRecordByProperty

public Collection<UsageRecord> getUsageRecordByProperty(String key,
                                                        String value)
Deprecated. use getUsageRecordsByQuery instead

Query the Usage Tracker for records with the given pair

Parameters:
key -
value -
Returns:

deleteUsageRecord

public void deleteUsageRecord(UsageRecord record)

setUserToken

public void setUserToken(String username,
                         String password)

setUserToken

public void setUserToken(String username,
                         String password,
                         String delegator)


Copyright © 2012. All Rights Reserved.