refs #200: Create accouting-lib library

https://support.d4science.org/issues/200
Fixing data model

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115239 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-06-05 12:43:04 +00:00
parent d2a01e964d
commit 93fd14023d
8 changed files with 52 additions and 8 deletions

View File

@ -0,0 +1,28 @@
/**
*
*/
package org.gcube.accounting.datamodel;
import org.gcube.accounting.exception.InvalidValueException;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*/
public interface AggregatedUsageRecord extends UsageRecord {
/**
* Return the id of the usage record aggregating this
* @return Aggregated Id
*/
@Override
public String getAggregatedId();
/**
* Set the id of the usage record aggregating this
* @param aggregatedId
* @throws InvalidValueException
*/
@Override
public void setAggregatedId(String aggregatedId) throws InvalidValueException;
}

View File

@ -0,0 +1,12 @@
/**
*
*/
package org.gcube.accounting.datamodel;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public interface SingleUsageRecord extends UsageRecord {
}

View File

@ -6,6 +6,7 @@ package org.gcube.accounting.datamodel.implementations;
import java.util.Calendar;
import org.gcube.accounting.datamodel.RawUsageRecord;
import org.gcube.accounting.datamodel.SingleUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
import org.gcube.accounting.datamodel.annotations.ValidInteger;
import org.gcube.accounting.datamodel.annotations.ValidLong;
@ -15,7 +16,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class JobUsageRecord extends RawUsageRecord {
public class JobUsageRecord extends RawUsageRecord implements SingleUsageRecord {
/**
* Generated Serial Version UID

View File

@ -4,6 +4,7 @@
package org.gcube.accounting.datamodel.implementations;
import org.gcube.accounting.datamodel.RawUsageRecord;
import org.gcube.accounting.datamodel.SingleUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
import org.gcube.accounting.exception.InvalidValueException;
@ -11,7 +12,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class PortletUsageRecord extends RawUsageRecord {
public class PortletUsageRecord extends RawUsageRecord implements SingleUsageRecord {
/**
* Generated Serial Version UID

View File

@ -4,6 +4,7 @@
package org.gcube.accounting.datamodel.implementations;
import org.gcube.accounting.datamodel.RawUsageRecord;
import org.gcube.accounting.datamodel.SingleUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
import org.gcube.accounting.datamodel.annotations.ValidIP;
import org.gcube.accounting.datamodel.annotations.ValidInteger;
@ -13,7 +14,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class ServiceUsageRecord extends RawUsageRecord {
public class ServiceUsageRecord extends RawUsageRecord implements SingleUsageRecord {
/**
* Generated Serial Version UID

View File

@ -3,19 +3,20 @@
*/
package org.gcube.accounting.datamodel.implementations;
import org.gcube.accounting.datamodel.aggregated.StorageStatusUsageRecord;
import org.gcube.accounting.datamodel.SingleUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
import org.gcube.accounting.datamodel.annotations.NotEmptyIfNotNull;
import org.gcube.accounting.datamodel.annotations.ValidIP;
import org.gcube.accounting.datamodel.annotations.ValidInteger;
import org.gcube.accounting.datamodel.annotations.ValidLong;
import org.gcube.accounting.datamodel.implementations.aggregated.StorageStatusUsageRecord;
import org.gcube.accounting.exception.InvalidValueException;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class StorageUsageUsageRecord extends StorageStatusUsageRecord {
public class StorageUsageUsageRecord extends StorageStatusUsageRecord implements SingleUsageRecord {
/**
* Generated Serial Version UID

View File

@ -6,6 +6,7 @@ package org.gcube.accounting.datamodel.implementations;
import java.util.Calendar;
import org.gcube.accounting.datamodel.RawUsageRecord;
import org.gcube.accounting.datamodel.SingleUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
import org.gcube.accounting.datamodel.annotations.ValidInteger;
import org.gcube.accounting.datamodel.annotations.ValidLong;
@ -15,7 +16,7 @@ import org.gcube.accounting.exception.InvalidValueException;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class TaskUsageRecord extends RawUsageRecord {
public class TaskUsageRecord extends RawUsageRecord implements SingleUsageRecord {
/**
* Generated Serial Version UID

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.accounting.datamodel.aggregated;
package org.gcube.accounting.datamodel.implementations.aggregated;
import org.gcube.accounting.datamodel.RawUsageRecord;
import org.gcube.accounting.datamodel.annotations.NotEmpty;
@ -11,7 +11,6 @@ import org.gcube.accounting.exception.InvalidValueException;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class StorageStatusUsageRecord extends RawUsageRecord {