From e199610172ac4827970998fc2b4d2ab7adec28a1 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 15 Jun 2015 10:00:55 +0000 Subject: [PATCH] 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@115379 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 1 + .../accounting/datamodel/RawUsageRecord.java | 13 ++++-- .../accounting/messaging/QueueCouple.java | 40 +++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 src/main/java/org/gcube/accounting/messaging/QueueCouple.java diff --git a/.classpath b/.classpath index f619a53..a673149 100644 --- a/.classpath +++ b/.classpath @@ -20,6 +20,7 @@ + diff --git a/src/main/java/org/gcube/accounting/datamodel/RawUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/RawUsageRecord.java index 24c5bb5..4fa1a77 100644 --- a/src/main/java/org/gcube/accounting/datamodel/RawUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/RawUsageRecord.java @@ -319,8 +319,13 @@ public class RawUsageRecord extends BasicUsageRecord { * @return a Map containing the properties */ @Deprecated - public Map getResourceSpecificProperties() { - return getResourceProperties(); + public Map getResourceSpecificProperties() { + Map ret = new HashMap(); + for(String key : this.resourceProperties.keySet()){ + String value = this.resourceProperties.get(key).toString(); + ret.put(key, value); + } + return ret; } /** @@ -339,8 +344,8 @@ public class RawUsageRecord extends BasicUsageRecord { * @return the value of the given resource property */ @Deprecated - public Serializable getResourceSpecificProperty(String key) { - return getResourceProperty(key); + public String getResourceSpecificProperty(String key) { + return getResourceProperty(key).toString(); } /** diff --git a/src/main/java/org/gcube/accounting/messaging/QueueCouple.java b/src/main/java/org/gcube/accounting/messaging/QueueCouple.java new file mode 100644 index 0000000..e0057bb --- /dev/null +++ b/src/main/java/org/gcube/accounting/messaging/QueueCouple.java @@ -0,0 +1,40 @@ +package org.gcube.accounting.messaging; + +@Deprecated +public class QueueCouple { + + private String broker; + private String scope; + + @Deprecated + public QueueCouple(String broker, String scope) { + super(); + this.broker = broker; + this.scope = scope; + } + + @Deprecated + public String getBroker() { + return broker; + } + + @Deprecated + public void setBroker(String broker) { + this.broker = broker; + } + + @Deprecated + public String getScope() { + return scope; + } + + @Deprecated + public void setScope(String scope) { + this.scope = scope; + } + + + + + +}