Package org.gcube.accounting.datamodel
Class BasicUsageRecord
- java.lang.Object
-
- org.gcube.documentstore.records.implementation.AbstractRecord
-
- org.gcube.accounting.datamodel.BasicUsageRecord
-
- All Implemented Interfaces:
Serializable,Comparable<org.gcube.documentstore.records.Record>,UsageRecord,org.gcube.documentstore.records.Record
- Direct Known Subclasses:
AbstractJobUsageRecord,AbstractPortletUsageRecord,AbstractServiceUsageRecord,AbstractStorageStatusRecord,AbstractStorageUsageRecord
public abstract class BasicUsageRecord extends org.gcube.documentstore.records.implementation.AbstractRecord implements UsageRecord
- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gcube.accounting.datamodel.UsageRecord
UsageRecord.OperationResult
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONSUMER_IDstatic StringOPERATION_RESULTstatic StringSCOPE
-
Constructor Summary
Constructors Constructor Description BasicUsageRecord()BasicUsageRecord(Map<String,? extends Serializable> properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetConsumerId()Return the user (or the Consumer Identity, that in the S2S communication is another service)UsageRecord.OperationResultgetOperationResult()SortedSet<String>getQuerableKeys()StringgetRecordType()StringgetScope()Return the scope of this {#UsageRecord}protected voidinit()Initialize variablevoidsetConsumerId(String consumerId)Set the user (or the Consumer Identity, that in the S2S communication is another service)voidsetOperationResult(UsageRecord.OperationResult operationResult)Set the Operation Result related to the accounted Usage RecordvoidsetScope(String scope)Set the scope of the {#UsageRecord}-
Methods inherited from class org.gcube.documentstore.records.implementation.AbstractRecord
cleanExtraFields, compareTo, computeField, getAggregatedFields, getAllFields, getComputedFields, getCreationTime, getEndTimeAsCalendar, getEndTimeInMillis, getId, getOperationCount, getRequiredFields, getResourceProperties, getResourceProperty, getStartTimeAsCalendar, getStartTimeInMillis, initializeValidation, isAggregated, removeResourceProperty, setAggregated, setCreationTime, setEndTime, setId, setOperationCount, setResourceProperties, setResourceProperty, setStartTime, timestampToCalendar, toString, validate, validateField, validateProperties
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
CONSUMER_ID
public static final String CONSUMER_ID
- See Also:
- Constant Field Values
-
SCOPE
public static final String SCOPE
- See Also:
- Constant Field Values
-
OPERATION_RESULT
public static final String OPERATION_RESULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BasicUsageRecord
public BasicUsageRecord()
-
BasicUsageRecord
public BasicUsageRecord(Map<String,? extends Serializable> properties) throws org.gcube.documentstore.exception.InvalidValueException
- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
-
Method Detail
-
init
protected void init()
Initialize variable- Overrides:
initin classorg.gcube.documentstore.records.implementation.AbstractRecord
-
getQuerableKeys
public SortedSet<String> getQuerableKeys() throws Exception
- Specified by:
getQuerableKeysin interfaceorg.gcube.documentstore.records.Record- Overrides:
getQuerableKeysin classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
Exception
-
getConsumerId
public String getConsumerId()
Return the user (or the Consumer Identity, that in the S2S communication is another service)- Specified by:
getConsumerIdin interfaceUsageRecord- Returns:
- Consumer ID
-
setConsumerId
public void setConsumerId(String consumerId) throws org.gcube.documentstore.exception.InvalidValueException
Set the user (or the Consumer Identity, that in the S2S communication is another service)- Specified by:
setConsumerIdin interfaceUsageRecord- Parameters:
consumerId- Consumer ID- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getRecordType
public String getRecordType()
- Specified by:
getRecordTypein interfaceorg.gcube.documentstore.records.Record
-
getScope
public String getScope()
Return the scope of this {#UsageRecord}- Specified by:
getScopein interfaceUsageRecord- Returns:
- The scope of this {#UsageRecord}
-
setScope
public void setScope(String scope) throws org.gcube.documentstore.exception.InvalidValueException
Set the scope of the {#UsageRecord}- Specified by:
setScopein interfaceUsageRecord- Parameters:
scope- the scope of the {#UsageRecord}- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getOperationResult
public UsageRecord.OperationResult getOperationResult()
- Specified by:
getOperationResultin interfaceUsageRecord- Returns:
- the Operation Result of the accounted operation.
-
setOperationResult
public void setOperationResult(UsageRecord.OperationResult operationResult) throws org.gcube.documentstore.exception.InvalidValueException
Set the Operation Result related to the accounted Usage Record- Specified by:
setOperationResultin interfaceUsageRecord- Parameters:
operationResult- the Operation Result to set- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
-