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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gcube.accounting.datamodel.UsageRecord
UsageRecord.OperationResult -
Field Summary
FieldsFields inherited from class org.gcube.documentstore.records.implementation.AbstractRecord
aggregatedFields, computation, computedFields, CREATION_TIME, ID, requiredFields, resourceProperties, validationFields inherited from interface org.gcube.documentstore.records.Record
CREATION_TIME, ID, RECORD_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the user (or the Consumer Identity, that in the S2S communication is another service)getScope()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 RecordvoidSet 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, validatePropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.gcube.documentstore.records.Record
getComputedFields, getCreationTime, getId, getRequiredFields, getResourceProperties, getResourceProperty, removeResourceProperty, setCreationTime, setId, setResourceProperties, setResourceProperty, validate
-
Field Details
-
CONSUMER_ID
- See Also:
-
SCOPE
- See Also:
-
OPERATION_RESULT
- See Also:
-
-
Constructor Details
-
BasicUsageRecord
public BasicUsageRecord() -
BasicUsageRecord
public BasicUsageRecord(Map<String, ? extends Serializable> properties) throws org.gcube.documentstore.exception.InvalidValueException- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
-
Method Details
-
init
protected void init()Initialize variable- Overrides:
initin classorg.gcube.documentstore.records.implementation.AbstractRecord
-
getQuerableKeys
- Specified by:
getQuerableKeysin interfaceorg.gcube.documentstore.records.Record- Overrides:
getQuerableKeysin classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
Exception
-
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
- Specified by:
getRecordTypein interfaceorg.gcube.documentstore.records.Record
-
getScope
Return the scope of this {#UsageRecord}- Specified by:
getScopein interfaceUsageRecord- Returns:
- The scope of this {#UsageRecord}
-
setScope
Set the scope of the {#UsageRecord}- Specified by:
setScopein interfaceUsageRecord- Parameters:
scope- the scope of the {#UsageRecord}- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
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
-