Class BasicUsageRecord

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String CONSUMER_ID  
      static String OPERATION_RESULT  
      static String SCOPE  
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getConsumerId()
      Return the user (or the Consumer Identity, that in the S2S communication is another service)
      UsageRecord.OperationResult getOperationResult()
      SortedSet<String> getQuerableKeys()  
      String getRecordType()  
      String getScope()
      Return the scope of this {#UsageRecord}
      protected void init()
      Initialize variable
      void setConsumerId​(String consumerId)
      Set the user (or the Consumer Identity, that in the S2S communication is another service)
      void setOperationResult​(UsageRecord.OperationResult operationResult)
      Set the Operation Result related to the accounted Usage Record
      void setScope​(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 interface org.gcube.documentstore.records.Record

        getComputedFields, getCreationTime, getId, getRequiredFields, getResourceProperties, getResourceProperty, removeResourceProperty, setCreationTime, setId, setResourceProperties, setResourceProperty, validate
    • 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:
        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
      • 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