Revisited internals

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@125517 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-03-16 17:36:46 +00:00
parent 1da2c7556f
commit 1485749a35
9 changed files with 10 additions and 44 deletions

View File

@ -6,7 +6,6 @@ package org.gcube.accounting.datamodel.aggregation;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
import org.gcube.accounting.datamodel.basetypes.AbstractJobUsageRecord;
@ -39,11 +38,6 @@ public class AggregatedJobUsageRecord extends AbstractJobUsageRecord implements
throw new UnsupportedOperationException();
}
@Override
public Set<String> getAggregatedFields() {
return aggregatedFields;
}
@Override
public int getOperationCount() {
return super.getOperationCount();

View File

@ -6,7 +6,6 @@ package org.gcube.accounting.datamodel.aggregation;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
import org.gcube.accounting.datamodel.basetypes.AbstractPortletUsageRecord;
@ -40,11 +39,6 @@ public class AggregatedPortletUsageRecord extends AbstractPortletUsageRecord imp
throw new UnsupportedOperationException();
}
@Override
public Set<String> getAggregatedFields() {
return aggregatedFields;
}
@Override
public int getOperationCount() {
return super.getOperationCount();

View File

@ -6,7 +6,6 @@ package org.gcube.accounting.datamodel.aggregation;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
import org.gcube.accounting.datamodel.basetypes.AbstractServiceUsageRecord;
@ -57,11 +56,6 @@ public class AggregatedServiceUsageRecord extends AbstractServiceUsageRecord imp
this.setEndTime(creationTime);
}
@Override
public Set<String> getAggregatedFields() {
return aggregatedFields;
}
@Override
public int getOperationCount() {
return super.getOperationCount();

View File

@ -6,7 +6,6 @@ package org.gcube.accounting.datamodel.aggregation;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
import org.gcube.accounting.datamodel.basetypes.AbstractStorageUsageRecord;
@ -48,11 +47,6 @@ public class AggregatedStorageUsageRecord extends AbstractStorageUsageRecord imp
this.setEndTime(creationTime);
}
@Override
public Set<String> getAggregatedFields() {
return aggregatedFields;
}
@Override
public int getOperationCount() {
return super.getOperationCount();

View File

@ -6,7 +6,6 @@ package org.gcube.accounting.datamodel.aggregation;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Map;
import java.util.Set;
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
import org.gcube.accounting.datamodel.basetypes.AbstractTaskUsageRecord;
@ -39,12 +38,6 @@ public class AggregatedTaskUsageRecord extends AbstractTaskUsageRecord implement
throw new UnsupportedOperationException();
}
@Override
public Set<String> getAggregatedFields() {
return aggregatedFields;
}
@Override
public int getOperationCount() {
return super.getOperationCount();

View File

@ -34,14 +34,13 @@ public abstract class AbstractJobUsageRecord extends BasicUsageRecord {
@NotEmptyIfNotNull
public static final String JOB_QUALIFIER = "jobQualifier";
@RequiredField @ValidLong
@ValidLong
public static final String JOB_START_TIME = "jobStartTime";
@RequiredField @ValidLong
@ValidLong
public static final String JOB_END_TIME = "jobEndTime";
@ComputedField(action=CalculateJobWallDurationAction.class) @ValidLong
@RequiredField @ComputedField(action=CalculateJobWallDurationAction.class) @ValidLong
public static final String WALL_DURATION = "_wallDuration";
public AbstractJobUsageRecord(){
super();
}

View File

@ -37,13 +37,15 @@ public abstract class AbstractTaskUsageRecord extends BasicUsageRecord {
@NotEmptyIfNotNull
public static final String REF_HOSTING_NODE_ID = "refHostingNodeId";
@RequiredField @ValidLong
@ValidLong
public static final String TASK_START_TIME = "taskStartTime";
@RequiredField @ValidLong
@ValidLong
public static final String TASK_END_TIME = "taskEndTime";
@ComputedField(action=CalculateTaskWallDurationAction.class) @ValidLong
@RequiredField @ComputedField(action=CalculateTaskWallDurationAction.class) @ValidLong
public static final String WALL_DURATION = "_wallDuration";
@NotEmptyIfNotNull
public static final String INPUT_PARAMETERS = "inputParameters";
@ -118,7 +120,6 @@ public abstract class AbstractTaskUsageRecord extends BasicUsageRecord {
public void setTaskStartTime(Calendar startTime) throws InvalidValueException {
setResourceProperty(TASK_START_TIME, startTime.getTimeInMillis());
}
public Calendar getTaskEndTime() {

View File

@ -34,8 +34,7 @@ public class JobUsageRecordTest extends ScopedTest {
expectedRequiredFields.add(UsageRecord.SCOPE);
expectedRequiredFields.add(UsageRecord.OPERATION_RESULT);
expectedRequiredFields.add(AbstractJobUsageRecord.JOB_ID);
expectedRequiredFields.add(AbstractJobUsageRecord.JOB_START_TIME);
expectedRequiredFields.add(AbstractJobUsageRecord.JOB_END_TIME);
expectedRequiredFields.add(AbstractJobUsageRecord.WALL_DURATION);
return expectedRequiredFields;
}

View File

@ -34,9 +34,7 @@ public class TaskUsageRecordTest extends ScopedTest {
expectedRequiredFields.add(UsageRecord.SCOPE);
expectedRequiredFields.add(UsageRecord.OPERATION_RESULT);
expectedRequiredFields.add(AbstractTaskUsageRecord.TASK_ID);
expectedRequiredFields.add(AbstractTaskUsageRecord.TASK_START_TIME);
expectedRequiredFields.add(AbstractTaskUsageRecord.TASK_END_TIME);
expectedRequiredFields.add(AbstractTaskUsageRecord.WALL_DURATION);
return expectedRequiredFields;
}