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:
parent
2c40f74786
commit
a8e522a45b
|
@ -22,6 +22,7 @@ import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord;
|
import org.gcube.accounting.datamodel.implementations.StorageUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.implementations.TaskUsageRecord;
|
import org.gcube.accounting.datamodel.implementations.TaskUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.validations.annotations.NotEmpty;
|
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.datamodel.validations.validators.NotEmptyIfNotNullValidator;
|
||||||
import org.gcube.accounting.exception.InvalidValueException;
|
import org.gcube.accounting.exception.InvalidValueException;
|
||||||
import org.slf4j.Logger;
|
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(){
|
public RawUsageRecord(){
|
||||||
super();
|
super();
|
||||||
this.resourceProperties.remove(USAGE_RECORD_TYPE);
|
this.resourceProperties.remove(USAGE_RECORD_TYPE);
|
||||||
|
@ -372,7 +376,7 @@ public class RawUsageRecord extends BasicUsageRecord {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public String getFullyQualifiedConsumerId() {
|
public String getFullyQualifiedConsumerId() {
|
||||||
return getConsumerId();
|
return (String) this.resourceProperties.get(FULLY_QUALIFIED_CONSUMER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -382,7 +386,11 @@ public class RawUsageRecord extends BasicUsageRecord {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setFullyQualifiedConsumerId(String fqcid) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue