org.gcube.accounting.datamodel
Class RawUsageRecord

java.lang.Object
  extended by org.gcube.accounting.datamodel.RawUsageRecord
All Implemented Interfaces:
Serializable, UsageRecord

public class RawUsageRecord
extends Object
implements UsageRecord, Serializable

A base implementation of the UsageRecord interface

See Also:
Serialized Form

Constructor Summary
RawUsageRecord()
          Base constructor.
RawUsageRecord(UsageRecord r)
          Instantiate this record using values from the given record
 
Method Summary
 String getAggregatedId()
          Return the id of the usage record aggregating this
 String getConsumerId()
          Return the identity of the entity that consumed the resource
 Calendar getCreateTime()
          Return the creation time for this usage record
 String getCreatorId()
          Return the identity of the entity creating this usage record
 Map<String,String> getCustomProperties()
          Return all user-defined properties
 String getCustomProperty(String name)
          Return the value of the given user-defined property
 Calendar getEndTime()
          Return the right end of the time interval covered by this usage record
 String getFullyQualifiedConsumerId()
           
 String getId()
          Return the unique id for this usage record
 Calendar getModifyTime()
          Return the modify time for this usage record
 String getResourceOwner()
          Return the identity of the owner of the resource
 String getResourceScope()
          Return the scope of the resource
 Map<String,String> getResourceSpecificProperties()
          Return all resource-specific properties
 String getResourceSpecificProperty(String key)
          Return the value of the given resource-specific property
 String getResourceType()
          Return the type of the resource this usage records refers to
 Calendar getStartTime()
          Return the left end of the time interval covered by this usage record
 void setAggregatedId(String aggregatedId)
          Set the id of the usage record aggregating this
 void setConsumerId(String consumerId)
          Set the identity of the entity that consumed the resource
 void setCreateTime(Calendar createTime)
          Set the creation time for this usage record
 void setCreatorId(String creatorId)
          Set the identity of the entity creating this usage record
 void setCustomProperties(Map<String,String> props)
          Set all user-defined properties, replacing existing ones
 void setCustomProperty(String name, String value)
          Set the value of the given user-defined property
 void setEndTime(Calendar endTime)
          Set the right end of the time interval covered by this usage record
 void setFullyQualifiedConsumerId(String fqcid)
           
 void setId(String id)
          Set the unique id for this usage record
 void setModifyTime(Calendar modifyTime)
          Set the modification time for this usage record
 void setResourceOwner(String owner)
          Set the scope of the resource
 void setResourceScope(String scope)
          Set the scope of the resource
 void setResourceSpecificProperties(Map<String,String> props)
          Set all resource-specific properties, replacing existing ones
 void setResourceSpecificProperty(String name, String value)
          Set the value of the given resource-specific property
 void setResourceType(String resourceType)
          Set the type of the resource this usage records refers to
 void setStartTime(Calendar startTime)
          Set the left end of the time interval covered by this usage record
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawUsageRecord

public RawUsageRecord()
Base constructor. Just initialize the id


RawUsageRecord

public RawUsageRecord(UsageRecord r)
               throws InvalidValueException
Instantiate this record using values from the given record

Parameters:
r -
Throws:
InvalidValueException
Method Detail

getCreateTime

public Calendar getCreateTime()
Return the creation time for this usage record

Specified by:
getCreateTime in interface UsageRecord
Returns:

setCreateTime

public void setCreateTime(Calendar createTime)
Set the creation time for this usage record

Specified by:
setCreateTime in interface UsageRecord

getModifyTime

public Calendar getModifyTime()
Return the modify time for this usage record

Specified by:
getModifyTime in interface UsageRecord
Returns:

setModifyTime

public void setModifyTime(Calendar modifyTime)
Set the modification time for this usage record

Specified by:
setModifyTime in interface UsageRecord

getCreatorId

public String getCreatorId()
Return the identity of the entity creating this usage record

Specified by:
getCreatorId in interface UsageRecord

setCreatorId

public void setCreatorId(String creatorId)
Set the identity of the entity creating this usage record

Specified by:
setCreatorId in interface UsageRecord

getConsumerId

public String getConsumerId()
Return the identity of the entity that consumed the resource

Specified by:
getConsumerId in interface UsageRecord
Returns:

