refs #200: Create accouting-lib library

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

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115389 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-06-15 13:53:40 +00:00
parent 2c40f74786
commit a8e522a45b
1 changed files with 10 additions and 2 deletions

View File

@ -22,6 +22,7 @@ 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.datamodel.validations.validators.NotEmptyIfNotNullValidator;
import org.gcube.accounting.exception.InvalidValueException;
import org.slf4j.Logger;
@ -135,6 +136,9 @@ public class RawUsageRecord extends BasicUsageRecord {
}
}
@NotEmptyIfNotNull @DeprecatedWarning
protected static final String FULLY_QUALIFIED_CONSUMER_ID = "fullyQualifiedConsumerId";
public RawUsageRecord(){
super();
this.resourceProperties.remove(USAGE_RECORD_TYPE);
@ -372,7 +376,7 @@ public class RawUsageRecord extends BasicUsageRecord {
*/
@Deprecated
public String getFullyQualifiedConsumerId() {
return getConsumerId();
return (String) this.resourceProperties.get(FULLY_QUALIFIED_CONSUMER_ID);
}
/**
@ -382,7 +386,11 @@ public class RawUsageRecord extends BasicUsageRecord {
*/
@Deprecated
public void setFullyQualifiedConsumerId(String fqcid) {
// TODO
try {
setResourceProperty(FULLY_QUALIFIED_CONSUMER_ID, fqcid);
} catch (InvalidValueException e) {
logger.error("Unable to Set {}", FULLY_QUALIFIED_CONSUMER_ID);
}
}