refs #200: Create accouting-lib library

https://support.d4science.org/issues/200
Fixing validators

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115219 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-06-04 14:42:53 +00:00
parent 5a4ccd9e81
commit d7b5dca960
2 changed files with 6 additions and 3 deletions

View File

@ -101,6 +101,8 @@ public class RawUsageRecord implements UsageRecord, Serializable {
initializeValidation();
this.resourceSpecificProperties.put(ID, UUID.randomUUID().toString());
this.resourceSpecificProperties.put(RESOURCE_TYPE, this.getClass().getSimpleName());
Calendar calendar = Calendar.getInstance();
this.resourceSpecificProperties.put(CREATION_TIME, calendar.getTimeInMillis());
}
public RawUsageRecord(Map<String, Serializable> properties) throws InvalidValueException {

View File

@ -3,6 +3,7 @@
*/
package org.gcube.accounting.datamodel.implementations;
import org.gcube.accounting.datamodel.validators.NotEmptyIfNotNull;
import org.gcube.accounting.datamodel.validators.ValidIP;
import org.gcube.accounting.exception.InvalidValueException;
import org.gcube.common.validator.annotations.NotEmpty;
@ -11,14 +12,14 @@ import org.gcube.common.validator.annotations.NotEmpty;
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class StorageUsageRecord extends StorageStatusUsageRecord {
public class StorageUsageUsageRecord extends StorageStatusUsageRecord {
/**
* Generated Serial Version UID
*/
private static final long serialVersionUID = 1381025822586583326L;
@NotEmpty
@NotEmptyIfNotNull
public static final String OBJECT_URI = "objectURI";
@NotEmpty
public static final String OPERATION_TYPE = "operationType";
@ -26,7 +27,7 @@ public class StorageUsageRecord extends StorageStatusUsageRecord {
public static final String CALLER_IP = "callerIP";
public StorageUsageRecord(){
public StorageUsageUsageRecord(){
super();
}