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@115378 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-06-15 09:47:45 +00:00
parent cdb9707745
commit fc6d22b4e0
1 changed files with 41 additions and 7 deletions

View File

@ -144,6 +144,30 @@ public class RawUsageRecord extends BasicUsageRecord {
super(properties); super(properties);
} }
/**
* {@inheritDoc}
*/
@Override
public void setConsumerId(String consumerId) {
try{
setConsumerId(consumerId);
} catch(Exception e){
logger.error("Unable to Set {}", CONSUMER_ID);
}
}
/**
* {@inheritDoc}
*/
@Override
public void setResourceScope(String scope) {
try{
setResourceScope(scope);
}catch(Exception e){
logger.error("Unable to Set {}", RESOURCE_SCOPE);
}
}
/** /**
* Use {#getUsageRecordType} instead * Use {#getUsageRecordType} instead
* @param resourceType * @param resourceType
@ -186,7 +210,7 @@ public class RawUsageRecord extends BasicUsageRecord {
* @throws InvalidValueException * @throws InvalidValueException
*/ */
@Deprecated @Deprecated
public void setCreateTime(Date createTime) throws InvalidValueException { public void setCreateTime(Date createTime) {
/* /*
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(createTime); calendar.setTime(createTime);
@ -256,8 +280,12 @@ public class RawUsageRecord extends BasicUsageRecord {
* @throws InvalidValueException * @throws InvalidValueException
*/ */
@Deprecated @Deprecated
public void setResourceOwner(String owner) throws InvalidValueException { public void setResourceOwner(String owner) {
try {
setResourceProperty(RESOURCE_OWNER, owner); setResourceProperty(RESOURCE_OWNER, owner);
} catch (InvalidValueException e) {
logger.error("Unable to Set {}", RESOURCE_OWNER);
}
} }
/** /**
@ -300,8 +328,9 @@ public class RawUsageRecord extends BasicUsageRecord {
* Use {@link #setResourceSpecificProperties()} * Use {@link #setResourceSpecificProperties()}
*/ */
@Deprecated @Deprecated
public void setResourceSpecificProperties(Map<String, Serializable> properties) throws InvalidValueException { public void setResourceSpecificProperties(Map<String, String> properties) throws InvalidValueException {
setResourceProperties(properties); Map<String, Serializable> map = new HashMap<String, Serializable>(properties);
setResourceProperties(map);
} }
/** /**
@ -322,8 +351,13 @@ public class RawUsageRecord extends BasicUsageRecord {
* @param value the value of the given resource property * @param value the value of the given resource property
*/ */
@Deprecated @Deprecated
public void setResourceSpecificProperty(String key, Serializable value) throws InvalidValueException { public void setResourceSpecificProperty(String key, Serializable value) {
try {
setResourceProperty(key, value); setResourceProperty(key, value);
} catch (InvalidValueException e) {
logger.error("Unable to Set {}", key);
}
} }
/** /**