refs #200: Create accouting-lib library

https://support.d4science.org/issues/200
Reorganizing library

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115742 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-07-01 09:39:37 +00:00
parent 7711cebb55
commit 47f8c7a74c
19 changed files with 32 additions and 32 deletions

View File

@ -13,7 +13,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* This Class is for library internal use only
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*/
public class JobUsageRecord extends org.gcube.accounting.datamodel.implementations.JobUsageRecord implements AggregatedUsageRecord<JobUsageRecord, org.gcube.accounting.datamodel.implementations.JobUsageRecord> {
public class JobUsageRecord extends org.gcube.accounting.datamodel.basetype.JobUsageRecord implements AggregatedUsageRecord<JobUsageRecord, org.gcube.accounting.datamodel.basetype.JobUsageRecord> {
/**
* Generated Serial Version UID
@ -39,7 +39,7 @@ public class JobUsageRecord extends org.gcube.accounting.datamodel.implementatio
*/
@Override
public JobUsageRecord getAggregatedUsageRecord(
org.gcube.accounting.datamodel.implementations.JobUsageRecord b)
org.gcube.accounting.datamodel.basetype.JobUsageRecord b)
throws InvalidValueException {
// TODO Auto-generated method stub
return null;

View File

@ -13,7 +13,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* This Class is for library internal use only
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*/
public class PortletUsageRecord extends org.gcube.accounting.datamodel.implementations.PortletUsageRecord implements AggregatedUsageRecord<PortletUsageRecord, org.gcube.accounting.datamodel.implementations.PortletUsageRecord> {
public class PortletUsageRecord extends org.gcube.accounting.datamodel.basetype.PortletUsageRecord implements AggregatedUsageRecord<PortletUsageRecord, org.gcube.accounting.datamodel.basetype.PortletUsageRecord> {
/**
@ -40,7 +40,7 @@ public class PortletUsageRecord extends org.gcube.accounting.datamodel.implement
*/
@Override
public PortletUsageRecord getAggregatedUsageRecord(
org.gcube.accounting.datamodel.implementations.PortletUsageRecord b)
org.gcube.accounting.datamodel.basetype.PortletUsageRecord b)
throws InvalidValueException {
// TODO Auto-generated method stub
return null;

View File

@ -17,7 +17,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* This Class is for library internal use only
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*/
public class ServiceUsageRecord extends org.gcube.accounting.datamodel.implementations.ServiceUsageRecord implements AggregatedUsageRecord<ServiceUsageRecord, org.gcube.accounting.datamodel.implementations.ServiceUsageRecord> {
public class ServiceUsageRecord extends org.gcube.accounting.datamodel.basetype.ServiceUsageRecord implements AggregatedUsageRecord<ServiceUsageRecord, org.gcube.accounting.datamodel.basetype.ServiceUsageRecord> {
/**
* Generated Serial Version UID
@ -47,7 +47,7 @@ public class ServiceUsageRecord extends org.gcube.accounting.datamodel.implement
init();
}
public ServiceUsageRecord(org.gcube.accounting.datamodel.implementations.ServiceUsageRecord record) throws InvalidValueException{
public ServiceUsageRecord(org.gcube.accounting.datamodel.basetype.ServiceUsageRecord record) throws InvalidValueException{
super(record.getResourceProperties());
this.setOperationCount(1);
long duration = record.getDuration();
@ -91,7 +91,7 @@ public class ServiceUsageRecord extends org.gcube.accounting.datamodel.implement
*/
@Override
public ServiceUsageRecord getAggregatedUsageRecord(
org.gcube.accounting.datamodel.implementations.ServiceUsageRecord usageRecord)
org.gcube.accounting.datamodel.basetype.ServiceUsageRecord usageRecord)
throws InvalidValueException {
if(usageRecord instanceof ServiceUsageRecord){
return (ServiceUsageRecord) usageRecord;

View File

@ -17,7 +17,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* This Class is for library internal use only
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*/
public class StorageUsageRecord extends org.gcube.accounting.datamodel.implementations.StorageUsageRecord implements AggregatedUsageRecord<StorageUsageRecord, org.gcube.accounting.datamodel.implementations.StorageUsageRecord> {
public class StorageUsageRecord extends org.gcube.accounting.datamodel.basetype.StorageUsageRecord implements AggregatedUsageRecord<StorageUsageRecord, org.gcube.accounting.datamodel.basetype.StorageUsageRecord> {
/**
* Generated Serial Version UID
@ -42,7 +42,7 @@ public class StorageUsageRecord extends org.gcube.accounting.datamodel.implement
init();
}
public StorageUsageRecord(org.gcube.accounting.datamodel.implementations.StorageUsageRecord record) throws InvalidValueException{
public StorageUsageRecord(org.gcube.accounting.datamodel.basetype.StorageUsageRecord record) throws InvalidValueException{
super(record.getResourceProperties());
this.setOperationCount(1);
Calendar creationTime = record.getCreationTime();
@ -68,7 +68,7 @@ public class StorageUsageRecord extends org.gcube.accounting.datamodel.implement
*/
@Override
public StorageUsageRecord getAggregatedUsageRecord(
org.gcube.accounting.datamodel.implementations.StorageUsageRecord usageRecord)
org.gcube.accounting.datamodel.basetype.StorageUsageRecord usageRecord)
throws InvalidValueException {
if(usageRecord instanceof StorageUsageRecord){
return (StorageUsageRecord) usageRecord;

View File

@ -11,7 +11,7 @@ import org.gcube.accounting.exception.NotAggregatableRecordsExceptions;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class ServiceUsageRecordAggregationStrategy extends AggregationStrategy<ServiceUsageRecord, org.gcube.accounting.datamodel.implementations.ServiceUsageRecord>{
public class ServiceUsageRecordAggregationStrategy extends AggregationStrategy<ServiceUsageRecord, org.gcube.accounting.datamodel.basetype.ServiceUsageRecord>{
/**
* @param serviceUsageRecord

View File

@ -11,7 +11,7 @@ import org.gcube.accounting.exception.NotAggregatableRecordsExceptions;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class StorageUsageRecordAggregationStrategy extends AggregationStrategy<StorageUsageRecord, org.gcube.accounting.datamodel.implementations.StorageUsageRecord>{
public class StorageUsageRecordAggregationStrategy extends AggregationStrategy<StorageUsageRecord, org.gcube.accounting.datamodel.basetype.StorageUsageRecord>{
/**
* @param serviceUsageRecord

View File

@ -460,7 +460,7 @@ public abstract class BasicUsageRecord implements UsageRecord, Serializable {
protected static Class<? extends UsageRecord> getClass(String usageRecordName, boolean aggregated) throws ClassNotFoundException {
Class<? extends UsageRecord> clz = null;
Class<? extends UsageRecord> utilityClass = org.gcube.accounting.datamodel.implementations.JobUsageRecord.class;
Class<? extends UsageRecord> utilityClass = org.gcube.accounting.datamodel.basetype.JobUsageRecord.class;
if(aggregated){
utilityClass = org.gcube.accounting.aggregation.JobUsageRecord.class;
}

View File

@ -13,14 +13,14 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.gcube.accounting.datamodel.basetype.JobUsageRecord;
import org.gcube.accounting.datamodel.basetype.PortletUsageRecord;
import org.gcube.accounting.datamodel.basetype.ServiceUsageRecord;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord;
import org.gcube.accounting.datamodel.basetype.TaskUsageRecord;
import org.gcube.accounting.datamodel.decorators.FieldAction;
import org.gcube.accounting.datamodel.decorators.FieldDecorator;
import org.gcube.accounting.datamodel.deprecationmanagement.annotations.DeprecatedWarning;
import org.gcube.accounting.datamodel.implementations.JobUsageRecord;
import org.gcube.accounting.datamodel.implementations.PortletUsageRecord;
import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord;
import org.gcube.accounting.datamodel.implementations.TaskUsageRecord;
import org.gcube.accounting.datamodel.validations.annotations.NotEmpty;
import org.gcube.accounting.datamodel.validations.annotations.NotEmptyIfNotNull;
import org.gcube.accounting.exception.InvalidValueException;

View File

@ -7,10 +7,10 @@ import java.net.URI;
import java.net.URISyntaxException;
import org.gcube.accounting.datamodel.UsageRecord.OperationResult;
import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord.DataType;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord.OperationType;
import org.gcube.accounting.datamodel.basetype.ServiceUsageRecord;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord.DataType;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord.OperationType;
import org.gcube.accounting.exception.InvalidValueException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.implementations;
package org.gcube.accounting.datamodel.basetype;
import java.io.Serializable;
import java.lang.annotation.ElementType;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.implementations;
package org.gcube.accounting.datamodel.basetype;
import java.io.Serializable;
import java.lang.annotation.ElementType;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.implementations;
package org.gcube.accounting.datamodel.basetype;
import java.io.Serializable;
import java.util.Map;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.implementations;
package org.gcube.accounting.datamodel.basetype;
import java.io.Serializable;
import java.net.URI;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.implementations;
package org.gcube.accounting.datamodel.basetype;
import java.io.Serializable;
import java.util.Calendar;

View File

@ -3,8 +3,8 @@ package org.gcube.accounting.datamodel.validations.validators;
import java.io.Serializable;
import org.gcube.accounting.datamodel.UsageRecord;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord.DataType;
import org.gcube.accounting.datamodel.decorators.FieldAction;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord.DataType;
import org.gcube.accounting.exception.InvalidValueException;
public class ValidDataTypeValidator implements FieldAction {

View File

@ -4,8 +4,8 @@ import java.io.Serializable;
import org.gcube.accounting.datamodel.UsageRecord;
import org.gcube.accounting.datamodel.UsageRecord.OperationResult;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord.OperationType;
import org.gcube.accounting.datamodel.decorators.FieldAction;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord.OperationType;
import org.gcube.accounting.exception.InvalidValueException;
public class ValidOperationTypeValidator implements FieldAction {

View File

@ -5,7 +5,7 @@ package org.gcube.accounting.aggregation.aggregationstrategy;
import org.gcube.accounting.aggregation.aggregationstrategy.ServiceUsageRecordAggregationStrategy;
import org.gcube.accounting.datamodel.TestUsageRecord;
import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
import org.gcube.accounting.datamodel.basetype.ServiceUsageRecord;
import org.gcube.accounting.exception.InvalidValueException;
import org.gcube.accounting.exception.NotAggregatableRecordsExceptions;
import org.junit.Assert;

View File

@ -5,7 +5,7 @@ package org.gcube.accounting.aggregation.aggregationstrategy;
import org.gcube.accounting.aggregation.aggregationstrategy.StorageUsageRecordAggregationStrategy;
import org.gcube.accounting.datamodel.TestUsageRecord;
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord;
import org.gcube.accounting.datamodel.basetype.StorageUsageRecord;
import org.gcube.accounting.exception.InvalidValueException;
import org.gcube.accounting.exception.NotAggregatableRecordsExceptions;
import org.junit.Assert;

View File

@ -4,7 +4,7 @@
package org.gcube.accounting.datamodel.implementation;
import org.gcube.accounting.datamodel.TestUsageRecord;
import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
import org.gcube.accounting.datamodel.basetype.ServiceUsageRecord;
import org.gcube.accounting.exception.InvalidValueException;
import org.gcube.accounting.persistence.Persistence;
import org.junit.Test;