From 57d4eb828d18a83aa711c2cabc9c61756563c778 Mon Sep 17 00:00:00 2001 From: Christos KK Loverdos Date: Thu, 30 Aug 2012 14:59:35 +0300 Subject: [PATCH] More Avro stuff --- src/main/avro/aquarium-anyvalue.avdl | 49 ++ src/main/avro/aquarium-bill.avdl | 71 ++ src/main/avro/aquarium-conf.avdl | 16 - src/main/avro/aquarium-events.avdl | 12 +- src/main/avro/aquarium-user-state.avdl | 107 +++ .../aquarium/message/avro/gen/AquariumAny.java | 16 + .../aquarium/message/avro/gen/AquariumBill.java | 16 + .../aquarium/message/avro/gen/AquariumConf.java | 2 +- .../message/avro/gen/AquariumUserState.java | 16 + .../aquarium/message/avro/gen/_BillEntry.java | 464 ++++++++++++ .../aquarium/message/avro/gen/_ChargeEntry.java | 366 ++++++++++ .../aquarium/message/avro/gen/_Chargeslot.java | 313 ++++++++ .../aquarium/message/avro/gen/_EventEntry.java | 170 +++++ .../aquarium/message/avro/gen/_ResourceEntry.java | 317 +++++++++ .../aquarium/message/avro/gen/_UserAgreement.java | 364 ++++++++++ .../aquarium/message/avro/gen/_WalletEntry.java | 748 ++++++++++++++++++++ .../message/avro/gen/_WorkingAgreementHistory.java | 121 ++++ .../gen/_WorkingResourceInstanceChargingState.java | 411 +++++++++++ .../avro/gen/_WorkingResourcesChargingState.java | 170 +++++ .../message/avro/gen/_WorkingUserState.java | 558 +++++++++++++++ .../grnet/aquarium/charging/ChargingBehavior.scala | 2 +- .../state/ResourceInstanceChargingState.scala | 4 +- .../state/ResourceInstanceChargingStateModel.scala | 2 +- .../WorkingResourceInstanceChargingState.scala | 4 +- .../message/avro/FullPriceTableHelpers.scala | 184 +++++ 25 files changed, 4469 insertions(+), 34 deletions(-) create mode 100644 src/main/avro/aquarium-anyvalue.avdl create mode 100644 src/main/avro/aquarium-bill.avdl create mode 100644 src/main/avro/aquarium-user-state.avdl create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumAny.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumBill.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumUserState.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_BillEntry.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_ChargeEntry.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_Chargeslot.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_EventEntry.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_ResourceEntry.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_UserAgreement.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_WalletEntry.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingAgreementHistory.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourceInstanceChargingState.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourcesChargingState.java create mode 100644 src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingUserState.java create mode 100644 src/main/scala/gr/grnet/aquarium/message/avro/FullPriceTableHelpers.scala diff --git a/src/main/avro/aquarium-anyvalue.avdl b/src/main/avro/aquarium-anyvalue.avdl new file mode 100644 index 0000000..1f457cb --- /dev/null +++ b/src/main/avro/aquarium-anyvalue.avdl @@ -0,0 +1,49 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +@namespace("gr.grnet.aquarium.message.avro.gen") +protocol AquariumAny { + record _AnyValue { + union { + null, + int, + long, + boolean, + double, + bytes, + string + } anyValue; + } +} \ No newline at end of file diff --git a/src/main/avro/aquarium-bill.avdl b/src/main/avro/aquarium-bill.avdl new file mode 100644 index 0000000..711b784 --- /dev/null +++ b/src/main/avro/aquarium-bill.avdl @@ -0,0 +1,71 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +@namespace("gr.grnet.aquarium.message.avro.gen") +protocol AquariumBill { + + record _ChargeEntry { + string id; + string unitPrice; + string startTime; + string endTime; + string ellapsedTime; + string credits; + } + + record _EventEntry { + string eventType; + array<_ChargeEntry> details; + } + + record _ResourceEntry { + string resourceName; + string resourceType; + string unitName; + string totalCredits; + array<_EventEntry> details; + } + + record _BillEntry { + string id; + string userID; + string status; + string remainingCredits; + string deductedCredits; + string startTime; // what is this? millis? date? + string endTime; + array<_ResourceEntry> bill; + } +} \ No newline at end of file diff --git a/src/main/avro/aquarium-conf.avdl b/src/main/avro/aquarium-conf.avdl index ac4bac6..eb72bef 100644 --- a/src/main/avro/aquarium-conf.avdl +++ b/src/main/avro/aquarium-conf.avdl @@ -35,22 +35,6 @@ @namespace("gr.grnet.aquarium.message.avro.gen") protocol AquariumConf { - enum _EventVersion { - VERSION_1_0 - } - - record _AnyValue { - union { - null, - int, - long, - boolean, - double, - bytes, - string - } anyValue; - } - record _ResourceType { string name; string unit; diff --git a/src/main/avro/aquarium-events.avdl b/src/main/avro/aquarium-events.avdl index 7a4e2a4..d435298 100644 --- a/src/main/avro/aquarium-events.avdl +++ b/src/main/avro/aquarium-events.avdl @@ -35,17 +35,7 @@ @namespace("gr.grnet.aquarium.message.avro.gen") protocol AquariumEvents { - record _AnyValue { - union { - null, - int, - long, - boolean, - double, - bytes, - string - } anyValue; - } + import idl "aquarium-anyvalue.avdl"; record _ResourceEvent { string @aliases(["originalID", "ID"]) id; diff --git a/src/main/avro/aquarium-user-state.avdl b/src/main/avro/aquarium-user-state.avdl new file mode 100644 index 0000000..c847449 --- /dev/null +++ b/src/main/avro/aquarium-user-state.avdl @@ -0,0 +1,107 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +@namespace("gr.grnet.aquarium.message.avro.gen") +protocol AquariumUserState { + import idl "aquarium-conf.avdl"; + import idl "aquarium-anyvalue.avdl"; + import idl "aquarium-events.avdl"; + + record _UserAgreement { + string id; + union {string, null} relatedIMEventID; + long @order("ascending") validFromMillis; + long validToMillis; + string role; + union {_FullPriceTable, null} fullPriceTableRef; // If null, then get from aquarium policy + } + + record _WorkingResourceInstanceChargingState { + map<_AnyValue> details; + array<_ResourceEvent> previousEvents; + array<_ResourceEvent> implicitlyIssuedStartEvents; + double accumulatingAmount; + double oldAccumulatingAmount; + double previousValue; + double currentValue; + } + + record _WorkingResourcesChargingState { + map<_AnyValue> details; + map<_WorkingResourceInstanceChargingState> stateOfResourceInstance; + } + + record _WorkingAgreementHistory { + array<_UserAgreement> agreements; + } + + record _Chargeslot { + long startMillis; + long stopMillis; + double unitPrice; + string explanation = ""; + double creditsToSubtract; + } + + record _WalletEntry { + string userID; + double sumOfCreditsToSubtract; + double oldTotalCredits; + double newTotalCredits; + long whenComputedMillis; + long referenceStartMillis; + long referenceStopMillis; + int billingYear; + int billingMonth; + int billingDay; + array<_Chargeslot> chargeslots; + array<_ResourceEvent> resourceEvents; // current is the last one + _ResourceType resourceType; + boolean isSynthetic = false; + } + + record _WorkingUserState { + string userID; + union {string, null} parentUserStateIDInStore; + map<_ResourceType> resourceTypesMap; + map<_WorkingResourcesChargingState> workingStateOfResources; + double totalCredits; + _WorkingAgreementHistory workingAgreementHistory; + long latestUpdateMillis; + long latestResourceEventOccurredMillis; + long billingPeriodOutOfSyncResourceEventsCounter; + array<_WalletEntry> walletEntries; + } +} \ No newline at end of file diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumAny.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumAny.java new file mode 100644 index 0000000..6200964 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumAny.java @@ -0,0 +1,16 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; + +@SuppressWarnings("all") +public interface AquariumAny { + public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"AquariumAny\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"types\":[{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}],\"messages\":{}}"); + + @SuppressWarnings("all") + public interface Callback extends AquariumAny { + public static final org.apache.avro.Protocol PROTOCOL = gr.grnet.aquarium.message.avro.gen.AquariumAny.PROTOCOL; + } +} \ No newline at end of file diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumBill.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumBill.java new file mode 100644 index 0000000..72239ca --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumBill.java @@ -0,0 +1,16 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; + +@SuppressWarnings("all") +public interface AquariumBill { + public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"AquariumBill\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"types\":[{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_EventEntry\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":\"_ChargeEntry\"}}]},{\"type\":\"record\",\"name\":\"_ResourceEntry\",\"fields\":[{\"name\":\"resourceName\",\"type\":\"string\"},{\"name\":\"resourceType\",\"type\":\"string\"},{\"name\":\"unitName\",\"type\":\"string\"},{\"name\":\"totalCredits\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":\"_EventEntry\"}}]},{\"type\":\"record\",\"name\":\"_BillEntry\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"status\",\"type\":\"string\"},{\"name\":\"remainingCredits\",\"type\":\"string\"},{\"name\":\"deductedCredits\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"bill\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEntry\"}}]}],\"messages\":{}}"); + + @SuppressWarnings("all") + public interface Callback extends AquariumBill { + public static final org.apache.avro.Protocol PROTOCOL = gr.grnet.aquarium.message.avro.gen.AquariumBill.PROTOCOL; + } +} \ No newline at end of file diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumConf.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumConf.java index 6e0f6a1..4544491 100644 --- a/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumConf.java +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumConf.java @@ -7,7 +7,7 @@ package gr.grnet.aquarium.message.avro.gen; @SuppressWarnings("all") public interface AquariumConf { - public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"AquariumConf\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"types\":[{\"type\":\"enum\",\"name\":\"_EventVersion\",\"symbols\":[\"VERSION_1_0\"]},{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]},{\"type\":\"record\",\"name\":\"_ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[\"_CronSpecTuple\",\"null\"]}]},{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":\"_EffectiveUnitPrice\"}}]},{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[\"_EffectivePriceTable\",{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]},{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":\"_SelectorValue\"}}}]},{\"type\":\"record\",\"name\":\"_Policy\",\"fields\":[{\"name\":\"ID\",\"type\":\"string\",\"aliases\":[\"id, _id, idInStore, inStoreID\"]},{\"name\":\"parentID\",\"type\":\"string\"},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"resourceTypes\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceType\"}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"roleMapping\",\"type\":{\"type\":\"map\",\"values\":\"_FullPriceTable\"}}]}],\"messages\":{}}"); + public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"AquariumConf\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"types\":[{\"type\":\"record\",\"name\":\"_ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[\"_CronSpecTuple\",\"null\"]}]},{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":\"_EffectiveUnitPrice\"}}]},{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[\"_EffectivePriceTable\",{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]},{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":\"_SelectorValue\"}}}]},{\"type\":\"record\",\"name\":\"_Policy\",\"fields\":[{\"name\":\"ID\",\"type\":\"string\",\"aliases\":[\"id, _id, idInStore, inStoreID\"]},{\"name\":\"parentID\",\"type\":\"string\"},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"resourceTypes\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceType\"}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"roleMapping\",\"type\":{\"type\":\"map\",\"values\":\"_FullPriceTable\"}}]}],\"messages\":{}}"); @SuppressWarnings("all") public interface Callback extends AquariumConf { diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumUserState.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumUserState.java new file mode 100644 index 0000000..c46edf3 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/AquariumUserState.java @@ -0,0 +1,16 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; + +@SuppressWarnings("all") +public interface AquariumUserState { + public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"AquariumUserState\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"types\":[{\"type\":\"record\",\"name\":\"_ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[\"_CronSpecTuple\",\"null\"]}]},{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":\"_EffectiveUnitPrice\"}}]},{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[\"_EffectivePriceTable\",{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]},{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":\"_SelectorValue\"}}}]},{\"type\":\"record\",\"name\":\"_Policy\",\"fields\":[{\"name\":\"ID\",\"type\":\"string\",\"aliases\":[\"id, _id, idInStore, inStoreID\"]},{\"name\":\"parentID\",\"type\":\"string\"},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"resourceTypes\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceType\"}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"roleMapping\",\"type\":{\"type\":\"map\",\"values\":\"_FullPriceTable\"}}]},{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]},{\"type\":\"record\",\"name\":\"_ResourceEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"resource\",\"type\":\"string\",\"aliases\":[\"resourceType\"]},{\"name\":\"instanceID\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}}]},{\"type\":\"record\",\"name\":\"_IMEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"isActive\",\"type\":\"boolean\"},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}}]},{\"type\":\"record\",\"name\":\"_UserAgreement\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"relatedIMEventID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"fullPriceTableRef\",\"type\":[\"_FullPriceTable\",\"null\"]}]},{\"type\":\"record\",\"name\":\"_WorkingResourceInstanceChargingState\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}},{\"name\":\"previousEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"implicitlyIssuedStartEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"accumulatingAmount\",\"type\":\"double\"},{\"name\":\"oldAccumulatingAmount\",\"type\":\"double\"},{\"name\":\"previousValue\",\"type\":\"double\"},{\"name\":\"currentValue\",\"type\":\"double\"}]},{\"type\":\"record\",\"name\":\"_WorkingResourcesChargingState\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}},{\"name\":\"stateOfResourceInstance\",\"type\":{\"type\":\"map\",\"values\":\"_WorkingResourceInstanceChargingState\"}}]},{\"type\":\"record\",\"name\":\"_WorkingAgreementHistory\",\"fields\":[{\"name\":\"agreements\",\"type\":{\"type\":\"array\",\"items\":\"_UserAgreement\"}}]},{\"type\":\"record\",\"name\":\"_Chargeslot\",\"fields\":[{\"name\":\"startMillis\",\"type\":\"long\"},{\"name\":\"stopMillis\",\"type\":\"long\"},{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"explanation\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"creditsToSubtract\",\"type\":\"double\"}]},{\"type\":\"record\",\"name\":\"_WalletEntry\",\"fields\":[{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"sumOfCreditsToSubtract\",\"type\":\"double\"},{\"name\":\"oldTotalCredits\",\"type\":\"double\"},{\"name\":\"newTotalCredits\",\"type\":\"double\"},{\"name\":\"whenComputedMillis\",\"type\":\"long\"},{\"name\":\"referenceStartMillis\",\"type\":\"long\"},{\"name\":\"referenceStopMillis\",\"type\":\"long\"},{\"name\":\"billingYear\",\"type\":\"int\"},{\"name\":\"billingMonth\",\"type\":\"int\"},{\"name\":\"billingDay\",\"type\":\"int\"},{\"name\":\"chargeslots\",\"type\":{\"type\":\"array\",\"items\":\"_Chargeslot\"}},{\"name\":\"resourceEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"resourceType\",\"type\":\"_ResourceType\"},{\"name\":\"isSynthetic\",\"type\":\"boolean\",\"default\":false}]},{\"type\":\"record\",\"name\":\"_WorkingUserState\",\"fields\":[{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"parentUserStateIDInStore\",\"type\":[\"string\",\"null\"]},{\"name\":\"resourceTypesMap\",\"type\":{\"type\":\"map\",\"values\":\"_ResourceType\"}},{\"name\":\"workingStateOfResources\",\"type\":{\"type\":\"map\",\"values\":\"_WorkingResourcesChargingState\"}},{\"name\":\"totalCredits\",\"type\":\"double\"},{\"name\":\"workingAgreementHistory\",\"type\":\"_WorkingAgreementHistory\"},{\"name\":\"latestUpdateMillis\",\"type\":\"long\"},{\"name\":\"latestResourceEventOccurredMillis\",\"type\":\"long\"},{\"name\":\"billingPeriodOutOfSyncResourceEventsCounter\",\"type\":\"long\"},{\"name\":\"walletEntries\",\"type\":{\"type\":\"array\",\"items\":\"_WalletEntry\"}}]}],\"messages\":{}}"); + + @SuppressWarnings("all") + public interface Callback extends AquariumUserState { + public static final org.apache.avro.Protocol PROTOCOL = gr.grnet.aquarium.message.avro.gen.AquariumUserState.PROTOCOL; + } +} \ No newline at end of file diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_BillEntry.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_BillEntry.java new file mode 100644 index 0000000..4ad52cd --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_BillEntry.java @@ -0,0 +1,464 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _BillEntry extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_BillEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"status\",\"type\":\"string\"},{\"name\":\"remainingCredits\",\"type\":\"string\"},{\"name\":\"deductedCredits\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"bill\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ResourceEntry\",\"fields\":[{\"name\":\"resourceName\",\"type\":\"string\"},{\"name\":\"resourceType\",\"type\":\"string\"},{\"name\":\"unitName\",\"type\":\"string\"},{\"name\":\"totalCredits\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_EventEntry\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]}}}]}}}]}}}]}"); + @Deprecated public java.lang.CharSequence id; + @Deprecated public java.lang.CharSequence userID; + @Deprecated public java.lang.CharSequence status; + @Deprecated public java.lang.CharSequence remainingCredits; + @Deprecated public java.lang.CharSequence deductedCredits; + @Deprecated public java.lang.CharSequence startTime; + @Deprecated public java.lang.CharSequence endTime; + @Deprecated public java.util.List bill; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return id; + case 1: return userID; + case 2: return status; + case 3: return remainingCredits; + case 4: return deductedCredits; + case 5: return startTime; + case 6: return endTime; + case 7: return bill; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: id = (java.lang.CharSequence)value$; break; + case 1: userID = (java.lang.CharSequence)value$; break; + case 2: status = (java.lang.CharSequence)value$; break; + case 3: remainingCredits = (java.lang.CharSequence)value$; break; + case 4: deductedCredits = (java.lang.CharSequence)value$; break; + case 5: startTime = (java.lang.CharSequence)value$; break; + case 6: endTime = (java.lang.CharSequence)value$; break; + case 7: bill = (java.util.List)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'id' field. + */ + public java.lang.CharSequence getId() { + return id; + } + + /** + * Sets the value of the 'id' field. + * @param value the value to set. + */ + public void setId(java.lang.CharSequence value) { + this.id = value; + } + + /** + * Gets the value of the 'userID' field. + */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** + * Sets the value of the 'userID' field. + * @param value the value to set. + */ + public void setUserID(java.lang.CharSequence value) { + this.userID = value; + } + + /** + * Gets the value of the 'status' field. + */ + public java.lang.CharSequence getStatus() { + return status; + } + + /** + * Sets the value of the 'status' field. + * @param value the value to set. + */ + public void setStatus(java.lang.CharSequence value) { + this.status = value; + } + + /** + * Gets the value of the 'remainingCredits' field. + */ + public java.lang.CharSequence getRemainingCredits() { + return remainingCredits; + } + + /** + * Sets the value of the 'remainingCredits' field. + * @param value the value to set. + */ + public void setRemainingCredits(java.lang.CharSequence value) { + this.remainingCredits = value; + } + + /** + * Gets the value of the 'deductedCredits' field. + */ + public java.lang.CharSequence getDeductedCredits() { + return deductedCredits; + } + + /** + * Sets the value of the 'deductedCredits' field. + * @param value the value to set. + */ + public void setDeductedCredits(java.lang.CharSequence value) { + this.deductedCredits = value; + } + + /** + * Gets the value of the 'startTime' field. + */ + public java.lang.CharSequence getStartTime() { + return startTime; + } + + /** + * Sets the value of the 'startTime' field. + * @param value the value to set. + */ + public void setStartTime(java.lang.CharSequence value) { + this.startTime = value; + } + + /** + * Gets the value of the 'endTime' field. + */ + public java.lang.CharSequence getEndTime() { + return endTime; + } + + /** + * Sets the value of the 'endTime' field. + * @param value the value to set. + */ + public void setEndTime(java.lang.CharSequence value) { + this.endTime = value; + } + + /** + * Gets the value of the 'bill' field. + */ + public java.util.List getBill() { + return bill; + } + + /** + * Sets the value of the 'bill' field. + * @param value the value to set. + */ + public void setBill(java.util.List value) { + this.bill = value; + } + + /** Creates a new _BillEntry RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._BillEntry.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._BillEntry.Builder(); + } + + /** Creates a new _BillEntry RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._BillEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._BillEntry.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._BillEntry.Builder(other); + } + + /** Creates a new _BillEntry RecordBuilder by copying an existing _BillEntry instance */ + public static gr.grnet.aquarium.message.avro.gen._BillEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._BillEntry other) { + return new gr.grnet.aquarium.message.avro.gen._BillEntry.Builder(other); + } + + /** + * RecordBuilder for _BillEntry instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_BillEntry> + implements org.apache.avro.data.RecordBuilder<_BillEntry> { + + private java.lang.CharSequence id; + private java.lang.CharSequence userID; + private java.lang.CharSequence status; + private java.lang.CharSequence remainingCredits; + private java.lang.CharSequence deductedCredits; + private java.lang.CharSequence startTime; + private java.lang.CharSequence endTime; + private java.util.List bill; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._BillEntry.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._BillEntry.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _BillEntry instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._BillEntry other) { + super(gr.grnet.aquarium.message.avro.gen._BillEntry.SCHEMA$); + if (isValidValue(fields()[0], other.id)) { + this.id = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.id); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.userID)) { + this.userID = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.userID); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.status)) { + this.status = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.status); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.remainingCredits)) { + this.remainingCredits = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.remainingCredits); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.deductedCredits)) { + this.deductedCredits = (java.lang.CharSequence) data().deepCopy(fields()[4].schema(), other.deductedCredits); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.startTime)) { + this.startTime = (java.lang.CharSequence) data().deepCopy(fields()[5].schema(), other.startTime); + fieldSetFlags()[5] = true; + } + if (isValidValue(fields()[6], other.endTime)) { + this.endTime = (java.lang.CharSequence) data().deepCopy(fields()[6].schema(), other.endTime); + fieldSetFlags()[6] = true; + } + if (isValidValue(fields()[7], other.bill)) { + this.bill = (java.util.List) data().deepCopy(fields()[7].schema(), other.bill); + fieldSetFlags()[7] = true; + } + } + + /** Gets the value of the 'id' field */ + public java.lang.CharSequence getId() { + return id; + } + + /** Sets the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setId(java.lang.CharSequence value) { + validate(fields()[0], value); + this.id = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'id' field has been set */ + public boolean hasId() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearId() { + id = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'userID' field */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** Sets the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setUserID(java.lang.CharSequence value) { + validate(fields()[1], value); + this.userID = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'userID' field has been set */ + public boolean hasUserID() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearUserID() { + userID = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'status' field */ + public java.lang.CharSequence getStatus() { + return status; + } + + /** Sets the value of the 'status' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setStatus(java.lang.CharSequence value) { + validate(fields()[2], value); + this.status = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'status' field has been set */ + public boolean hasStatus() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'status' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearStatus() { + status = null; + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'remainingCredits' field */ + public java.lang.CharSequence getRemainingCredits() { + return remainingCredits; + } + + /** Sets the value of the 'remainingCredits' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setRemainingCredits(java.lang.CharSequence value) { + validate(fields()[3], value); + this.remainingCredits = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'remainingCredits' field has been set */ + public boolean hasRemainingCredits() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'remainingCredits' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearRemainingCredits() { + remainingCredits = null; + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'deductedCredits' field */ + public java.lang.CharSequence getDeductedCredits() { + return deductedCredits; + } + + /** Sets the value of the 'deductedCredits' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setDeductedCredits(java.lang.CharSequence value) { + validate(fields()[4], value); + this.deductedCredits = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'deductedCredits' field has been set */ + public boolean hasDeductedCredits() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'deductedCredits' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearDeductedCredits() { + deductedCredits = null; + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'startTime' field */ + public java.lang.CharSequence getStartTime() { + return startTime; + } + + /** Sets the value of the 'startTime' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setStartTime(java.lang.CharSequence value) { + validate(fields()[5], value); + this.startTime = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'startTime' field has been set */ + public boolean hasStartTime() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'startTime' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearStartTime() { + startTime = null; + fieldSetFlags()[5] = false; + return this; + } + + /** Gets the value of the 'endTime' field */ + public java.lang.CharSequence getEndTime() { + return endTime; + } + + /** Sets the value of the 'endTime' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setEndTime(java.lang.CharSequence value) { + validate(fields()[6], value); + this.endTime = value; + fieldSetFlags()[6] = true; + return this; + } + + /** Checks whether the 'endTime' field has been set */ + public boolean hasEndTime() { + return fieldSetFlags()[6]; + } + + /** Clears the value of the 'endTime' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearEndTime() { + endTime = null; + fieldSetFlags()[6] = false; + return this; + } + + /** Gets the value of the 'bill' field */ + public java.util.List getBill() { + return bill; + } + + /** Sets the value of the 'bill' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder setBill(java.util.List value) { + validate(fields()[7], value); + this.bill = value; + fieldSetFlags()[7] = true; + return this; + } + + /** Checks whether the 'bill' field has been set */ + public boolean hasBill() { + return fieldSetFlags()[7]; + } + + /** Clears the value of the 'bill' field */ + public gr.grnet.aquarium.message.avro.gen._BillEntry.Builder clearBill() { + bill = null; + fieldSetFlags()[7] = false; + return this; + } + + @Override + public _BillEntry build() { + try { + _BillEntry record = new _BillEntry(); + record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); + record.userID = fieldSetFlags()[1] ? this.userID : (java.lang.CharSequence) defaultValue(fields()[1]); + record.status = fieldSetFlags()[2] ? this.status : (java.lang.CharSequence) defaultValue(fields()[2]); + record.remainingCredits = fieldSetFlags()[3] ? this.remainingCredits : (java.lang.CharSequence) defaultValue(fields()[3]); + record.deductedCredits = fieldSetFlags()[4] ? this.deductedCredits : (java.lang.CharSequence) defaultValue(fields()[4]); + record.startTime = fieldSetFlags()[5] ? this.startTime : (java.lang.CharSequence) defaultValue(fields()[5]); + record.endTime = fieldSetFlags()[6] ? this.endTime : (java.lang.CharSequence) defaultValue(fields()[6]); + record.bill = fieldSetFlags()[7] ? this.bill : (java.util.List) defaultValue(fields()[7]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_ChargeEntry.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_ChargeEntry.java new file mode 100644 index 0000000..db17d3b --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_ChargeEntry.java @@ -0,0 +1,366 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _ChargeEntry extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]}"); + @Deprecated public java.lang.CharSequence id; + @Deprecated public java.lang.CharSequence unitPrice; + @Deprecated public java.lang.CharSequence startTime; + @Deprecated public java.lang.CharSequence endTime; + @Deprecated public java.lang.CharSequence ellapsedTime; + @Deprecated public java.lang.CharSequence credits; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return id; + case 1: return unitPrice; + case 2: return startTime; + case 3: return endTime; + case 4: return ellapsedTime; + case 5: return credits; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: id = (java.lang.CharSequence)value$; break; + case 1: unitPrice = (java.lang.CharSequence)value$; break; + case 2: startTime = (java.lang.CharSequence)value$; break; + case 3: endTime = (java.lang.CharSequence)value$; break; + case 4: ellapsedTime = (java.lang.CharSequence)value$; break; + case 5: credits = (java.lang.CharSequence)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'id' field. + */ + public java.lang.CharSequence getId() { + return id; + } + + /** + * Sets the value of the 'id' field. + * @param value the value to set. + */ + public void setId(java.lang.CharSequence value) { + this.id = value; + } + + /** + * Gets the value of the 'unitPrice' field. + */ + public java.lang.CharSequence getUnitPrice() { + return unitPrice; + } + + /** + * Sets the value of the 'unitPrice' field. + * @param value the value to set. + */ + public void setUnitPrice(java.lang.CharSequence value) { + this.unitPrice = value; + } + + /** + * Gets the value of the 'startTime' field. + */ + public java.lang.CharSequence getStartTime() { + return startTime; + } + + /** + * Sets the value of the 'startTime' field. + * @param value the value to set. + */ + public void setStartTime(java.lang.CharSequence value) { + this.startTime = value; + } + + /** + * Gets the value of the 'endTime' field. + */ + public java.lang.CharSequence getEndTime() { + return endTime; + } + + /** + * Sets the value of the 'endTime' field. + * @param value the value to set. + */ + public void setEndTime(java.lang.CharSequence value) { + this.endTime = value; + } + + /** + * Gets the value of the 'ellapsedTime' field. + */ + public java.lang.CharSequence getEllapsedTime() { + return ellapsedTime; + } + + /** + * Sets the value of the 'ellapsedTime' field. + * @param value the value to set. + */ + public void setEllapsedTime(java.lang.CharSequence value) { + this.ellapsedTime = value; + } + + /** + * Gets the value of the 'credits' field. + */ + public java.lang.CharSequence getCredits() { + return credits; + } + + /** + * Sets the value of the 'credits' field. + * @param value the value to set. + */ + public void setCredits(java.lang.CharSequence value) { + this.credits = value; + } + + /** Creates a new _ChargeEntry RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder(); + } + + /** Creates a new _ChargeEntry RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder(other); + } + + /** Creates a new _ChargeEntry RecordBuilder by copying an existing _ChargeEntry instance */ + public static gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._ChargeEntry other) { + return new gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder(other); + } + + /** + * RecordBuilder for _ChargeEntry instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_ChargeEntry> + implements org.apache.avro.data.RecordBuilder<_ChargeEntry> { + + private java.lang.CharSequence id; + private java.lang.CharSequence unitPrice; + private java.lang.CharSequence startTime; + private java.lang.CharSequence endTime; + private java.lang.CharSequence ellapsedTime; + private java.lang.CharSequence credits; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._ChargeEntry.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _ChargeEntry instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._ChargeEntry other) { + super(gr.grnet.aquarium.message.avro.gen._ChargeEntry.SCHEMA$); + if (isValidValue(fields()[0], other.id)) { + this.id = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.id); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.unitPrice)) { + this.unitPrice = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.unitPrice); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.startTime)) { + this.startTime = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.startTime); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.endTime)) { + this.endTime = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.endTime); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.ellapsedTime)) { + this.ellapsedTime = (java.lang.CharSequence) data().deepCopy(fields()[4].schema(), other.ellapsedTime); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.credits)) { + this.credits = (java.lang.CharSequence) data().deepCopy(fields()[5].schema(), other.credits); + fieldSetFlags()[5] = true; + } + } + + /** Gets the value of the 'id' field */ + public java.lang.CharSequence getId() { + return id; + } + + /** Sets the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setId(java.lang.CharSequence value) { + validate(fields()[0], value); + this.id = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'id' field has been set */ + public boolean hasId() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearId() { + id = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'unitPrice' field */ + public java.lang.CharSequence getUnitPrice() { + return unitPrice; + } + + /** Sets the value of the 'unitPrice' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setUnitPrice(java.lang.CharSequence value) { + validate(fields()[1], value); + this.unitPrice = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'unitPrice' field has been set */ + public boolean hasUnitPrice() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'unitPrice' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearUnitPrice() { + unitPrice = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'startTime' field */ + public java.lang.CharSequence getStartTime() { + return startTime; + } + + /** Sets the value of the 'startTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setStartTime(java.lang.CharSequence value) { + validate(fields()[2], value); + this.startTime = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'startTime' field has been set */ + public boolean hasStartTime() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'startTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearStartTime() { + startTime = null; + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'endTime' field */ + public java.lang.CharSequence getEndTime() { + return endTime; + } + + /** Sets the value of the 'endTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setEndTime(java.lang.CharSequence value) { + validate(fields()[3], value); + this.endTime = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'endTime' field has been set */ + public boolean hasEndTime() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'endTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearEndTime() { + endTime = null; + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'ellapsedTime' field */ + public java.lang.CharSequence getEllapsedTime() { + return ellapsedTime; + } + + /** Sets the value of the 'ellapsedTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setEllapsedTime(java.lang.CharSequence value) { + validate(fields()[4], value); + this.ellapsedTime = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'ellapsedTime' field has been set */ + public boolean hasEllapsedTime() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'ellapsedTime' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearEllapsedTime() { + ellapsedTime = null; + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'credits' field */ + public java.lang.CharSequence getCredits() { + return credits; + } + + /** Sets the value of the 'credits' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder setCredits(java.lang.CharSequence value) { + validate(fields()[5], value); + this.credits = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'credits' field has been set */ + public boolean hasCredits() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'credits' field */ + public gr.grnet.aquarium.message.avro.gen._ChargeEntry.Builder clearCredits() { + credits = null; + fieldSetFlags()[5] = false; + return this; + } + + @Override + public _ChargeEntry build() { + try { + _ChargeEntry record = new _ChargeEntry(); + record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); + record.unitPrice = fieldSetFlags()[1] ? this.unitPrice : (java.lang.CharSequence) defaultValue(fields()[1]); + record.startTime = fieldSetFlags()[2] ? this.startTime : (java.lang.CharSequence) defaultValue(fields()[2]); + record.endTime = fieldSetFlags()[3] ? this.endTime : (java.lang.CharSequence) defaultValue(fields()[3]); + record.ellapsedTime = fieldSetFlags()[4] ? this.ellapsedTime : (java.lang.CharSequence) defaultValue(fields()[4]); + record.credits = fieldSetFlags()[5] ? this.credits : (java.lang.CharSequence) defaultValue(fields()[5]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_Chargeslot.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_Chargeslot.java new file mode 100644 index 0000000..180d1b3 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_Chargeslot.java @@ -0,0 +1,313 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _Chargeslot extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_Chargeslot\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"startMillis\",\"type\":\"long\"},{\"name\":\"stopMillis\",\"type\":\"long\"},{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"explanation\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"creditsToSubtract\",\"type\":\"double\"}]}"); + @Deprecated public long startMillis; + @Deprecated public long stopMillis; + @Deprecated public double unitPrice; + @Deprecated public java.lang.CharSequence explanation; + @Deprecated public double creditsToSubtract; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return startMillis; + case 1: return stopMillis; + case 2: return unitPrice; + case 3: return explanation; + case 4: return creditsToSubtract; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: startMillis = (java.lang.Long)value$; break; + case 1: stopMillis = (java.lang.Long)value$; break; + case 2: unitPrice = (java.lang.Double)value$; break; + case 3: explanation = (java.lang.CharSequence)value$; break; + case 4: creditsToSubtract = (java.lang.Double)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'startMillis' field. + */ + public java.lang.Long getStartMillis() { + return startMillis; + } + + /** + * Sets the value of the 'startMillis' field. + * @param value the value to set. + */ + public void setStartMillis(java.lang.Long value) { + this.startMillis = value; + } + + /** + * Gets the value of the 'stopMillis' field. + */ + public java.lang.Long getStopMillis() { + return stopMillis; + } + + /** + * Sets the value of the 'stopMillis' field. + * @param value the value to set. + */ + public void setStopMillis(java.lang.Long value) { + this.stopMillis = value; + } + + /** + * Gets the value of the 'unitPrice' field. + */ + public java.lang.Double getUnitPrice() { + return unitPrice; + } + + /** + * Sets the value of the 'unitPrice' field. + * @param value the value to set. + */ + public void setUnitPrice(java.lang.Double value) { + this.unitPrice = value; + } + + /** + * Gets the value of the 'explanation' field. + */ + public java.lang.CharSequence getExplanation() { + return explanation; + } + + /** + * Sets the value of the 'explanation' field. + * @param value the value to set. + */ + public void setExplanation(java.lang.CharSequence value) { + this.explanation = value; + } + + /** + * Gets the value of the 'creditsToSubtract' field. + */ + public java.lang.Double getCreditsToSubtract() { + return creditsToSubtract; + } + + /** + * Sets the value of the 'creditsToSubtract' field. + * @param value the value to set. + */ + public void setCreditsToSubtract(java.lang.Double value) { + this.creditsToSubtract = value; + } + + /** Creates a new _Chargeslot RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder(); + } + + /** Creates a new _Chargeslot RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder(other); + } + + /** Creates a new _Chargeslot RecordBuilder by copying an existing _Chargeslot instance */ + public static gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._Chargeslot other) { + return new gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder(other); + } + + /** + * RecordBuilder for _Chargeslot instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_Chargeslot> + implements org.apache.avro.data.RecordBuilder<_Chargeslot> { + + private long startMillis; + private long stopMillis; + private double unitPrice; + private java.lang.CharSequence explanation; + private double creditsToSubtract; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._Chargeslot.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _Chargeslot instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._Chargeslot other) { + super(gr.grnet.aquarium.message.avro.gen._Chargeslot.SCHEMA$); + if (isValidValue(fields()[0], other.startMillis)) { + this.startMillis = (java.lang.Long) data().deepCopy(fields()[0].schema(), other.startMillis); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.stopMillis)) { + this.stopMillis = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.stopMillis); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.unitPrice)) { + this.unitPrice = (java.lang.Double) data().deepCopy(fields()[2].schema(), other.unitPrice); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.explanation)) { + this.explanation = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.explanation); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.creditsToSubtract)) { + this.creditsToSubtract = (java.lang.Double) data().deepCopy(fields()[4].schema(), other.creditsToSubtract); + fieldSetFlags()[4] = true; + } + } + + /** Gets the value of the 'startMillis' field */ + public java.lang.Long getStartMillis() { + return startMillis; + } + + /** Sets the value of the 'startMillis' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setStartMillis(long value) { + validate(fields()[0], value); + this.startMillis = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'startMillis' field has been set */ + public boolean hasStartMillis() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'startMillis' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStartMillis() { + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'stopMillis' field */ + public java.lang.Long getStopMillis() { + return stopMillis; + } + + /** Sets the value of the 'stopMillis' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setStopMillis(long value) { + validate(fields()[1], value); + this.stopMillis = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'stopMillis' field has been set */ + public boolean hasStopMillis() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'stopMillis' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearStopMillis() { + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'unitPrice' field */ + public java.lang.Double getUnitPrice() { + return unitPrice; + } + + /** Sets the value of the 'unitPrice' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setUnitPrice(double value) { + validate(fields()[2], value); + this.unitPrice = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'unitPrice' field has been set */ + public boolean hasUnitPrice() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'unitPrice' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearUnitPrice() { + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'explanation' field */ + public java.lang.CharSequence getExplanation() { + return explanation; + } + + /** Sets the value of the 'explanation' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setExplanation(java.lang.CharSequence value) { + validate(fields()[3], value); + this.explanation = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'explanation' field has been set */ + public boolean hasExplanation() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'explanation' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearExplanation() { + explanation = null; + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'creditsToSubtract' field */ + public java.lang.Double getCreditsToSubtract() { + return creditsToSubtract; + } + + /** Sets the value of the 'creditsToSubtract' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder setCreditsToSubtract(double value) { + validate(fields()[4], value); + this.creditsToSubtract = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'creditsToSubtract' field has been set */ + public boolean hasCreditsToSubtract() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'creditsToSubtract' field */ + public gr.grnet.aquarium.message.avro.gen._Chargeslot.Builder clearCreditsToSubtract() { + fieldSetFlags()[4] = false; + return this; + } + + @Override + public _Chargeslot build() { + try { + _Chargeslot record = new _Chargeslot(); + record.startMillis = fieldSetFlags()[0] ? this.startMillis : (java.lang.Long) defaultValue(fields()[0]); + record.stopMillis = fieldSetFlags()[1] ? this.stopMillis : (java.lang.Long) defaultValue(fields()[1]); + record.unitPrice = fieldSetFlags()[2] ? this.unitPrice : (java.lang.Double) defaultValue(fields()[2]); + record.explanation = fieldSetFlags()[3] ? this.explanation : (java.lang.CharSequence) defaultValue(fields()[3]); + record.creditsToSubtract = fieldSetFlags()[4] ? this.creditsToSubtract : (java.lang.Double) defaultValue(fields()[4]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_EventEntry.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_EventEntry.java new file mode 100644 index 0000000..8de88fb --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_EventEntry.java @@ -0,0 +1,170 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _EventEntry extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_EventEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]}}}]}"); + @Deprecated public java.lang.CharSequence eventType; + @Deprecated public java.util.List details; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return eventType; + case 1: return details; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: eventType = (java.lang.CharSequence)value$; break; + case 1: details = (java.util.List)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'eventType' field. + */ + public java.lang.CharSequence getEventType() { + return eventType; + } + + /** + * Sets the value of the 'eventType' field. + * @param value the value to set. + */ + public void setEventType(java.lang.CharSequence value) { + this.eventType = value; + } + + /** + * Gets the value of the 'details' field. + */ + public java.util.List getDetails() { + return details; + } + + /** + * Sets the value of the 'details' field. + * @param value the value to set. + */ + public void setDetails(java.util.List value) { + this.details = value; + } + + /** Creates a new _EventEntry RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder(); + } + + /** Creates a new _EventEntry RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._EventEntry.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder(other); + } + + /** Creates a new _EventEntry RecordBuilder by copying an existing _EventEntry instance */ + public static gr.grnet.aquarium.message.avro.gen._EventEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._EventEntry other) { + return new gr.grnet.aquarium.message.avro.gen._EventEntry.Builder(other); + } + + /** + * RecordBuilder for _EventEntry instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_EventEntry> + implements org.apache.avro.data.RecordBuilder<_EventEntry> { + + private java.lang.CharSequence eventType; + private java.util.List details; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._EventEntry.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._EventEntry.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _EventEntry instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._EventEntry other) { + super(gr.grnet.aquarium.message.avro.gen._EventEntry.SCHEMA$); + if (isValidValue(fields()[0], other.eventType)) { + this.eventType = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.eventType); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.details)) { + this.details = (java.util.List) data().deepCopy(fields()[1].schema(), other.details); + fieldSetFlags()[1] = true; + } + } + + /** Gets the value of the 'eventType' field */ + public java.lang.CharSequence getEventType() { + return eventType; + } + + /** Sets the value of the 'eventType' field */ + public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder setEventType(java.lang.CharSequence value) { + validate(fields()[0], value); + this.eventType = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'eventType' field has been set */ + public boolean hasEventType() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'eventType' field */ + public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder clearEventType() { + eventType = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'details' field */ + public java.util.List getDetails() { + return details; + } + + /** Sets the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder setDetails(java.util.List value) { + validate(fields()[1], value); + this.details = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'details' field has been set */ + public boolean hasDetails() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._EventEntry.Builder clearDetails() { + details = null; + fieldSetFlags()[1] = false; + return this; + } + + @Override + public _EventEntry build() { + try { + _EventEntry record = new _EventEntry(); + record.eventType = fieldSetFlags()[0] ? this.eventType : (java.lang.CharSequence) defaultValue(fields()[0]); + record.details = fieldSetFlags()[1] ? this.details : (java.util.List) defaultValue(fields()[1]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_ResourceEntry.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_ResourceEntry.java new file mode 100644 index 0000000..1e8fff8 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_ResourceEntry.java @@ -0,0 +1,317 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _ResourceEntry extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_ResourceEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"resourceName\",\"type\":\"string\"},{\"name\":\"resourceType\",\"type\":\"string\"},{\"name\":\"unitName\",\"type\":\"string\"},{\"name\":\"totalCredits\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_EventEntry\",\"fields\":[{\"name\":\"eventType\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ChargeEntry\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"unitPrice\",\"type\":\"string\"},{\"name\":\"startTime\",\"type\":\"string\"},{\"name\":\"endTime\",\"type\":\"string\"},{\"name\":\"ellapsedTime\",\"type\":\"string\"},{\"name\":\"credits\",\"type\":\"string\"}]}}}]}}}]}"); + @Deprecated public java.lang.CharSequence resourceName; + @Deprecated public java.lang.CharSequence resourceType; + @Deprecated public java.lang.CharSequence unitName; + @Deprecated public java.lang.CharSequence totalCredits; + @Deprecated public java.util.List details; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return resourceName; + case 1: return resourceType; + case 2: return unitName; + case 3: return totalCredits; + case 4: return details; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: resourceName = (java.lang.CharSequence)value$; break; + case 1: resourceType = (java.lang.CharSequence)value$; break; + case 2: unitName = (java.lang.CharSequence)value$; break; + case 3: totalCredits = (java.lang.CharSequence)value$; break; + case 4: details = (java.util.List)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'resourceName' field. + */ + public java.lang.CharSequence getResourceName() { + return resourceName; + } + + /** + * Sets the value of the 'resourceName' field. + * @param value the value to set. + */ + public void setResourceName(java.lang.CharSequence value) { + this.resourceName = value; + } + + /** + * Gets the value of the 'resourceType' field. + */ + public java.lang.CharSequence getResourceType() { + return resourceType; + } + + /** + * Sets the value of the 'resourceType' field. + * @param value the value to set. + */ + public void setResourceType(java.lang.CharSequence value) { + this.resourceType = value; + } + + /** + * Gets the value of the 'unitName' field. + */ + public java.lang.CharSequence getUnitName() { + return unitName; + } + + /** + * Sets the value of the 'unitName' field. + * @param value the value to set. + */ + public void setUnitName(java.lang.CharSequence value) { + this.unitName = value; + } + + /** + * Gets the value of the 'totalCredits' field. + */ + public java.lang.CharSequence getTotalCredits() { + return totalCredits; + } + + /** + * Sets the value of the 'totalCredits' field. + * @param value the value to set. + */ + public void setTotalCredits(java.lang.CharSequence value) { + this.totalCredits = value; + } + + /** + * Gets the value of the 'details' field. + */ + public java.util.List getDetails() { + return details; + } + + /** + * Sets the value of the 'details' field. + * @param value the value to set. + */ + public void setDetails(java.util.List value) { + this.details = value; + } + + /** Creates a new _ResourceEntry RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder(); + } + + /** Creates a new _ResourceEntry RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder(other); + } + + /** Creates a new _ResourceEntry RecordBuilder by copying an existing _ResourceEntry instance */ + public static gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._ResourceEntry other) { + return new gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder(other); + } + + /** + * RecordBuilder for _ResourceEntry instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_ResourceEntry> + implements org.apache.avro.data.RecordBuilder<_ResourceEntry> { + + private java.lang.CharSequence resourceName; + private java.lang.CharSequence resourceType; + private java.lang.CharSequence unitName; + private java.lang.CharSequence totalCredits; + private java.util.List details; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._ResourceEntry.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _ResourceEntry instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._ResourceEntry other) { + super(gr.grnet.aquarium.message.avro.gen._ResourceEntry.SCHEMA$); + if (isValidValue(fields()[0], other.resourceName)) { + this.resourceName = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.resourceName); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.resourceType)) { + this.resourceType = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.resourceType); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.unitName)) { + this.unitName = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.unitName); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.totalCredits)) { + this.totalCredits = (java.lang.CharSequence) data().deepCopy(fields()[3].schema(), other.totalCredits); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.details)) { + this.details = (java.util.List) data().deepCopy(fields()[4].schema(), other.details); + fieldSetFlags()[4] = true; + } + } + + /** Gets the value of the 'resourceName' field */ + public java.lang.CharSequence getResourceName() { + return resourceName; + } + + /** Sets the value of the 'resourceName' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder setResourceName(java.lang.CharSequence value) { + validate(fields()[0], value); + this.resourceName = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'resourceName' field has been set */ + public boolean hasResourceName() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'resourceName' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder clearResourceName() { + resourceName = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'resourceType' field */ + public java.lang.CharSequence getResourceType() { + return resourceType; + } + + /** Sets the value of the 'resourceType' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder setResourceType(java.lang.CharSequence value) { + validate(fields()[1], value); + this.resourceType = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'resourceType' field has been set */ + public boolean hasResourceType() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'resourceType' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder clearResourceType() { + resourceType = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'unitName' field */ + public java.lang.CharSequence getUnitName() { + return unitName; + } + + /** Sets the value of the 'unitName' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder setUnitName(java.lang.CharSequence value) { + validate(fields()[2], value); + this.unitName = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'unitName' field has been set */ + public boolean hasUnitName() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'unitName' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder clearUnitName() { + unitName = null; + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'totalCredits' field */ + public java.lang.CharSequence getTotalCredits() { + return totalCredits; + } + + /** Sets the value of the 'totalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder setTotalCredits(java.lang.CharSequence value) { + validate(fields()[3], value); + this.totalCredits = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'totalCredits' field has been set */ + public boolean hasTotalCredits() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'totalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder clearTotalCredits() { + totalCredits = null; + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'details' field */ + public java.util.List getDetails() { + return details; + } + + /** Sets the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder setDetails(java.util.List value) { + validate(fields()[4], value); + this.details = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'details' field has been set */ + public boolean hasDetails() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceEntry.Builder clearDetails() { + details = null; + fieldSetFlags()[4] = false; + return this; + } + + @Override + public _ResourceEntry build() { + try { + _ResourceEntry record = new _ResourceEntry(); + record.resourceName = fieldSetFlags()[0] ? this.resourceName : (java.lang.CharSequence) defaultValue(fields()[0]); + record.resourceType = fieldSetFlags()[1] ? this.resourceType : (java.lang.CharSequence) defaultValue(fields()[1]); + record.unitName = fieldSetFlags()[2] ? this.unitName : (java.lang.CharSequence) defaultValue(fields()[2]); + record.totalCredits = fieldSetFlags()[3] ? this.totalCredits : (java.lang.CharSequence) defaultValue(fields()[3]); + record.details = fieldSetFlags()[4] ? this.details : (java.util.List) defaultValue(fields()[4]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_UserAgreement.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_UserAgreement.java new file mode 100644 index 0000000..3daee5e --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_UserAgreement.java @@ -0,0 +1,364 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _UserAgreement extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_UserAgreement\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"relatedIMEventID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"fullPriceTableRef\",\"type\":[{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]}}}}]},\"null\"]}]}"); + @Deprecated public java.lang.CharSequence id; + @Deprecated public java.lang.CharSequence relatedIMEventID; + @Deprecated public long validFromMillis; + @Deprecated public long validToMillis; + @Deprecated public java.lang.CharSequence role; + @Deprecated public gr.grnet.aquarium.message.avro.gen._FullPriceTable fullPriceTableRef; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return id; + case 1: return relatedIMEventID; + case 2: return validFromMillis; + case 3: return validToMillis; + case 4: return role; + case 5: return fullPriceTableRef; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: id = (java.lang.CharSequence)value$; break; + case 1: relatedIMEventID = (java.lang.CharSequence)value$; break; + case 2: validFromMillis = (java.lang.Long)value$; break; + case 3: validToMillis = (java.lang.Long)value$; break; + case 4: role = (java.lang.CharSequence)value$; break; + case 5: fullPriceTableRef = (gr.grnet.aquarium.message.avro.gen._FullPriceTable)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'id' field. + */ + public java.lang.CharSequence getId() { + return id; + } + + /** + * Sets the value of the 'id' field. + * @param value the value to set. + */ + public void setId(java.lang.CharSequence value) { + this.id = value; + } + + /** + * Gets the value of the 'relatedIMEventID' field. + */ + public java.lang.CharSequence getRelatedIMEventID() { + return relatedIMEventID; + } + + /** + * Sets the value of the 'relatedIMEventID' field. + * @param value the value to set. + */ + public void setRelatedIMEventID(java.lang.CharSequence value) { + this.relatedIMEventID = value; + } + + /** + * Gets the value of the 'validFromMillis' field. + */ + public java.lang.Long getValidFromMillis() { + return validFromMillis; + } + + /** + * Sets the value of the 'validFromMillis' field. + * @param value the value to set. + */ + public void setValidFromMillis(java.lang.Long value) { + this.validFromMillis = value; + } + + /** + * Gets the value of the 'validToMillis' field. + */ + public java.lang.Long getValidToMillis() { + return validToMillis; + } + + /** + * Sets the value of the 'validToMillis' field. + * @param value the value to set. + */ + public void setValidToMillis(java.lang.Long value) { + this.validToMillis = value; + } + + /** + * Gets the value of the 'role' field. + */ + public java.lang.CharSequence getRole() { + return role; + } + + /** + * Sets the value of the 'role' field. + * @param value the value to set. + */ + public void setRole(java.lang.CharSequence value) { + this.role = value; + } + + /** + * Gets the value of the 'fullPriceTableRef' field. + */ + public gr.grnet.aquarium.message.avro.gen._FullPriceTable getFullPriceTableRef() { + return fullPriceTableRef; + } + + /** + * Sets the value of the 'fullPriceTableRef' field. + * @param value the value to set. + */ + public void setFullPriceTableRef(gr.grnet.aquarium.message.avro.gen._FullPriceTable value) { + this.fullPriceTableRef = value; + } + + /** Creates a new _UserAgreement RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder(); + } + + /** Creates a new _UserAgreement RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder(other); + } + + /** Creates a new _UserAgreement RecordBuilder by copying an existing _UserAgreement instance */ + public static gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._UserAgreement other) { + return new gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder(other); + } + + /** + * RecordBuilder for _UserAgreement instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_UserAgreement> + implements org.apache.avro.data.RecordBuilder<_UserAgreement> { + + private java.lang.CharSequence id; + private java.lang.CharSequence relatedIMEventID; + private long validFromMillis; + private long validToMillis; + private java.lang.CharSequence role; + private gr.grnet.aquarium.message.avro.gen._FullPriceTable fullPriceTableRef; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._UserAgreement.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _UserAgreement instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._UserAgreement other) { + super(gr.grnet.aquarium.message.avro.gen._UserAgreement.SCHEMA$); + if (isValidValue(fields()[0], other.id)) { + this.id = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.id); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.relatedIMEventID)) { + this.relatedIMEventID = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.relatedIMEventID); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.validFromMillis)) { + this.validFromMillis = (java.lang.Long) data().deepCopy(fields()[2].schema(), other.validFromMillis); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.validToMillis)) { + this.validToMillis = (java.lang.Long) data().deepCopy(fields()[3].schema(), other.validToMillis); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.role)) { + this.role = (java.lang.CharSequence) data().deepCopy(fields()[4].schema(), other.role); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.fullPriceTableRef)) { + this.fullPriceTableRef = (gr.grnet.aquarium.message.avro.gen._FullPriceTable) data().deepCopy(fields()[5].schema(), other.fullPriceTableRef); + fieldSetFlags()[5] = true; + } + } + + /** Gets the value of the 'id' field */ + public java.lang.CharSequence getId() { + return id; + } + + /** Sets the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setId(java.lang.CharSequence value) { + validate(fields()[0], value); + this.id = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'id' field has been set */ + public boolean hasId() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'id' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearId() { + id = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'relatedIMEventID' field */ + public java.lang.CharSequence getRelatedIMEventID() { + return relatedIMEventID; + } + + /** Sets the value of the 'relatedIMEventID' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setRelatedIMEventID(java.lang.CharSequence value) { + validate(fields()[1], value); + this.relatedIMEventID = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'relatedIMEventID' field has been set */ + public boolean hasRelatedIMEventID() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'relatedIMEventID' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearRelatedIMEventID() { + relatedIMEventID = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'validFromMillis' field */ + public java.lang.Long getValidFromMillis() { + return validFromMillis; + } + + /** Sets the value of the 'validFromMillis' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setValidFromMillis(long value) { + validate(fields()[2], value); + this.validFromMillis = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'validFromMillis' field has been set */ + public boolean hasValidFromMillis() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'validFromMillis' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearValidFromMillis() { + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'validToMillis' field */ + public java.lang.Long getValidToMillis() { + return validToMillis; + } + + /** Sets the value of the 'validToMillis' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setValidToMillis(long value) { + validate(fields()[3], value); + this.validToMillis = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'validToMillis' field has been set */ + public boolean hasValidToMillis() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'validToMillis' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearValidToMillis() { + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'role' field */ + public java.lang.CharSequence getRole() { + return role; + } + + /** Sets the value of the 'role' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setRole(java.lang.CharSequence value) { + validate(fields()[4], value); + this.role = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'role' field has been set */ + public boolean hasRole() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'role' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearRole() { + role = null; + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'fullPriceTableRef' field */ + public gr.grnet.aquarium.message.avro.gen._FullPriceTable getFullPriceTableRef() { + return fullPriceTableRef; + } + + /** Sets the value of the 'fullPriceTableRef' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder setFullPriceTableRef(gr.grnet.aquarium.message.avro.gen._FullPriceTable value) { + validate(fields()[5], value); + this.fullPriceTableRef = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'fullPriceTableRef' field has been set */ + public boolean hasFullPriceTableRef() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'fullPriceTableRef' field */ + public gr.grnet.aquarium.message.avro.gen._UserAgreement.Builder clearFullPriceTableRef() { + fullPriceTableRef = null; + fieldSetFlags()[5] = false; + return this; + } + + @Override + public _UserAgreement build() { + try { + _UserAgreement record = new _UserAgreement(); + record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); + record.relatedIMEventID = fieldSetFlags()[1] ? this.relatedIMEventID : (java.lang.CharSequence) defaultValue(fields()[1]); + record.validFromMillis = fieldSetFlags()[2] ? this.validFromMillis : (java.lang.Long) defaultValue(fields()[2]); + record.validToMillis = fieldSetFlags()[3] ? this.validToMillis : (java.lang.Long) defaultValue(fields()[3]); + record.role = fieldSetFlags()[4] ? this.role : (java.lang.CharSequence) defaultValue(fields()[4]); + record.fullPriceTableRef = fieldSetFlags()[5] ? this.fullPriceTableRef : (gr.grnet.aquarium.message.avro.gen._FullPriceTable) defaultValue(fields()[5]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_WalletEntry.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WalletEntry.java new file mode 100644 index 0000000..b59851b --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WalletEntry.java @@ -0,0 +1,748 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _WalletEntry extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_WalletEntry\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"sumOfCreditsToSubtract\",\"type\":\"double\"},{\"name\":\"oldTotalCredits\",\"type\":\"double\"},{\"name\":\"newTotalCredits\",\"type\":\"double\"},{\"name\":\"whenComputedMillis\",\"type\":\"long\"},{\"name\":\"referenceStartMillis\",\"type\":\"long\"},{\"name\":\"referenceStopMillis\",\"type\":\"long\"},{\"name\":\"billingYear\",\"type\":\"int\"},{\"name\":\"billingMonth\",\"type\":\"int\"},{\"name\":\"billingDay\",\"type\":\"int\"},{\"name\":\"chargeslots\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_Chargeslot\",\"fields\":[{\"name\":\"startMillis\",\"type\":\"long\"},{\"name\":\"stopMillis\",\"type\":\"long\"},{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"explanation\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"creditsToSubtract\",\"type\":\"double\"}]}}},{\"name\":\"resourceEvents\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ResourceEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"resource\",\"type\":\"string\",\"aliases\":[\"resourceType\"]},{\"name\":\"instanceID\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}}}]}}},{\"name\":\"resourceType\",\"type\":{\"type\":\"record\",\"name\":\"_ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}},{\"name\":\"isSynthetic\",\"type\":\"boolean\",\"default\":false}]}"); + @Deprecated public java.lang.CharSequence userID; + @Deprecated public double sumOfCreditsToSubtract; + @Deprecated public double oldTotalCredits; + @Deprecated public double newTotalCredits; + @Deprecated public long whenComputedMillis; + @Deprecated public long referenceStartMillis; + @Deprecated public long referenceStopMillis; + @Deprecated public int billingYear; + @Deprecated public int billingMonth; + @Deprecated public int billingDay; + @Deprecated public java.util.List chargeslots; + @Deprecated public java.util.List resourceEvents; + @Deprecated public gr.grnet.aquarium.message.avro.gen._ResourceType resourceType; + @Deprecated public boolean isSynthetic; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return userID; + case 1: return sumOfCreditsToSubtract; + case 2: return oldTotalCredits; + case 3: return newTotalCredits; + case 4: return whenComputedMillis; + case 5: return referenceStartMillis; + case 6: return referenceStopMillis; + case 7: return billingYear; + case 8: return billingMonth; + case 9: return billingDay; + case 10: return chargeslots; + case 11: return resourceEvents; + case 12: return resourceType; + case 13: return isSynthetic; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: userID = (java.lang.CharSequence)value$; break; + case 1: sumOfCreditsToSubtract = (java.lang.Double)value$; break; + case 2: oldTotalCredits = (java.lang.Double)value$; break; + case 3: newTotalCredits = (java.lang.Double)value$; break; + case 4: whenComputedMillis = (java.lang.Long)value$; break; + case 5: referenceStartMillis = (java.lang.Long)value$; break; + case 6: referenceStopMillis = (java.lang.Long)value$; break; + case 7: billingYear = (java.lang.Integer)value$; break; + case 8: billingMonth = (java.lang.Integer)value$; break; + case 9: billingDay = (java.lang.Integer)value$; break; + case 10: chargeslots = (java.util.List)value$; break; + case 11: resourceEvents = (java.util.List)value$; break; + case 12: resourceType = (gr.grnet.aquarium.message.avro.gen._ResourceType)value$; break; + case 13: isSynthetic = (java.lang.Boolean)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'userID' field. + */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** + * Sets the value of the 'userID' field. + * @param value the value to set. + */ + public void setUserID(java.lang.CharSequence value) { + this.userID = value; + } + + /** + * Gets the value of the 'sumOfCreditsToSubtract' field. + */ + public java.lang.Double getSumOfCreditsToSubtract() { + return sumOfCreditsToSubtract; + } + + /** + * Sets the value of the 'sumOfCreditsToSubtract' field. + * @param value the value to set. + */ + public void setSumOfCreditsToSubtract(java.lang.Double value) { + this.sumOfCreditsToSubtract = value; + } + + /** + * Gets the value of the 'oldTotalCredits' field. + */ + public java.lang.Double getOldTotalCredits() { + return oldTotalCredits; + } + + /** + * Sets the value of the 'oldTotalCredits' field. + * @param value the value to set. + */ + public void setOldTotalCredits(java.lang.Double value) { + this.oldTotalCredits = value; + } + + /** + * Gets the value of the 'newTotalCredits' field. + */ + public java.lang.Double getNewTotalCredits() { + return newTotalCredits; + } + + /** + * Sets the value of the 'newTotalCredits' field. + * @param value the value to set. + */ + public void setNewTotalCredits(java.lang.Double value) { + this.newTotalCredits = value; + } + + /** + * Gets the value of the 'whenComputedMillis' field. + */ + public java.lang.Long getWhenComputedMillis() { + return whenComputedMillis; + } + + /** + * Sets the value of the 'whenComputedMillis' field. + * @param value the value to set. + */ + public void setWhenComputedMillis(java.lang.Long value) { + this.whenComputedMillis = value; + } + + /** + * Gets the value of the 'referenceStartMillis' field. + */ + public java.lang.Long getReferenceStartMillis() { + return referenceStartMillis; + } + + /** + * Sets the value of the 'referenceStartMillis' field. + * @param value the value to set. + */ + public void setReferenceStartMillis(java.lang.Long value) { + this.referenceStartMillis = value; + } + + /** + * Gets the value of the 'referenceStopMillis' field. + */ + public java.lang.Long getReferenceStopMillis() { + return referenceStopMillis; + } + + /** + * Sets the value of the 'referenceStopMillis' field. + * @param value the value to set. + */ + public void setReferenceStopMillis(java.lang.Long value) { + this.referenceStopMillis = value; + } + + /** + * Gets the value of the 'billingYear' field. + */ + public java.lang.Integer getBillingYear() { + return billingYear; + } + + /** + * Sets the value of the 'billingYear' field. + * @param value the value to set. + */ + public void setBillingYear(java.lang.Integer value) { + this.billingYear = value; + } + + /** + * Gets the value of the 'billingMonth' field. + */ + public java.lang.Integer getBillingMonth() { + return billingMonth; + } + + /** + * Sets the value of the 'billingMonth' field. + * @param value the value to set. + */ + public void setBillingMonth(java.lang.Integer value) { + this.billingMonth = value; + } + + /** + * Gets the value of the 'billingDay' field. + */ + public java.lang.Integer getBillingDay() { + return billingDay; + } + + /** + * Sets the value of the 'billingDay' field. + * @param value the value to set. + */ + public void setBillingDay(java.lang.Integer value) { + this.billingDay = value; + } + + /** + * Gets the value of the 'chargeslots' field. + */ + public java.util.List getChargeslots() { + return chargeslots; + } + + /** + * Sets the value of the 'chargeslots' field. + * @param value the value to set. + */ + public void setChargeslots(java.util.List value) { + this.chargeslots = value; + } + + /** + * Gets the value of the 'resourceEvents' field. + */ + public java.util.List getResourceEvents() { + return resourceEvents; + } + + /** + * Sets the value of the 'resourceEvents' field. + * @param value the value to set. + */ + public void setResourceEvents(java.util.List value) { + this.resourceEvents = value; + } + + /** + * Gets the value of the 'resourceType' field. + */ + public gr.grnet.aquarium.message.avro.gen._ResourceType getResourceType() { + return resourceType; + } + + /** + * Sets the value of the 'resourceType' field. + * @param value the value to set. + */ + public void setResourceType(gr.grnet.aquarium.message.avro.gen._ResourceType value) { + this.resourceType = value; + } + + /** + * Gets the value of the 'isSynthetic' field. + */ + public java.lang.Boolean getIsSynthetic() { + return isSynthetic; + } + + /** + * Sets the value of the 'isSynthetic' field. + * @param value the value to set. + */ + public void setIsSynthetic(java.lang.Boolean value) { + this.isSynthetic = value; + } + + /** Creates a new _WalletEntry RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder(); + } + + /** Creates a new _WalletEntry RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder(other); + } + + /** Creates a new _WalletEntry RecordBuilder by copying an existing _WalletEntry instance */ + public static gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WalletEntry other) { + return new gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder(other); + } + + /** + * RecordBuilder for _WalletEntry instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_WalletEntry> + implements org.apache.avro.data.RecordBuilder<_WalletEntry> { + + private java.lang.CharSequence userID; + private double sumOfCreditsToSubtract; + private double oldTotalCredits; + private double newTotalCredits; + private long whenComputedMillis; + private long referenceStartMillis; + private long referenceStopMillis; + private int billingYear; + private int billingMonth; + private int billingDay; + private java.util.List chargeslots; + private java.util.List resourceEvents; + private gr.grnet.aquarium.message.avro.gen._ResourceType resourceType; + private boolean isSynthetic; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._WalletEntry.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _WalletEntry instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._WalletEntry other) { + super(gr.grnet.aquarium.message.avro.gen._WalletEntry.SCHEMA$); + if (isValidValue(fields()[0], other.userID)) { + this.userID = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.userID); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.sumOfCreditsToSubtract)) { + this.sumOfCreditsToSubtract = (java.lang.Double) data().deepCopy(fields()[1].schema(), other.sumOfCreditsToSubtract); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.oldTotalCredits)) { + this.oldTotalCredits = (java.lang.Double) data().deepCopy(fields()[2].schema(), other.oldTotalCredits); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.newTotalCredits)) { + this.newTotalCredits = (java.lang.Double) data().deepCopy(fields()[3].schema(), other.newTotalCredits); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.whenComputedMillis)) { + this.whenComputedMillis = (java.lang.Long) data().deepCopy(fields()[4].schema(), other.whenComputedMillis); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.referenceStartMillis)) { + this.referenceStartMillis = (java.lang.Long) data().deepCopy(fields()[5].schema(), other.referenceStartMillis); + fieldSetFlags()[5] = true; + } + if (isValidValue(fields()[6], other.referenceStopMillis)) { + this.referenceStopMillis = (java.lang.Long) data().deepCopy(fields()[6].schema(), other.referenceStopMillis); + fieldSetFlags()[6] = true; + } + if (isValidValue(fields()[7], other.billingYear)) { + this.billingYear = (java.lang.Integer) data().deepCopy(fields()[7].schema(), other.billingYear); + fieldSetFlags()[7] = true; + } + if (isValidValue(fields()[8], other.billingMonth)) { + this.billingMonth = (java.lang.Integer) data().deepCopy(fields()[8].schema(), other.billingMonth); + fieldSetFlags()[8] = true; + } + if (isValidValue(fields()[9], other.billingDay)) { + this.billingDay = (java.lang.Integer) data().deepCopy(fields()[9].schema(), other.billingDay); + fieldSetFlags()[9] = true; + } + if (isValidValue(fields()[10], other.chargeslots)) { + this.chargeslots = (java.util.List) data().deepCopy(fields()[10].schema(), other.chargeslots); + fieldSetFlags()[10] = true; + } + if (isValidValue(fields()[11], other.resourceEvents)) { + this.resourceEvents = (java.util.List) data().deepCopy(fields()[11].schema(), other.resourceEvents); + fieldSetFlags()[11] = true; + } + if (isValidValue(fields()[12], other.resourceType)) { + this.resourceType = (gr.grnet.aquarium.message.avro.gen._ResourceType) data().deepCopy(fields()[12].schema(), other.resourceType); + fieldSetFlags()[12] = true; + } + if (isValidValue(fields()[13], other.isSynthetic)) { + this.isSynthetic = (java.lang.Boolean) data().deepCopy(fields()[13].schema(), other.isSynthetic); + fieldSetFlags()[13] = true; + } + } + + /** Gets the value of the 'userID' field */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** Sets the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setUserID(java.lang.CharSequence value) { + validate(fields()[0], value); + this.userID = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'userID' field has been set */ + public boolean hasUserID() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearUserID() { + userID = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'sumOfCreditsToSubtract' field */ + public java.lang.Double getSumOfCreditsToSubtract() { + return sumOfCreditsToSubtract; + } + + /** Sets the value of the 'sumOfCreditsToSubtract' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setSumOfCreditsToSubtract(double value) { + validate(fields()[1], value); + this.sumOfCreditsToSubtract = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'sumOfCreditsToSubtract' field has been set */ + public boolean hasSumOfCreditsToSubtract() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'sumOfCreditsToSubtract' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearSumOfCreditsToSubtract() { + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'oldTotalCredits' field */ + public java.lang.Double getOldTotalCredits() { + return oldTotalCredits; + } + + /** Sets the value of the 'oldTotalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setOldTotalCredits(double value) { + validate(fields()[2], value); + this.oldTotalCredits = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'oldTotalCredits' field has been set */ + public boolean hasOldTotalCredits() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'oldTotalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearOldTotalCredits() { + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'newTotalCredits' field */ + public java.lang.Double getNewTotalCredits() { + return newTotalCredits; + } + + /** Sets the value of the 'newTotalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setNewTotalCredits(double value) { + validate(fields()[3], value); + this.newTotalCredits = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'newTotalCredits' field has been set */ + public boolean hasNewTotalCredits() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'newTotalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearNewTotalCredits() { + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'whenComputedMillis' field */ + public java.lang.Long getWhenComputedMillis() { + return whenComputedMillis; + } + + /** Sets the value of the 'whenComputedMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setWhenComputedMillis(long value) { + validate(fields()[4], value); + this.whenComputedMillis = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'whenComputedMillis' field has been set */ + public boolean hasWhenComputedMillis() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'whenComputedMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearWhenComputedMillis() { + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'referenceStartMillis' field */ + public java.lang.Long getReferenceStartMillis() { + return referenceStartMillis; + } + + /** Sets the value of the 'referenceStartMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setReferenceStartMillis(long value) { + validate(fields()[5], value); + this.referenceStartMillis = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'referenceStartMillis' field has been set */ + public boolean hasReferenceStartMillis() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'referenceStartMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearReferenceStartMillis() { + fieldSetFlags()[5] = false; + return this; + } + + /** Gets the value of the 'referenceStopMillis' field */ + public java.lang.Long getReferenceStopMillis() { + return referenceStopMillis; + } + + /** Sets the value of the 'referenceStopMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setReferenceStopMillis(long value) { + validate(fields()[6], value); + this.referenceStopMillis = value; + fieldSetFlags()[6] = true; + return this; + } + + /** Checks whether the 'referenceStopMillis' field has been set */ + public boolean hasReferenceStopMillis() { + return fieldSetFlags()[6]; + } + + /** Clears the value of the 'referenceStopMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearReferenceStopMillis() { + fieldSetFlags()[6] = false; + return this; + } + + /** Gets the value of the 'billingYear' field */ + public java.lang.Integer getBillingYear() { + return billingYear; + } + + /** Sets the value of the 'billingYear' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setBillingYear(int value) { + validate(fields()[7], value); + this.billingYear = value; + fieldSetFlags()[7] = true; + return this; + } + + /** Checks whether the 'billingYear' field has been set */ + public boolean hasBillingYear() { + return fieldSetFlags()[7]; + } + + /** Clears the value of the 'billingYear' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearBillingYear() { + fieldSetFlags()[7] = false; + return this; + } + + /** Gets the value of the 'billingMonth' field */ + public java.lang.Integer getBillingMonth() { + return billingMonth; + } + + /** Sets the value of the 'billingMonth' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setBillingMonth(int value) { + validate(fields()[8], value); + this.billingMonth = value; + fieldSetFlags()[8] = true; + return this; + } + + /** Checks whether the 'billingMonth' field has been set */ + public boolean hasBillingMonth() { + return fieldSetFlags()[8]; + } + + /** Clears the value of the 'billingMonth' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearBillingMonth() { + fieldSetFlags()[8] = false; + return this; + } + + /** Gets the value of the 'billingDay' field */ + public java.lang.Integer getBillingDay() { + return billingDay; + } + + /** Sets the value of the 'billingDay' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setBillingDay(int value) { + validate(fields()[9], value); + this.billingDay = value; + fieldSetFlags()[9] = true; + return this; + } + + /** Checks whether the 'billingDay' field has been set */ + public boolean hasBillingDay() { + return fieldSetFlags()[9]; + } + + /** Clears the value of the 'billingDay' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearBillingDay() { + fieldSetFlags()[9] = false; + return this; + } + + /** Gets the value of the 'chargeslots' field */ + public java.util.List getChargeslots() { + return chargeslots; + } + + /** Sets the value of the 'chargeslots' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setChargeslots(java.util.List value) { + validate(fields()[10], value); + this.chargeslots = value; + fieldSetFlags()[10] = true; + return this; + } + + /** Checks whether the 'chargeslots' field has been set */ + public boolean hasChargeslots() { + return fieldSetFlags()[10]; + } + + /** Clears the value of the 'chargeslots' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearChargeslots() { + chargeslots = null; + fieldSetFlags()[10] = false; + return this; + } + + /** Gets the value of the 'resourceEvents' field */ + public java.util.List getResourceEvents() { + return resourceEvents; + } + + /** Sets the value of the 'resourceEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setResourceEvents(java.util.List value) { + validate(fields()[11], value); + this.resourceEvents = value; + fieldSetFlags()[11] = true; + return this; + } + + /** Checks whether the 'resourceEvents' field has been set */ + public boolean hasResourceEvents() { + return fieldSetFlags()[11]; + } + + /** Clears the value of the 'resourceEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearResourceEvents() { + resourceEvents = null; + fieldSetFlags()[11] = false; + return this; + } + + /** Gets the value of the 'resourceType' field */ + public gr.grnet.aquarium.message.avro.gen._ResourceType getResourceType() { + return resourceType; + } + + /** Sets the value of the 'resourceType' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setResourceType(gr.grnet.aquarium.message.avro.gen._ResourceType value) { + validate(fields()[12], value); + this.resourceType = value; + fieldSetFlags()[12] = true; + return this; + } + + /** Checks whether the 'resourceType' field has been set */ + public boolean hasResourceType() { + return fieldSetFlags()[12]; + } + + /** Clears the value of the 'resourceType' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearResourceType() { + resourceType = null; + fieldSetFlags()[12] = false; + return this; + } + + /** Gets the value of the 'isSynthetic' field */ + public java.lang.Boolean getIsSynthetic() { + return isSynthetic; + } + + /** Sets the value of the 'isSynthetic' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder setIsSynthetic(boolean value) { + validate(fields()[13], value); + this.isSynthetic = value; + fieldSetFlags()[13] = true; + return this; + } + + /** Checks whether the 'isSynthetic' field has been set */ + public boolean hasIsSynthetic() { + return fieldSetFlags()[13]; + } + + /** Clears the value of the 'isSynthetic' field */ + public gr.grnet.aquarium.message.avro.gen._WalletEntry.Builder clearIsSynthetic() { + fieldSetFlags()[13] = false; + return this; + } + + @Override + public _WalletEntry build() { + try { + _WalletEntry record = new _WalletEntry(); + record.userID = fieldSetFlags()[0] ? this.userID : (java.lang.CharSequence) defaultValue(fields()[0]); + record.sumOfCreditsToSubtract = fieldSetFlags()[1] ? this.sumOfCreditsToSubtract : (java.lang.Double) defaultValue(fields()[1]); + record.oldTotalCredits = fieldSetFlags()[2] ? this.oldTotalCredits : (java.lang.Double) defaultValue(fields()[2]); + record.newTotalCredits = fieldSetFlags()[3] ? this.newTotalCredits : (java.lang.Double) defaultValue(fields()[3]); + record.whenComputedMillis = fieldSetFlags()[4] ? this.whenComputedMillis : (java.lang.Long) defaultValue(fields()[4]); + record.referenceStartMillis = fieldSetFlags()[5] ? this.referenceStartMillis : (java.lang.Long) defaultValue(fields()[5]); + record.referenceStopMillis = fieldSetFlags()[6] ? this.referenceStopMillis : (java.lang.Long) defaultValue(fields()[6]); + record.billingYear = fieldSetFlags()[7] ? this.billingYear : (java.lang.Integer) defaultValue(fields()[7]); + record.billingMonth = fieldSetFlags()[8] ? this.billingMonth : (java.lang.Integer) defaultValue(fields()[8]); + record.billingDay = fieldSetFlags()[9] ? this.billingDay : (java.lang.Integer) defaultValue(fields()[9]); + record.chargeslots = fieldSetFlags()[10] ? this.chargeslots : (java.util.List) defaultValue(fields()[10]); + record.resourceEvents = fieldSetFlags()[11] ? this.resourceEvents : (java.util.List) defaultValue(fields()[11]); + record.resourceType = fieldSetFlags()[12] ? this.resourceType : (gr.grnet.aquarium.message.avro.gen._ResourceType) defaultValue(fields()[12]); + record.isSynthetic = fieldSetFlags()[13] ? this.isSynthetic : (java.lang.Boolean) defaultValue(fields()[13]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingAgreementHistory.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingAgreementHistory.java new file mode 100644 index 0000000..a6d34d7 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingAgreementHistory.java @@ -0,0 +1,121 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _WorkingAgreementHistory extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_WorkingAgreementHistory\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"agreements\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_UserAgreement\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"relatedIMEventID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"fullPriceTableRef\",\"type\":[{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]}}}}]},\"null\"]}]}}}]}"); + @Deprecated public java.util.List agreements; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return agreements; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: agreements = (java.util.List)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'agreements' field. + */ + public java.util.List getAgreements() { + return agreements; + } + + /** + * Sets the value of the 'agreements' field. + * @param value the value to set. + */ + public void setAgreements(java.util.List value) { + this.agreements = value; + } + + /** Creates a new _WorkingAgreementHistory RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder(); + } + + /** Creates a new _WorkingAgreementHistory RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder(other); + } + + /** Creates a new _WorkingAgreementHistory RecordBuilder by copying an existing _WorkingAgreementHistory instance */ + public static gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder(other); + } + + /** + * RecordBuilder for _WorkingAgreementHistory instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_WorkingAgreementHistory> + implements org.apache.avro.data.RecordBuilder<_WorkingAgreementHistory> { + + private java.util.List agreements; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _WorkingAgreementHistory instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory other) { + super(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.SCHEMA$); + if (isValidValue(fields()[0], other.agreements)) { + this.agreements = (java.util.List) data().deepCopy(fields()[0].schema(), other.agreements); + fieldSetFlags()[0] = true; + } + } + + /** Gets the value of the 'agreements' field */ + public java.util.List getAgreements() { + return agreements; + } + + /** Sets the value of the 'agreements' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder setAgreements(java.util.List value) { + validate(fields()[0], value); + this.agreements = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'agreements' field has been set */ + public boolean hasAgreements() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'agreements' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory.Builder clearAgreements() { + agreements = null; + fieldSetFlags()[0] = false; + return this; + } + + @Override + public _WorkingAgreementHistory build() { + try { + _WorkingAgreementHistory record = new _WorkingAgreementHistory(); + record.agreements = fieldSetFlags()[0] ? this.agreements : (java.util.List) defaultValue(fields()[0]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourceInstanceChargingState.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourceInstanceChargingState.java new file mode 100644 index 0000000..5997203 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourceInstanceChargingState.java @@ -0,0 +1,411 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _WorkingResourceInstanceChargingState extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_WorkingResourceInstanceChargingState\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}}},{\"name\":\"previousEvents\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ResourceEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"resource\",\"type\":\"string\",\"aliases\":[\"resourceType\"]},{\"name\":\"instanceID\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}}]}}},{\"name\":\"implicitlyIssuedStartEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"accumulatingAmount\",\"type\":\"double\"},{\"name\":\"oldAccumulatingAmount\",\"type\":\"double\"},{\"name\":\"previousValue\",\"type\":\"double\"},{\"name\":\"currentValue\",\"type\":\"double\"}]}"); + @Deprecated public java.util.Map details; + @Deprecated public java.util.List previousEvents; + @Deprecated public java.util.List implicitlyIssuedStartEvents; + @Deprecated public double accumulatingAmount; + @Deprecated public double oldAccumulatingAmount; + @Deprecated public double previousValue; + @Deprecated public double currentValue; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return details; + case 1: return previousEvents; + case 2: return implicitlyIssuedStartEvents; + case 3: return accumulatingAmount; + case 4: return oldAccumulatingAmount; + case 5: return previousValue; + case 6: return currentValue; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: details = (java.util.Map)value$; break; + case 1: previousEvents = (java.util.List)value$; break; + case 2: implicitlyIssuedStartEvents = (java.util.List)value$; break; + case 3: accumulatingAmount = (java.lang.Double)value$; break; + case 4: oldAccumulatingAmount = (java.lang.Double)value$; break; + case 5: previousValue = (java.lang.Double)value$; break; + case 6: currentValue = (java.lang.Double)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'details' field. + */ + public java.util.Map getDetails() { + return details; + } + + /** + * Sets the value of the 'details' field. + * @param value the value to set. + */ + public void setDetails(java.util.Map value) { + this.details = value; + } + + /** + * Gets the value of the 'previousEvents' field. + */ + public java.util.List getPreviousEvents() { + return previousEvents; + } + + /** + * Sets the value of the 'previousEvents' field. + * @param value the value to set. + */ + public void setPreviousEvents(java.util.List value) { + this.previousEvents = value; + } + + /** + * Gets the value of the 'implicitlyIssuedStartEvents' field. + */ + public java.util.List getImplicitlyIssuedStartEvents() { + return implicitlyIssuedStartEvents; + } + + /** + * Sets the value of the 'implicitlyIssuedStartEvents' field. + * @param value the value to set. + */ + public void setImplicitlyIssuedStartEvents(java.util.List value) { + this.implicitlyIssuedStartEvents = value; + } + + /** + * Gets the value of the 'accumulatingAmount' field. + */ + public java.lang.Double getAccumulatingAmount() { + return accumulatingAmount; + } + + /** + * Sets the value of the 'accumulatingAmount' field. + * @param value the value to set. + */ + public void setAccumulatingAmount(java.lang.Double value) { + this.accumulatingAmount = value; + } + + /** + * Gets the value of the 'oldAccumulatingAmount' field. + */ + public java.lang.Double getOldAccumulatingAmount() { + return oldAccumulatingAmount; + } + + /** + * Sets the value of the 'oldAccumulatingAmount' field. + * @param value the value to set. + */ + public void setOldAccumulatingAmount(java.lang.Double value) { + this.oldAccumulatingAmount = value; + } + + /** + * Gets the value of the 'previousValue' field. + */ + public java.lang.Double getPreviousValue() { + return previousValue; + } + + /** + * Sets the value of the 'previousValue' field. + * @param value the value to set. + */ + public void setPreviousValue(java.lang.Double value) { + this.previousValue = value; + } + + /** + * Gets the value of the 'currentValue' field. + */ + public java.lang.Double getCurrentValue() { + return currentValue; + } + + /** + * Sets the value of the 'currentValue' field. + * @param value the value to set. + */ + public void setCurrentValue(java.lang.Double value) { + this.currentValue = value; + } + + /** Creates a new _WorkingResourceInstanceChargingState RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder(); + } + + /** Creates a new _WorkingResourceInstanceChargingState RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder(other); + } + + /** Creates a new _WorkingResourceInstanceChargingState RecordBuilder by copying an existing _WorkingResourceInstanceChargingState instance */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder(other); + } + + /** + * RecordBuilder for _WorkingResourceInstanceChargingState instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_WorkingResourceInstanceChargingState> + implements org.apache.avro.data.RecordBuilder<_WorkingResourceInstanceChargingState> { + + private java.util.Map details; + private java.util.List previousEvents; + private java.util.List implicitlyIssuedStartEvents; + private double accumulatingAmount; + private double oldAccumulatingAmount; + private double previousValue; + private double currentValue; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _WorkingResourceInstanceChargingState instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState other) { + super(gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.SCHEMA$); + if (isValidValue(fields()[0], other.details)) { + this.details = (java.util.Map) data().deepCopy(fields()[0].schema(), other.details); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.previousEvents)) { + this.previousEvents = (java.util.List) data().deepCopy(fields()[1].schema(), other.previousEvents); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.implicitlyIssuedStartEvents)) { + this.implicitlyIssuedStartEvents = (java.util.List) data().deepCopy(fields()[2].schema(), other.implicitlyIssuedStartEvents); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.accumulatingAmount)) { + this.accumulatingAmount = (java.lang.Double) data().deepCopy(fields()[3].schema(), other.accumulatingAmount); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.oldAccumulatingAmount)) { + this.oldAccumulatingAmount = (java.lang.Double) data().deepCopy(fields()[4].schema(), other.oldAccumulatingAmount); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.previousValue)) { + this.previousValue = (java.lang.Double) data().deepCopy(fields()[5].schema(), other.previousValue); + fieldSetFlags()[5] = true; + } + if (isValidValue(fields()[6], other.currentValue)) { + this.currentValue = (java.lang.Double) data().deepCopy(fields()[6].schema(), other.currentValue); + fieldSetFlags()[6] = true; + } + } + + /** Gets the value of the 'details' field */ + public java.util.Map getDetails() { + return details; + } + + /** Sets the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setDetails(java.util.Map value) { + validate(fields()[0], value); + this.details = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'details' field has been set */ + public boolean hasDetails() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearDetails() { + details = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'previousEvents' field */ + public java.util.List getPreviousEvents() { + return previousEvents; + } + + /** Sets the value of the 'previousEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setPreviousEvents(java.util.List value) { + validate(fields()[1], value); + this.previousEvents = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'previousEvents' field has been set */ + public boolean hasPreviousEvents() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'previousEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearPreviousEvents() { + previousEvents = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'implicitlyIssuedStartEvents' field */ + public java.util.List getImplicitlyIssuedStartEvents() { + return implicitlyIssuedStartEvents; + } + + /** Sets the value of the 'implicitlyIssuedStartEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setImplicitlyIssuedStartEvents(java.util.List value) { + validate(fields()[2], value); + this.implicitlyIssuedStartEvents = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'implicitlyIssuedStartEvents' field has been set */ + public boolean hasImplicitlyIssuedStartEvents() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'implicitlyIssuedStartEvents' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearImplicitlyIssuedStartEvents() { + implicitlyIssuedStartEvents = null; + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'accumulatingAmount' field */ + public java.lang.Double getAccumulatingAmount() { + return accumulatingAmount; + } + + /** Sets the value of the 'accumulatingAmount' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setAccumulatingAmount(double value) { + validate(fields()[3], value); + this.accumulatingAmount = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'accumulatingAmount' field has been set */ + public boolean hasAccumulatingAmount() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'accumulatingAmount' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearAccumulatingAmount() { + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'oldAccumulatingAmount' field */ + public java.lang.Double getOldAccumulatingAmount() { + return oldAccumulatingAmount; + } + + /** Sets the value of the 'oldAccumulatingAmount' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setOldAccumulatingAmount(double value) { + validate(fields()[4], value); + this.oldAccumulatingAmount = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'oldAccumulatingAmount' field has been set */ + public boolean hasOldAccumulatingAmount() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'oldAccumulatingAmount' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearOldAccumulatingAmount() { + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'previousValue' field */ + public java.lang.Double getPreviousValue() { + return previousValue; + } + + /** Sets the value of the 'previousValue' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setPreviousValue(double value) { + validate(fields()[5], value); + this.previousValue = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'previousValue' field has been set */ + public boolean hasPreviousValue() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'previousValue' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearPreviousValue() { + fieldSetFlags()[5] = false; + return this; + } + + /** Gets the value of the 'currentValue' field */ + public java.lang.Double getCurrentValue() { + return currentValue; + } + + /** Sets the value of the 'currentValue' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder setCurrentValue(double value) { + validate(fields()[6], value); + this.currentValue = value; + fieldSetFlags()[6] = true; + return this; + } + + /** Checks whether the 'currentValue' field has been set */ + public boolean hasCurrentValue() { + return fieldSetFlags()[6]; + } + + /** Clears the value of the 'currentValue' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourceInstanceChargingState.Builder clearCurrentValue() { + fieldSetFlags()[6] = false; + return this; + } + + @Override + public _WorkingResourceInstanceChargingState build() { + try { + _WorkingResourceInstanceChargingState record = new _WorkingResourceInstanceChargingState(); + record.details = fieldSetFlags()[0] ? this.details : (java.util.Map) defaultValue(fields()[0]); + record.previousEvents = fieldSetFlags()[1] ? this.previousEvents : (java.util.List) defaultValue(fields()[1]); + record.implicitlyIssuedStartEvents = fieldSetFlags()[2] ? this.implicitlyIssuedStartEvents : (java.util.List) defaultValue(fields()[2]); + record.accumulatingAmount = fieldSetFlags()[3] ? this.accumulatingAmount : (java.lang.Double) defaultValue(fields()[3]); + record.oldAccumulatingAmount = fieldSetFlags()[4] ? this.oldAccumulatingAmount : (java.lang.Double) defaultValue(fields()[4]); + record.previousValue = fieldSetFlags()[5] ? this.previousValue : (java.lang.Double) defaultValue(fields()[5]); + record.currentValue = fieldSetFlags()[6] ? this.currentValue : (java.lang.Double) defaultValue(fields()[6]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourcesChargingState.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourcesChargingState.java new file mode 100644 index 0000000..e78b48f --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingResourcesChargingState.java @@ -0,0 +1,170 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _WorkingResourcesChargingState extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_WorkingResourcesChargingState\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}}},{\"name\":\"stateOfResourceInstance\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_WorkingResourceInstanceChargingState\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}},{\"name\":\"previousEvents\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ResourceEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"resource\",\"type\":\"string\",\"aliases\":[\"resourceType\"]},{\"name\":\"instanceID\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}}]}}},{\"name\":\"implicitlyIssuedStartEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"accumulatingAmount\",\"type\":\"double\"},{\"name\":\"oldAccumulatingAmount\",\"type\":\"double\"},{\"name\":\"previousValue\",\"type\":\"double\"},{\"name\":\"currentValue\",\"type\":\"double\"}]}}}]}"); + @Deprecated public java.util.Map details; + @Deprecated public java.util.Map stateOfResourceInstance; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return details; + case 1: return stateOfResourceInstance; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: details = (java.util.Map)value$; break; + case 1: stateOfResourceInstance = (java.util.Map)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'details' field. + */ + public java.util.Map getDetails() { + return details; + } + + /** + * Sets the value of the 'details' field. + * @param value the value to set. + */ + public void setDetails(java.util.Map value) { + this.details = value; + } + + /** + * Gets the value of the 'stateOfResourceInstance' field. + */ + public java.util.Map getStateOfResourceInstance() { + return stateOfResourceInstance; + } + + /** + * Sets the value of the 'stateOfResourceInstance' field. + * @param value the value to set. + */ + public void setStateOfResourceInstance(java.util.Map value) { + this.stateOfResourceInstance = value; + } + + /** Creates a new _WorkingResourcesChargingState RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder(); + } + + /** Creates a new _WorkingResourcesChargingState RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder(other); + } + + /** Creates a new _WorkingResourcesChargingState RecordBuilder by copying an existing _WorkingResourcesChargingState instance */ + public static gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder(other); + } + + /** + * RecordBuilder for _WorkingResourcesChargingState instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_WorkingResourcesChargingState> + implements org.apache.avro.data.RecordBuilder<_WorkingResourcesChargingState> { + + private java.util.Map details; + private java.util.Map stateOfResourceInstance; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _WorkingResourcesChargingState instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState other) { + super(gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.SCHEMA$); + if (isValidValue(fields()[0], other.details)) { + this.details = (java.util.Map) data().deepCopy(fields()[0].schema(), other.details); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.stateOfResourceInstance)) { + this.stateOfResourceInstance = (java.util.Map) data().deepCopy(fields()[1].schema(), other.stateOfResourceInstance); + fieldSetFlags()[1] = true; + } + } + + /** Gets the value of the 'details' field */ + public java.util.Map getDetails() { + return details; + } + + /** Sets the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder setDetails(java.util.Map value) { + validate(fields()[0], value); + this.details = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'details' field has been set */ + public boolean hasDetails() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'details' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder clearDetails() { + details = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'stateOfResourceInstance' field */ + public java.util.Map getStateOfResourceInstance() { + return stateOfResourceInstance; + } + + /** Sets the value of the 'stateOfResourceInstance' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder setStateOfResourceInstance(java.util.Map value) { + validate(fields()[1], value); + this.stateOfResourceInstance = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'stateOfResourceInstance' field has been set */ + public boolean hasStateOfResourceInstance() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'stateOfResourceInstance' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingResourcesChargingState.Builder clearStateOfResourceInstance() { + stateOfResourceInstance = null; + fieldSetFlags()[1] = false; + return this; + } + + @Override + public _WorkingResourcesChargingState build() { + try { + _WorkingResourcesChargingState record = new _WorkingResourcesChargingState(); + record.details = fieldSetFlags()[0] ? this.details : (java.util.Map) defaultValue(fields()[0]); + record.stateOfResourceInstance = fieldSetFlags()[1] ? this.stateOfResourceInstance : (java.util.Map) defaultValue(fields()[1]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingUserState.java b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingUserState.java new file mode 100644 index 0000000..d9217f9 --- /dev/null +++ b/src/main/java/gr/grnet/aquarium/message/avro/gen/_WorkingUserState.java @@ -0,0 +1,558 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package gr.grnet.aquarium.message.avro.gen; +@SuppressWarnings("all") +public class _WorkingUserState extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"_WorkingUserState\",\"namespace\":\"gr.grnet.aquarium.message.avro.gen\",\"fields\":[{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"parentUserStateIDInStore\",\"type\":[\"string\",\"null\"]},{\"name\":\"resourceTypesMap\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}}},{\"name\":\"workingStateOfResources\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_WorkingResourcesChargingState\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_AnyValue\",\"fields\":[{\"name\":\"anyValue\",\"type\":[\"null\",\"int\",\"long\",\"boolean\",\"double\",\"bytes\",\"string\"]}]}}},{\"name\":\"stateOfResourceInstance\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_WorkingResourceInstanceChargingState\",\"fields\":[{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}},{\"name\":\"previousEvents\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_ResourceEvent\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"aliases\":[\"originalID\",\"ID\"]},{\"name\":\"idInStore\",\"type\":\"string\"},{\"name\":\"occurredMillis\",\"type\":\"long\"},{\"name\":\"receivedMillis\",\"type\":\"long\",\"default\":0},{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"clientID\",\"type\":\"string\"},{\"name\":\"eventVersion\",\"type\":\"string\",\"default\":\"1.0\"},{\"name\":\"resource\",\"type\":\"string\",\"aliases\":[\"resourceType\"]},{\"name\":\"instanceID\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"},{\"name\":\"details\",\"type\":{\"type\":\"map\",\"values\":\"_AnyValue\"}}]}}},{\"name\":\"implicitlyIssuedStartEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"accumulatingAmount\",\"type\":\"double\"},{\"name\":\"oldAccumulatingAmount\",\"type\":\"double\"},{\"name\":\"previousValue\",\"type\":\"double\"},{\"name\":\"currentValue\",\"type\":\"double\"}]}}}]}}},{\"name\":\"totalCredits\",\"type\":\"double\"},{\"name\":\"workingAgreementHistory\",\"type\":{\"type\":\"record\",\"name\":\"_WorkingAgreementHistory\",\"fields\":[{\"name\":\"agreements\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_UserAgreement\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"relatedIMEventID\",\"type\":[\"string\",\"null\"]},{\"name\":\"validFromMillis\",\"type\":\"long\"},{\"name\":\"validToMillis\",\"type\":\"long\"},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"fullPriceTableRef\",\"type\":[{\"type\":\"record\",\"name\":\"_FullPriceTable\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"_SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"_EffectivePriceTable\",\"fields\":[{\"name\":\"priceOverrides\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_EffectiveUnitPrice\",\"fields\":[{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"when\",\"type\":[{\"type\":\"record\",\"name\":\"_CronSpecTuple\",\"fields\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"string\"}]},\"null\"]}]}}}]},{\"type\":\"map\",\"values\":\"_SelectorValue\"}]}]}}}}]},\"null\"]}]}}}]}},{\"name\":\"latestUpdateMillis\",\"type\":\"long\"},{\"name\":\"latestResourceEventOccurredMillis\",\"type\":\"long\"},{\"name\":\"billingPeriodOutOfSyncResourceEventsCounter\",\"type\":\"long\"},{\"name\":\"walletEntries\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_WalletEntry\",\"fields\":[{\"name\":\"userID\",\"type\":\"string\"},{\"name\":\"sumOfCreditsToSubtract\",\"type\":\"double\"},{\"name\":\"oldTotalCredits\",\"type\":\"double\"},{\"name\":\"newTotalCredits\",\"type\":\"double\"},{\"name\":\"whenComputedMillis\",\"type\":\"long\"},{\"name\":\"referenceStartMillis\",\"type\":\"long\"},{\"name\":\"referenceStopMillis\",\"type\":\"long\"},{\"name\":\"billingYear\",\"type\":\"int\"},{\"name\":\"billingMonth\",\"type\":\"int\"},{\"name\":\"billingDay\",\"type\":\"int\"},{\"name\":\"chargeslots\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"_Chargeslot\",\"fields\":[{\"name\":\"startMillis\",\"type\":\"long\"},{\"name\":\"stopMillis\",\"type\":\"long\"},{\"name\":\"unitPrice\",\"type\":\"double\"},{\"name\":\"explanation\",\"type\":\"string\",\"default\":\"\"},{\"name\":\"creditsToSubtract\",\"type\":\"double\"}]}}},{\"name\":\"resourceEvents\",\"type\":{\"type\":\"array\",\"items\":\"_ResourceEvent\"}},{\"name\":\"resourceType\",\"type\":\"_ResourceType\"},{\"name\":\"isSynthetic\",\"type\":\"boolean\",\"default\":false}]}}}]}"); + @Deprecated public java.lang.CharSequence userID; + @Deprecated public java.lang.CharSequence parentUserStateIDInStore; + @Deprecated public java.util.Map resourceTypesMap; + @Deprecated public java.util.Map workingStateOfResources; + @Deprecated public double totalCredits; + @Deprecated public gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory workingAgreementHistory; + @Deprecated public long latestUpdateMillis; + @Deprecated public long latestResourceEventOccurredMillis; + @Deprecated public long billingPeriodOutOfSyncResourceEventsCounter; + @Deprecated public java.util.List walletEntries; + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public java.lang.Object get(int field$) { + switch (field$) { + case 0: return userID; + case 1: return parentUserStateIDInStore; + case 2: return resourceTypesMap; + case 3: return workingStateOfResources; + case 4: return totalCredits; + case 5: return workingAgreementHistory; + case 6: return latestUpdateMillis; + case 7: return latestResourceEventOccurredMillis; + case 8: return billingPeriodOutOfSyncResourceEventsCounter; + case 9: return walletEntries; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, java.lang.Object value$) { + switch (field$) { + case 0: userID = (java.lang.CharSequence)value$; break; + case 1: parentUserStateIDInStore = (java.lang.CharSequence)value$; break; + case 2: resourceTypesMap = (java.util.Map)value$; break; + case 3: workingStateOfResources = (java.util.Map)value$; break; + case 4: totalCredits = (java.lang.Double)value$; break; + case 5: workingAgreementHistory = (gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory)value$; break; + case 6: latestUpdateMillis = (java.lang.Long)value$; break; + case 7: latestResourceEventOccurredMillis = (java.lang.Long)value$; break; + case 8: billingPeriodOutOfSyncResourceEventsCounter = (java.lang.Long)value$; break; + case 9: walletEntries = (java.util.List)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'userID' field. + */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** + * Sets the value of the 'userID' field. + * @param value the value to set. + */ + public void setUserID(java.lang.CharSequence value) { + this.userID = value; + } + + /** + * Gets the value of the 'parentUserStateIDInStore' field. + */ + public java.lang.CharSequence getParentUserStateIDInStore() { + return parentUserStateIDInStore; + } + + /** + * Sets the value of the 'parentUserStateIDInStore' field. + * @param value the value to set. + */ + public void setParentUserStateIDInStore(java.lang.CharSequence value) { + this.parentUserStateIDInStore = value; + } + + /** + * Gets the value of the 'resourceTypesMap' field. + */ + public java.util.Map getResourceTypesMap() { + return resourceTypesMap; + } + + /** + * Sets the value of the 'resourceTypesMap' field. + * @param value the value to set. + */ + public void setResourceTypesMap(java.util.Map value) { + this.resourceTypesMap = value; + } + + /** + * Gets the value of the 'workingStateOfResources' field. + */ + public java.util.Map getWorkingStateOfResources() { + return workingStateOfResources; + } + + /** + * Sets the value of the 'workingStateOfResources' field. + * @param value the value to set. + */ + public void setWorkingStateOfResources(java.util.Map value) { + this.workingStateOfResources = value; + } + + /** + * Gets the value of the 'totalCredits' field. + */ + public java.lang.Double getTotalCredits() { + return totalCredits; + } + + /** + * Sets the value of the 'totalCredits' field. + * @param value the value to set. + */ + public void setTotalCredits(java.lang.Double value) { + this.totalCredits = value; + } + + /** + * Gets the value of the 'workingAgreementHistory' field. + */ + public gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory getWorkingAgreementHistory() { + return workingAgreementHistory; + } + + /** + * Sets the value of the 'workingAgreementHistory' field. + * @param value the value to set. + */ + public void setWorkingAgreementHistory(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory value) { + this.workingAgreementHistory = value; + } + + /** + * Gets the value of the 'latestUpdateMillis' field. + */ + public java.lang.Long getLatestUpdateMillis() { + return latestUpdateMillis; + } + + /** + * Sets the value of the 'latestUpdateMillis' field. + * @param value the value to set. + */ + public void setLatestUpdateMillis(java.lang.Long value) { + this.latestUpdateMillis = value; + } + + /** + * Gets the value of the 'latestResourceEventOccurredMillis' field. + */ + public java.lang.Long getLatestResourceEventOccurredMillis() { + return latestResourceEventOccurredMillis; + } + + /** + * Sets the value of the 'latestResourceEventOccurredMillis' field. + * @param value the value to set. + */ + public void setLatestResourceEventOccurredMillis(java.lang.Long value) { + this.latestResourceEventOccurredMillis = value; + } + + /** + * Gets the value of the 'billingPeriodOutOfSyncResourceEventsCounter' field. + */ + public java.lang.Long getBillingPeriodOutOfSyncResourceEventsCounter() { + return billingPeriodOutOfSyncResourceEventsCounter; + } + + /** + * Sets the value of the 'billingPeriodOutOfSyncResourceEventsCounter' field. + * @param value the value to set. + */ + public void setBillingPeriodOutOfSyncResourceEventsCounter(java.lang.Long value) { + this.billingPeriodOutOfSyncResourceEventsCounter = value; + } + + /** + * Gets the value of the 'walletEntries' field. + */ + public java.util.List getWalletEntries() { + return walletEntries; + } + + /** + * Sets the value of the 'walletEntries' field. + * @param value the value to set. + */ + public void setWalletEntries(java.util.List value) { + this.walletEntries = value; + } + + /** Creates a new _WorkingUserState RecordBuilder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder newBuilder() { + return new gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder(); + } + + /** Creates a new _WorkingUserState RecordBuilder by copying an existing Builder */ + public static gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder(other); + } + + /** Creates a new _WorkingUserState RecordBuilder by copying an existing _WorkingUserState instance */ + public static gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder newBuilder(gr.grnet.aquarium.message.avro.gen._WorkingUserState other) { + return new gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder(other); + } + + /** + * RecordBuilder for _WorkingUserState instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<_WorkingUserState> + implements org.apache.avro.data.RecordBuilder<_WorkingUserState> { + + private java.lang.CharSequence userID; + private java.lang.CharSequence parentUserStateIDInStore; + private java.util.Map resourceTypesMap; + private java.util.Map workingStateOfResources; + private double totalCredits; + private gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory workingAgreementHistory; + private long latestUpdateMillis; + private long latestResourceEventOccurredMillis; + private long billingPeriodOutOfSyncResourceEventsCounter; + private java.util.List walletEntries; + + /** Creates a new Builder */ + private Builder() { + super(gr.grnet.aquarium.message.avro.gen._WorkingUserState.SCHEMA$); + } + + /** Creates a Builder by copying an existing Builder */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder other) { + super(other); + } + + /** Creates a Builder by copying an existing _WorkingUserState instance */ + private Builder(gr.grnet.aquarium.message.avro.gen._WorkingUserState other) { + super(gr.grnet.aquarium.message.avro.gen._WorkingUserState.SCHEMA$); + if (isValidValue(fields()[0], other.userID)) { + this.userID = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.userID); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.parentUserStateIDInStore)) { + this.parentUserStateIDInStore = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.parentUserStateIDInStore); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.resourceTypesMap)) { + this.resourceTypesMap = (java.util.Map) data().deepCopy(fields()[2].schema(), other.resourceTypesMap); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.workingStateOfResources)) { + this.workingStateOfResources = (java.util.Map) data().deepCopy(fields()[3].schema(), other.workingStateOfResources); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.totalCredits)) { + this.totalCredits = (java.lang.Double) data().deepCopy(fields()[4].schema(), other.totalCredits); + fieldSetFlags()[4] = true; + } + if (isValidValue(fields()[5], other.workingAgreementHistory)) { + this.workingAgreementHistory = (gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory) data().deepCopy(fields()[5].schema(), other.workingAgreementHistory); + fieldSetFlags()[5] = true; + } + if (isValidValue(fields()[6], other.latestUpdateMillis)) { + this.latestUpdateMillis = (java.lang.Long) data().deepCopy(fields()[6].schema(), other.latestUpdateMillis); + fieldSetFlags()[6] = true; + } + if (isValidValue(fields()[7], other.latestResourceEventOccurredMillis)) { + this.latestResourceEventOccurredMillis = (java.lang.Long) data().deepCopy(fields()[7].schema(), other.latestResourceEventOccurredMillis); + fieldSetFlags()[7] = true; + } + if (isValidValue(fields()[8], other.billingPeriodOutOfSyncResourceEventsCounter)) { + this.billingPeriodOutOfSyncResourceEventsCounter = (java.lang.Long) data().deepCopy(fields()[8].schema(), other.billingPeriodOutOfSyncResourceEventsCounter); + fieldSetFlags()[8] = true; + } + if (isValidValue(fields()[9], other.walletEntries)) { + this.walletEntries = (java.util.List) data().deepCopy(fields()[9].schema(), other.walletEntries); + fieldSetFlags()[9] = true; + } + } + + /** Gets the value of the 'userID' field */ + public java.lang.CharSequence getUserID() { + return userID; + } + + /** Sets the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setUserID(java.lang.CharSequence value) { + validate(fields()[0], value); + this.userID = value; + fieldSetFlags()[0] = true; + return this; + } + + /** Checks whether the 'userID' field has been set */ + public boolean hasUserID() { + return fieldSetFlags()[0]; + } + + /** Clears the value of the 'userID' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearUserID() { + userID = null; + fieldSetFlags()[0] = false; + return this; + } + + /** Gets the value of the 'parentUserStateIDInStore' field */ + public java.lang.CharSequence getParentUserStateIDInStore() { + return parentUserStateIDInStore; + } + + /** Sets the value of the 'parentUserStateIDInStore' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setParentUserStateIDInStore(java.lang.CharSequence value) { + validate(fields()[1], value); + this.parentUserStateIDInStore = value; + fieldSetFlags()[1] = true; + return this; + } + + /** Checks whether the 'parentUserStateIDInStore' field has been set */ + public boolean hasParentUserStateIDInStore() { + return fieldSetFlags()[1]; + } + + /** Clears the value of the 'parentUserStateIDInStore' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearParentUserStateIDInStore() { + parentUserStateIDInStore = null; + fieldSetFlags()[1] = false; + return this; + } + + /** Gets the value of the 'resourceTypesMap' field */ + public java.util.Map getResourceTypesMap() { + return resourceTypesMap; + } + + /** Sets the value of the 'resourceTypesMap' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setResourceTypesMap(java.util.Map value) { + validate(fields()[2], value); + this.resourceTypesMap = value; + fieldSetFlags()[2] = true; + return this; + } + + /** Checks whether the 'resourceTypesMap' field has been set */ + public boolean hasResourceTypesMap() { + return fieldSetFlags()[2]; + } + + /** Clears the value of the 'resourceTypesMap' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearResourceTypesMap() { + resourceTypesMap = null; + fieldSetFlags()[2] = false; + return this; + } + + /** Gets the value of the 'workingStateOfResources' field */ + public java.util.Map getWorkingStateOfResources() { + return workingStateOfResources; + } + + /** Sets the value of the 'workingStateOfResources' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setWorkingStateOfResources(java.util.Map value) { + validate(fields()[3], value); + this.workingStateOfResources = value; + fieldSetFlags()[3] = true; + return this; + } + + /** Checks whether the 'workingStateOfResources' field has been set */ + public boolean hasWorkingStateOfResources() { + return fieldSetFlags()[3]; + } + + /** Clears the value of the 'workingStateOfResources' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearWorkingStateOfResources() { + workingStateOfResources = null; + fieldSetFlags()[3] = false; + return this; + } + + /** Gets the value of the 'totalCredits' field */ + public java.lang.Double getTotalCredits() { + return totalCredits; + } + + /** Sets the value of the 'totalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setTotalCredits(double value) { + validate(fields()[4], value); + this.totalCredits = value; + fieldSetFlags()[4] = true; + return this; + } + + /** Checks whether the 'totalCredits' field has been set */ + public boolean hasTotalCredits() { + return fieldSetFlags()[4]; + } + + /** Clears the value of the 'totalCredits' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearTotalCredits() { + fieldSetFlags()[4] = false; + return this; + } + + /** Gets the value of the 'workingAgreementHistory' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory getWorkingAgreementHistory() { + return workingAgreementHistory; + } + + /** Sets the value of the 'workingAgreementHistory' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setWorkingAgreementHistory(gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory value) { + validate(fields()[5], value); + this.workingAgreementHistory = value; + fieldSetFlags()[5] = true; + return this; + } + + /** Checks whether the 'workingAgreementHistory' field has been set */ + public boolean hasWorkingAgreementHistory() { + return fieldSetFlags()[5]; + } + + /** Clears the value of the 'workingAgreementHistory' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearWorkingAgreementHistory() { + workingAgreementHistory = null; + fieldSetFlags()[5] = false; + return this; + } + + /** Gets the value of the 'latestUpdateMillis' field */ + public java.lang.Long getLatestUpdateMillis() { + return latestUpdateMillis; + } + + /** Sets the value of the 'latestUpdateMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setLatestUpdateMillis(long value) { + validate(fields()[6], value); + this.latestUpdateMillis = value; + fieldSetFlags()[6] = true; + return this; + } + + /** Checks whether the 'latestUpdateMillis' field has been set */ + public boolean hasLatestUpdateMillis() { + return fieldSetFlags()[6]; + } + + /** Clears the value of the 'latestUpdateMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearLatestUpdateMillis() { + fieldSetFlags()[6] = false; + return this; + } + + /** Gets the value of the 'latestResourceEventOccurredMillis' field */ + public java.lang.Long getLatestResourceEventOccurredMillis() { + return latestResourceEventOccurredMillis; + } + + /** Sets the value of the 'latestResourceEventOccurredMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setLatestResourceEventOccurredMillis(long value) { + validate(fields()[7], value); + this.latestResourceEventOccurredMillis = value; + fieldSetFlags()[7] = true; + return this; + } + + /** Checks whether the 'latestResourceEventOccurredMillis' field has been set */ + public boolean hasLatestResourceEventOccurredMillis() { + return fieldSetFlags()[7]; + } + + /** Clears the value of the 'latestResourceEventOccurredMillis' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearLatestResourceEventOccurredMillis() { + fieldSetFlags()[7] = false; + return this; + } + + /** Gets the value of the 'billingPeriodOutOfSyncResourceEventsCounter' field */ + public java.lang.Long getBillingPeriodOutOfSyncResourceEventsCounter() { + return billingPeriodOutOfSyncResourceEventsCounter; + } + + /** Sets the value of the 'billingPeriodOutOfSyncResourceEventsCounter' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setBillingPeriodOutOfSyncResourceEventsCounter(long value) { + validate(fields()[8], value); + this.billingPeriodOutOfSyncResourceEventsCounter = value; + fieldSetFlags()[8] = true; + return this; + } + + /** Checks whether the 'billingPeriodOutOfSyncResourceEventsCounter' field has been set */ + public boolean hasBillingPeriodOutOfSyncResourceEventsCounter() { + return fieldSetFlags()[8]; + } + + /** Clears the value of the 'billingPeriodOutOfSyncResourceEventsCounter' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearBillingPeriodOutOfSyncResourceEventsCounter() { + fieldSetFlags()[8] = false; + return this; + } + + /** Gets the value of the 'walletEntries' field */ + public java.util.List getWalletEntries() { + return walletEntries; + } + + /** Sets the value of the 'walletEntries' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder setWalletEntries(java.util.List value) { + validate(fields()[9], value); + this.walletEntries = value; + fieldSetFlags()[9] = true; + return this; + } + + /** Checks whether the 'walletEntries' field has been set */ + public boolean hasWalletEntries() { + return fieldSetFlags()[9]; + } + + /** Clears the value of the 'walletEntries' field */ + public gr.grnet.aquarium.message.avro.gen._WorkingUserState.Builder clearWalletEntries() { + walletEntries = null; + fieldSetFlags()[9] = false; + return this; + } + + @Override + public _WorkingUserState build() { + try { + _WorkingUserState record = new _WorkingUserState(); + record.userID = fieldSetFlags()[0] ? this.userID : (java.lang.CharSequence) defaultValue(fields()[0]); + record.parentUserStateIDInStore = fieldSetFlags()[1] ? this.parentUserStateIDInStore : (java.lang.CharSequence) defaultValue(fields()[1]); + record.resourceTypesMap = fieldSetFlags()[2] ? this.resourceTypesMap : (java.util.Map) defaultValue(fields()[2]); + record.workingStateOfResources = fieldSetFlags()[3] ? this.workingStateOfResources : (java.util.Map) defaultValue(fields()[3]); + record.totalCredits = fieldSetFlags()[4] ? this.totalCredits : (java.lang.Double) defaultValue(fields()[4]); + record.workingAgreementHistory = fieldSetFlags()[5] ? this.workingAgreementHistory : (gr.grnet.aquarium.message.avro.gen._WorkingAgreementHistory) defaultValue(fields()[5]); + record.latestUpdateMillis = fieldSetFlags()[6] ? this.latestUpdateMillis : (java.lang.Long) defaultValue(fields()[6]); + record.latestResourceEventOccurredMillis = fieldSetFlags()[7] ? this.latestResourceEventOccurredMillis : (java.lang.Long) defaultValue(fields()[7]); + record.billingPeriodOutOfSyncResourceEventsCounter = fieldSetFlags()[8] ? this.billingPeriodOutOfSyncResourceEventsCounter : (java.lang.Long) defaultValue(fields()[8]); + record.walletEntries = fieldSetFlags()[9] ? this.walletEntries : (java.util.List) defaultValue(fields()[9]); + return record; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } +} diff --git a/src/main/scala/gr/grnet/aquarium/charging/ChargingBehavior.scala b/src/main/scala/gr/grnet/aquarium/charging/ChargingBehavior.scala index 316ed67..5ef970f 100644 --- a/src/main/scala/gr/grnet/aquarium/charging/ChargingBehavior.scala +++ b/src/main/scala/gr/grnet/aquarium/charging/ChargingBehavior.scala @@ -53,7 +53,7 @@ import scala.collection.mutable */ trait ChargingBehavior { - def selectorLabelsHierarchy: List[String] + def selectorLabelsHierarchy: List[CharSequence] /** * Provides some initial charging details that will be part of the mutable charging state diff --git a/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingState.scala b/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingState.scala index 03d493b..27fe702 100644 --- a/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingState.scala +++ b/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingState.scala @@ -47,7 +47,7 @@ case class ResourceInstanceChargingState( details: Map[String, Any], previousEvents: List[ResourceEventModel], // the implicitly issued resource event at the beginning of the billing period. - implicitlyIssuedStartEvent: List[ResourceEventModel], + implicitlyIssuedStartEvents: List[ResourceEventModel], accumulatingAmount: Double, oldAccumulatingAmount: Double, previousValue: Double, @@ -60,7 +60,7 @@ case class ResourceInstanceChargingState( new WorkingResourceInstanceChargingState( details = mutableDetails, previousEvents = this.previousEvents, - implicitlyIssuedStartEvent = this.implicitlyIssuedStartEvent, + implicitlyIssuedStartEvents = this.implicitlyIssuedStartEvents, accumulatingAmount = this.accumulatingAmount, oldAccumulatingAmount = this.oldAccumulatingAmount, previousValue = this.previousValue, diff --git a/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingStateModel.scala b/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingStateModel.scala index b6f1f72..5a572ba 100644 --- a/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingStateModel.scala +++ b/src/main/scala/gr/grnet/aquarium/charging/state/ResourceInstanceChargingStateModel.scala @@ -47,7 +47,7 @@ trait ResourceInstanceChargingStateModel { def previousEvents: List[ResourceEventModel] // the implicitly issued resource event at the beginning of the billing period. - def implicitlyIssuedStartEvent: List[ResourceEventModel] + def implicitlyIssuedStartEvents: List[ResourceEventModel] // Always the new accumulating amount def accumulatingAmount: Double diff --git a/src/main/scala/gr/grnet/aquarium/charging/state/WorkingResourceInstanceChargingState.scala b/src/main/scala/gr/grnet/aquarium/charging/state/WorkingResourceInstanceChargingState.scala index 094a605..236f892 100644 --- a/src/main/scala/gr/grnet/aquarium/charging/state/WorkingResourceInstanceChargingState.scala +++ b/src/main/scala/gr/grnet/aquarium/charging/state/WorkingResourceInstanceChargingState.scala @@ -48,7 +48,7 @@ final class WorkingResourceInstanceChargingState( val details: mutable.Map[String, Any], var previousEvents: List[ResourceEventModel], // the implicitly issued resource event at the beginning of the billing period. - var implicitlyIssuedStartEvent: List[ResourceEventModel], + var implicitlyIssuedStartEvents: List[ResourceEventModel], // Always the new accumulating amount var accumulatingAmount: Double, var oldAccumulatingAmount: Double, @@ -60,7 +60,7 @@ final class WorkingResourceInstanceChargingState( new ResourceInstanceChargingState( details = immutableDetails, previousEvents = this.previousEvents, - implicitlyIssuedStartEvent = this.implicitlyIssuedStartEvent, + implicitlyIssuedStartEvents = this.implicitlyIssuedStartEvents, accumulatingAmount = this.accumulatingAmount, oldAccumulatingAmount = this.oldAccumulatingAmount, previousValue = this.previousValue, diff --git a/src/main/scala/gr/grnet/aquarium/message/avro/FullPriceTableHelpers.scala b/src/main/scala/gr/grnet/aquarium/message/avro/FullPriceTableHelpers.scala new file mode 100644 index 0000000..ef672ea --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/message/avro/FullPriceTableHelpers.scala @@ -0,0 +1,184 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.message.avro + +import gr.grnet.aquarium.message.avro.gen.{_EffectivePriceTable, _FullPriceTable} +import gr.grnet.aquarium.AquariumInternalError +import gr.grnet.aquarium.util.shortNameOfType +import gr.grnet.aquarium.util.LogHelpers.Debug +import org.slf4j.Logger +import scala.annotation.tailrec +import java.{util ⇒ ju} + +/** + * + * @author Christos KK Loverdos + */ +object FullPriceTableHelpers { + final val DefaultSelectorKey = "default" + + def effectivePriceTableOfSelectorForResource( + fullPriceTable: _FullPriceTable, + selectorPath: List[CharSequence], + resource: String, + logger: Logger + ): _EffectivePriceTable = { + + // Most of the code is for exceptional cases, which we identify in detail. + @tailrec + def find( + partialSelectorPath: List[CharSequence], + partialSelectorData: Any + ): _EffectivePriceTable = { + + Debug(logger, "find: ") + Debug(logger, " partialSelectorPath = %s", partialSelectorPath.mkString("/")) + Debug(logger, " partialSelectorData = %s", partialSelectorData) + + partialSelectorPath match { + case selector :: Nil ⇒ + // One selector, meaning that the selectorData must be a Map[String, EffectivePriceTable] + partialSelectorData match { + case selectorMap: ju.Map[_,_] ⇒ + // The selectorData is a map indeed + selectorMap.asInstanceOf[ju.Map[String, _]].get(selector) match { + case null ⇒ + // The selectorData is a map but it does nto contain the selector + throw new AquariumInternalError( + "[AQU-SEL-002] Cannot select path %s for resource %s. Nothing found at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + partialSelectorPath.mkString("/") + ) + ) + + case selected: _EffectivePriceTable ⇒ + // Yes, it is a map of the right type (OK, we assume keys are always Strings) + // (we only check the value type) + selected + + case badSelected ⇒ + // The selectorData is a map but the value is not of the required type + throw new AquariumInternalError( + "[AQU-SEL-001] Cannot select path %s for resource %s. Found %s instead of an %s at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + badSelected, + shortNameOfType[_EffectivePriceTable], + partialSelectorPath.mkString("/") + ) + ) + } + + + case badData ⇒ + // The selectorData is not a map. So we have just one final selector but no map to select from. + throw new AquariumInternalError( + "[AQU-SEL-003] Cannot select path %s for resource %s. Found %s instead of a Map at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + badData, + partialSelectorPath.mkString("/") + ) + ) + } + + case selector :: selectorTail ⇒ + // More than one selector in the path, meaning that the selectorData must be a Map[String, Map[String, _]] + partialSelectorData match { + case selectorMap: ju.Map[_,_] ⇒ + // The selectorData is a map indeed + selectorMap.asInstanceOf[ju.Map[String,_]].get(selector) match { + case null ⇒ + // The selectorData is a map but it does not contain the selector + throw new AquariumInternalError( + "[AQU-SEL-005] Cannot select path %s for resource %s. Nothing found at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + partialSelectorPath.mkString("/") + ) + ) + + case furtherSelectorMap: ju.Map[_,_] ⇒ + // The selectorData is a map and we found the respective value for the selector to be a map. + find(selectorTail, furtherSelectorMap) + + case furtherBad ⇒ + // The selectorData is a map but the respective value is not a map, so that + // the selectorTail path cannot be used. + throw new AquariumInternalError( + "[AQU-SEL-004] Cannot select path %s for resource %s. Found %s instead of a Map at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + furtherBad, + partialSelectorPath.mkString("/") + ) + ) + } + + case badData ⇒ + // The selectorData is not a Map. So we have more than one selectors but no map to select from. + throw new AquariumInternalError( + "[AQU-SEL-006] Cannot select path %s for resource %s. Found %s instead of a Map at partial selector path %s".format( + selectorPath.mkString("/"), + resource, + badData, + partialSelectorPath.mkString("/") + ) + ) + } + + case Nil ⇒ + throw new AquariumInternalError( + "[AQU-SEL-007] No selector path for resource %s".format(resource) + ) + + } + } + + Debug(logger, "effectivePriceTableOfSelectorForResource:") + Debug(logger, " selectorPath = %s", selectorPath.mkString("/")) + + val selectorData = fullPriceTable.getPerResource().get(resource) + if(selectorData eq null) { + throw new AquariumInternalError("Unknown resource type '%s'", resource) + } + + Debug(logger, " selectorData = %s", selectorData) + find(selectorPath, selectorData) + } + +} -- 1.7.10.4