setConsumerId

public void setConsumerId(String consumerId)
Set the identity of the entity that consumed the resource

Specified by:
setConsumerId in interface UsageRecord

getFullyQualifiedConsumerId

public String getFullyQualifiedConsumerId()
Specified by:
getFullyQualifiedConsumerId in interface UsageRecord
Returns:

setFullyQualifiedConsumerId

public void setFullyQualifiedConsumerId(String fqcid)
Specified by:
setFullyQualifiedConsumerId in interface UsageRecord

getStartTime

public Calendar getStartTime()
Description copied from interface: UsageRecord
Return the left end of the time interval covered by this usage record

Specified by:
getStartTime in interface UsageRecord
Returns:
the startTime

setStartTime

public void setStartTime(Calendar startTime)
                  throws InvalidValueException
Set the left end of the time interval covered by this usage record

Specified by:
setStartTime in interface UsageRecord
Throws:
InvalidValueException

setEndTime

public void setEndTime(Calendar endTime)
                throws InvalidValueException
Set the right end of the time interval covered by this usage record

Specified by:
setEndTime in interface UsageRecord
Throws:
InvalidValueException

getEndTime

public Calendar getEndTime()
Return the right end of the time interval covered by this usage record

Specified by:
getEndTime in interface UsageRecord
Returns:

getId

public String getId()
Return the unique id for this usage record

Specified by:
getId in interface UsageRecord
Returns:

setResourceSpecificProperty

public void setResourceSpecificProperty(String name,
                                        String value)
Set the value of the given resource-specific property

Specified by:
setResourceSpecificProperty in interface UsageRecord

getResourceSpecificProperty

public String getResourceSpecificProperty(String key)
Return the value of the given resource-specific property

Specified by:
getResourceSpecificProperty in interface UsageRecord
Returns:

setCustomProperty

public void setCustomProperty(String name,
                              String value)
Set the value of the given user-defined property

Specified by:
setCustomProperty in interface UsageRecord

getCustomProperty

public String getCustomProperty(String name)
Return the value of the given user-defined property

Specified by:
getCustomProperty in interface UsageRecord
Returns:

setId

public void setId(String id)
Set the unique id for this usage record

Specified by:
setId in interface UsageRecord

getAggregatedId

public String getAggregatedId()
Return the id of the usage record aggregating this

Specified by:
getAggregatedId in interface UsageRecord
Returns:

setAggregatedId

public void setAggregatedId(String aggregatedId)
Set the id of the usage record aggregating this

Specified by:
setAggregatedId in interface UsageRecord

getResourceType

public String getResourceType()
Return the type of the resource this usage records refers to

Specified by:
getResourceType in interface UsageRecord
Returns:

setResourceType

public void setResourceType(String resourceType)
Set the type of the resource this usage records refers to

Specified by:
setResourceType in interface UsageRecord

getResourceOwner

public String getResourceOwner()
Return the identity of the owner of the resource

Specified by:
getResourceOwner in interface UsageRecord
Returns:

setResourceOwner

public void setResourceOwner(String owner)
Set the scope of the resource

Specified by:
setResourceOwner in interface UsageRecord

setResourceScope

public void setResourceScope(String scope)
Set the scope of the resource

Specified by:
setResourceScope in interface UsageRecord

getResourceScope

public String getResourceScope()
Return the scope of the resource

Specified by:
getResourceScope in interface UsageRecord
Returns:

getResourceSpecificProperties

public Map<String,String> getResourceSpecificProperties()
Return all resource-specific properties

Specified by:
getResourceSpecificProperties in interface UsageRecord
Returns:

getCustomProperties

public Map<String,String> getCustomProperties()
Return all user-defined properties

Specified by:
getCustomProperties in interface UsageRecord
Returns:

setCustomProperties

public void setCustomProperties(Map<String,String> props)
Set all user-defined properties, replacing existing ones

Specified by:
setCustomProperties in interface UsageRecord

setResourceSpecificProperties

public void setResourceSpecificProperties(Map<String,String> props)
Set all resource-specific properties, replacing existing ones

Specified by:
setResourceSpecificProperties in interface UsageRecord

validate

public void validate()
Specified by:
validate in interface UsageRecord


Copyright © 2013. All Rights Reserved.