Class AggregatedJobUsageRecord
- java.lang.Object
-
- org.gcube.documentstore.records.implementation.AbstractRecord
-
- org.gcube.accounting.datamodel.BasicUsageRecord
-
- org.gcube.accounting.datamodel.basetypes.AbstractJobUsageRecord
-
- org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord
-
- All Implemented Interfaces:
Serializable,Comparable<org.gcube.documentstore.records.Record>,AggregatedUsageRecord<AggregatedJobUsageRecord,JobUsageRecord>,UsageRecord,org.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>,org.gcube.documentstore.records.Record
public class AggregatedJobUsageRecord extends AbstractJobUsageRecord implements AggregatedUsageRecord<AggregatedJobUsageRecord,JobUsageRecord>
This Class is for library internal use only- 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 StringDURATIONstatic StringMAX_INVOCATION_TIMEstatic StringMIN_INVOCATION_TIME-
Fields inherited from class org.gcube.accounting.datamodel.basetypes.AbstractJobUsageRecord
CALLER_QUALIFIER, HOST, JOB_NAME, SERVICE_CLASS, SERVICE_NAME
-
Fields inherited from class org.gcube.accounting.datamodel.BasicUsageRecord
CONSUMER_ID, OPERATION_RESULT, 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.accounting.datamodel.AggregatedUsageRecord
AGGREGATED, END_TIME, OPERATION_COUNT, START_TIME
-
-
Constructor Summary
Constructors Constructor Description AggregatedJobUsageRecord()AggregatedJobUsageRecord(Map<String,? extends Serializable> properties)AggregatedJobUsageRecord(JobUsageRecord record)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregatedJobUsageRecordaggregate(AggregatedJobUsageRecord record)AggregatedJobUsageRecordaggregate(JobUsageRecord record)protected longdurationWeightedAverage(AggregatedJobUsageRecord record)Class<JobUsageRecord>getAggregable()CalendargetEndTime()longgetMaxInvocationTime()longgetMinInvocationTime()intgetOperationCount()CalendargetStartTime()booleanisAggregable(AggregatedJobUsageRecord record)booleanisAggregable(JobUsageRecord record)BooleanisAggregated()voidsetAggregated(Boolean aggregate)voidsetEndTime(Calendar endTime)voidsetMaxInvocationTime(long maxInvocationTime)voidsetMinInvocationTime(long minInvocationTime)voidsetOperationCount(int operationCount)voidsetStartTime(Calendar startTime)-
Methods inherited from class org.gcube.accounting.datamodel.basetypes.AbstractJobUsageRecord
getCallerQualifier, getDuration, getHost, getJobName, getRecordType, getServiceClass, getServiceName, setCallerQualifier, setDuration, setHost, setJobName, setServiceClass, setServiceName
-
Methods inherited from class org.gcube.accounting.datamodel.BasicUsageRecord
getConsumerId, getOperationResult, getQuerableKeys, getScope, init, setConsumerId, setOperationResult, setScope
-
Methods inherited from class org.gcube.documentstore.records.implementation.AbstractRecord
cleanExtraFields, compareTo, computeField, getAggregatedFields, getAllFields, getComputedFields, getCreationTime, getEndTimeAsCalendar, getEndTimeInMillis, getId, getRequiredFields, getResourceProperties, getResourceProperty, getStartTimeAsCalendar, getStartTimeInMillis, initializeValidation, removeResourceProperty, setCreationTime, setId, setResourceProperties, setResourceProperty, 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 org.gcube.documentstore.records.AggregatedRecord
getAggregatedFields
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.gcube.documentstore.records.Record
getComputedFields, getCreationTime, getId, getQuerableKeys, getRecordType, getRequiredFields, getResourceProperties, getResourceProperty, removeResourceProperty, setCreationTime, setId, setResourceProperties, setResourceProperty, validate
-
-
-
-
Field Detail
-
DURATION
public static final String DURATION
- See Also:
- Constant Field Values
-
MAX_INVOCATION_TIME
public static final String MAX_INVOCATION_TIME
- See Also:
- Constant Field Values
-
MIN_INVOCATION_TIME
public static final String MIN_INVOCATION_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AggregatedJobUsageRecord
public AggregatedJobUsageRecord()
-
AggregatedJobUsageRecord
public AggregatedJobUsageRecord(Map<String,? extends Serializable> properties) throws org.gcube.documentstore.exception.InvalidValueException
- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
AggregatedJobUsageRecord
public AggregatedJobUsageRecord(JobUsageRecord record) throws org.gcube.documentstore.exception.InvalidValueException
- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
-
Method Detail
-
getOperationCount
public int getOperationCount()
- Specified by:
getOperationCountin interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Overrides:
getOperationCountin classorg.gcube.documentstore.records.implementation.AbstractRecord
-
setOperationCount
public void setOperationCount(int operationCount) throws org.gcube.documentstore.exception.InvalidValueException- Specified by:
setOperationCountin interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Overrides:
setOperationCountin classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getMaxInvocationTime
public long getMaxInvocationTime()
-
setMaxInvocationTime
public void setMaxInvocationTime(long maxInvocationTime) throws org.gcube.documentstore.exception.InvalidValueException- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getMinInvocationTime
public long getMinInvocationTime()
-
setMinInvocationTime
public void setMinInvocationTime(long minInvocationTime) throws org.gcube.documentstore.exception.InvalidValueException- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getStartTime
public Calendar getStartTime()
- Specified by:
getStartTimein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>
-
setStartTime
public void setStartTime(Calendar startTime) throws org.gcube.documentstore.exception.InvalidValueException
- Specified by:
setStartTimein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Overrides:
setStartTimein classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
getEndTime
public Calendar getEndTime()
- Specified by:
getEndTimein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>
-
setEndTime
public void setEndTime(Calendar endTime) throws org.gcube.documentstore.exception.InvalidValueException
- Specified by:
setEndTimein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Overrides:
setEndTimein classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
setAggregated
public void setAggregated(Boolean aggregate) throws org.gcube.documentstore.exception.InvalidValueException
- Overrides:
setAggregatedin classorg.gcube.documentstore.records.implementation.AbstractRecord- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
isAggregated
public Boolean isAggregated()
- Overrides:
isAggregatedin classorg.gcube.documentstore.records.implementation.AbstractRecord
-
durationWeightedAverage
protected long durationWeightedAverage(AggregatedJobUsageRecord record) throws org.gcube.documentstore.exception.InvalidValueException
- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
aggregate
public AggregatedJobUsageRecord aggregate(AggregatedJobUsageRecord record) throws org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
- Specified by:
aggregatein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Throws:
org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
-
aggregate
public AggregatedJobUsageRecord aggregate(JobUsageRecord record) throws org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
- Specified by:
aggregatein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Throws:
org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
-
isAggregable
public boolean isAggregable(AggregatedJobUsageRecord record) throws org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
- Specified by:
isAggregablein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Throws:
org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
-
isAggregable
public boolean isAggregable(JobUsageRecord record) throws org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
- Specified by:
isAggregablein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>- Throws:
org.gcube.documentstore.exception.NotAggregatableRecordsExceptions
-
getAggregable
public Class<JobUsageRecord> getAggregable()
- Specified by:
getAggregablein interfaceorg.gcube.documentstore.records.AggregatedRecord<AggregatedJobUsageRecord,JobUsageRecord>
-
-