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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class org.gcube.documentstore.records.implementation.AbstractRecord

    aggregatedFields, computation, computedFields, CREATION_TIME, ID, requiredFields, resourceProperties, validation

    Fields inherited from interface org.gcube.documentstore.records.Record

    CREATION_TIME, ID, RECORD_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BasicUsageRecord(Map<String,? extends Serializable> properties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the user (or the Consumer Identity, that in the S2S communication is another service)
     
     
    Return the scope of this {#UsageRecord}
    protected void
    Initialize variable
    void
    setConsumerId(String consumerId)
    Set the user (or the Consumer Identity, that in the S2S communication is another service)
    void
    Set the Operation Result related to the accounted Usage Record
    void
    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

    Methods inherited from interface org.gcube.documentstore.records.Record

    getComputedFields, getCreationTime, getId, getRequiredFields, getResourceProperties, getResourceProperty, removeResourceProperty, setCreationTime, setId, setResourceProperties, setResourceProperty, validate
  • Field Details

  • 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:
      init in class org.gcube.documentstore.records.implementation.AbstractRecord
    • getQuerableKeys

      public SortedSet<String> getQuerableKeys() throws Exception
      Specified by:
      getQuerableKeys in interface org.gcube.documentstore.records.Record
      Overrides:
      getQuerableKeys in class org.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:
      getConsumerId in interface UsageRecord
      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:
      setConsumerId in interface UsageRecord
      Parameters:
      consumerId - Consumer ID
      Throws:
      org.gcube.documentstore.exception.InvalidValueException
    • getRecordType

      public String getRecordType()
      Specified by:
      getRecordType in interface org.gcube.documentstore.records.Record
    • getScope

      public String getScope()
      Return the scope of this {#UsageRecord}
      Specified by:
      getScope in interface UsageRecord
      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:
      setScope in interface UsageRecord
      Parameters:
      scope - the scope of the {#UsageRecord}
      Throws:
      org.gcube.documentstore.exception.InvalidValueException
    • getOperationResult

      public UsageRecord.OperationResult getOperationResult()
      Specified by:
      getOperationResult in interface UsageRecord
      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:
      setOperationResult in interface UsageRecord
      Parameters:
      operationResult - the Operation Result to set
      Throws:
      org.gcube.documentstore.exception.InvalidValueException