Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.accounting.datamodel.basetypes;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.net.URI;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import org.gcube.accounting.datamodel.BasicUsageRecord;
|
|
|
|
import org.gcube.accounting.datamodel.validations.annotations.FixDataVolumeSign;
|
2017-05-11 16:38:38 +02:00
|
|
|
import org.gcube.accounting.datamodel.validations.annotations.ValidDataTypeVolume;
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
import org.gcube.accounting.datamodel.validations.annotations.ValidURI;
|
|
|
|
import org.gcube.documentstore.exception.InvalidValueException;
|
|
|
|
import org.gcube.documentstore.records.implementation.RequiredField;
|
|
|
|
import org.gcube.documentstore.records.implementation.validations.annotations.NotEmpty;
|
|
|
|
import org.gcube.documentstore.records.implementation.validations.annotations.ValidLong;
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
/**
|
|
|
|
* @author Alessandro Pieve (ISTI - CNR) alessandro.pieve@isti.cnr.it
|
2017-09-14 14:21:23 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
*/
|
|
|
|
public abstract class AbstractStorageStatusRecord extends BasicUsageRecord {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generated Serial Version UID
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = -5754343539116896036L;
|
|
|
|
|
|
|
|
public enum DataType {
|
2018-03-02 16:59:56 +01:00
|
|
|
STORAGE, TREE, GEO, DATABASE, LOCAL, OTHER
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : Quantity of data in terms of KB
|
|
|
|
*/
|
|
|
|
@RequiredField @ValidLong @FixDataVolumeSign
|
|
|
|
public static final String DATA_VOLUME = "dataVolume";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : type of data accessed.
|
2017-10-27 18:17:37 +02:00
|
|
|
* The value is a controlled dictionary by StorageStatusRecord.DataType
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
*/
|
2017-05-11 16:38:38 +02:00
|
|
|
@RequiredField @ValidDataTypeVolume
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public static final String DATA_TYPE = "dataType";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : data Count number of objects
|
|
|
|
*/
|
|
|
|
@RequiredField @NotEmpty
|
|
|
|
public static final String DATA_COUNT = "dataCount";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : data service class identifier
|
|
|
|
*/
|
|
|
|
@RequiredField @NotEmpty
|
|
|
|
public static final String DATA_SERVICECLASS = "dataServiceClass";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : data service name identifier
|
|
|
|
*/
|
|
|
|
@RequiredField @NotEmpty
|
|
|
|
public static final String DATA_SERVICENAME = "dataServiceName";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : data service name id
|
|
|
|
*/
|
|
|
|
@RequiredField @NotEmpty
|
|
|
|
public static final String DATA_SERVICEID = "dataServiceId";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KEY for : providerId the identifier of the provider which is the target of a read/write operation
|
|
|
|
*/
|
|
|
|
@RequiredField @ValidURI
|
|
|
|
public static final String PROVIDER_ID = "providerId";
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractStorageStatusRecord() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
public AbstractStorageStatusRecord(Map<String, ? extends Serializable> properties) throws InvalidValueException {
|
|
|
|
super(properties);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final String ABSTRACT_TO_REPLACE = "Abstract";
|
|
|
|
|
|
|
|
@Override
|
2017-09-06 11:47:13 +02:00
|
|
|
public String getRecordType() {
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
return AbstractStorageStatusRecord.class.getSimpleName().replace(ABSTRACT_TO_REPLACE, "");
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public long getDataVolume() {
|
|
|
|
return (Long) this.resourceProperties.get(DATA_VOLUME);
|
|
|
|
}
|
2017-05-11 16:38:38 +02:00
|
|
|
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public void setDataVolume(long dataVolume) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_VOLUME, dataVolume);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public DataType getDataType() {
|
|
|
|
return (DataType) this.resourceProperties.get(DATA_TYPE);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDataType(DataType dataType) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_TYPE, dataType);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public long getDataCount() {
|
|
|
|
return (Long) this.resourceProperties.get(DATA_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDataCount(long dataCount) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_COUNT, dataCount);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public String getDataServiceClass() {
|
|
|
|
return (String) this.resourceProperties.get(DATA_SERVICECLASS);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDataServiceClass(String dataServiceClass) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_SERVICECLASS, dataServiceClass);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public String getDataServiceName() {
|
|
|
|
return (String) this.resourceProperties.get(DATA_SERVICENAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDataServiceName(String dataServiceName) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_SERVICENAME, dataServiceName);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public String getDataServiceId() {
|
|
|
|
return (String) this.resourceProperties.get(DATA_SERVICEID);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDataServiceId(String dataServiceId) throws InvalidValueException {
|
|
|
|
setResourceProperty(DATA_SERVICEID, dataServiceId);
|
|
|
|
}
|
|
|
|
|
2017-09-21 09:52:10 +02:00
|
|
|
@JsonIgnore
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public URI getProviderId() {
|
|
|
|
return (URI) this.resourceProperties.get(PROVIDER_ID);
|
|
|
|
}
|
2017-05-11 16:38:38 +02:00
|
|
|
|
Add a new UsageRecord for Storage Volume
e.g.
{
"scope": "/gcube",
"operationCount": 2,
"dataCount": 2802,
"dataServiceName": "dataServiceName",
"endTime": 1480606453491,
"consumerId": "alessandro.pieve",
"startTime": 1480606453487,
"id": "6e6808bf-3567-4ebf-93d3-0d55c97202a1",
"dataVolume": 5104,
"dataType": "STORAGE",
"operationResult": "SUCCESS",
"dataServiceId": "dataServiceId",
"aggregated": true,
"providerId": "testprotocol://providerURI",
"creationTime": 1480606453494,
"recordType": "StorageStatusRecord",
"dataServiceClass": "dataServiceClass"
}
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@141599 82a268e6-3cf1-43bd-a215-b396298e98cf
2017-01-17 11:59:14 +01:00
|
|
|
public void setProviderId(URI provideId) throws InvalidValueException {
|
|
|
|
setResourceProperty(PROVIDER_ID, provideId);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|