--- /dev/null
+/*
+ * 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")
+protocol AquariumConf {
+ enum EventVersion {
+ VERSION_1_0
+ }
+
+ record AnyValue {
+ union {
+ null,
+ int,
+ long,
+ boolean,
+ double,
+ bytes,
+ string
+ } anyValue;
+ }
+
+ record ResourceType {
+ string name;
+ string unit;
+ string chargingBehaviorClass;
+ }
+
+ record EffectivePriceTable {
+ }
+
+ record SelectorValue {
+ union {
+ EffectivePriceTable,
+ map<SelectorValue>
+ } selectorValue;
+ }
+
+ record FullPriceTable {
+ map<map<SelectorValue>> perResource;
+ }
+
+ record Policy {
+ string @aliases(["id, _id, idInStore, inStoreID"]) ID;
+ string parentID;
+ long validFromMillis;
+ long validToMillis;
+ array<ResourceType> resourceTypes;
+ array<string> chargingBehaviors;
+ map<FullPriceTable> roleMapping;
+ }
+}
\ No newline at end of file
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+
+@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\",\"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\":\"EffectivePriceTable\",\"fields\":[]},{\"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 {
+ public static final org.apache.avro.Protocol PROTOCOL = gr.grnet.aquarium.message.avro.AquariumConf.PROTOCOL;
+ }
+}
\ No newline at end of file
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+@SuppressWarnings("all")
+public class EffectivePriceTable 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\":\"EffectivePriceTable\",\"namespace\":\"gr.grnet.aquarium.message.avro\",\"fields\":[]}");
+ public org.apache.avro.Schema getSchema() { return SCHEMA$; }
+ // Used by DatumWriter. Applications should not call.
+ public java.lang.Object get(int field$) {
+ switch (field$) {
+ 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$) {
+ default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+ }
+ }
+
+ /** Creates a new EffectivePriceTable RecordBuilder */
+ public static gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder newBuilder() {
+ return new gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder();
+ }
+
+ /** Creates a new EffectivePriceTable RecordBuilder by copying an existing Builder */
+ public static gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder newBuilder(gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder other) {
+ return new gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder(other);
+ }
+
+ /** Creates a new EffectivePriceTable RecordBuilder by copying an existing EffectivePriceTable instance */
+ public static gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder newBuilder(gr.grnet.aquarium.message.avro.EffectivePriceTable other) {
+ return new gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder(other);
+ }
+
+ /**
+ * RecordBuilder for EffectivePriceTable instances.
+ */
+ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<EffectivePriceTable>
+ implements org.apache.avro.data.RecordBuilder<EffectivePriceTable> {
+
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(gr.grnet.aquarium.message.avro.EffectivePriceTable.SCHEMA$);
+ }
+
+ /** Creates a Builder by copying an existing Builder */
+ private Builder(gr.grnet.aquarium.message.avro.EffectivePriceTable.Builder other) {
+ super(other);
+ }
+
+ /** Creates a Builder by copying an existing EffectivePriceTable instance */
+ private Builder(gr.grnet.aquarium.message.avro.EffectivePriceTable other) {
+ super(gr.grnet.aquarium.message.avro.EffectivePriceTable.SCHEMA$);
+ }
+
+ @Override
+ public EffectivePriceTable build() {
+ try {
+ EffectivePriceTable record = new EffectivePriceTable();
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ }
+}
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+@SuppressWarnings("all")
+public class FullPriceTable 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\":\"FullPriceTable\",\"namespace\":\"gr.grnet.aquarium.message.avro\",\"fields\":[{\"name\":\"perResource\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"SelectorValue\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"EffectivePriceTable\",\"fields\":[]},{\"type\":\"map\",\"values\":\"SelectorValue\"}]}]}}}}]}");
+ @Deprecated public java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> perResource;
+ 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 perResource;
+ 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: perResource = (java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>>)value$; break;
+ default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+ }
+ }
+
+ /**
+ * Gets the value of the 'perResource' field.
+ */
+ public java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> getPerResource() {
+ return perResource;
+ }
+
+ /**
+ * Sets the value of the 'perResource' field.
+ * @param value the value to set.
+ */
+ public void setPerResource(java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> value) {
+ this.perResource = value;
+ }
+
+ /** Creates a new FullPriceTable RecordBuilder */
+ public static gr.grnet.aquarium.message.avro.FullPriceTable.Builder newBuilder() {
+ return new gr.grnet.aquarium.message.avro.FullPriceTable.Builder();
+ }
+
+ /** Creates a new FullPriceTable RecordBuilder by copying an existing Builder */
+ public static gr.grnet.aquarium.message.avro.FullPriceTable.Builder newBuilder(gr.grnet.aquarium.message.avro.FullPriceTable.Builder other) {
+ return new gr.grnet.aquarium.message.avro.FullPriceTable.Builder(other);
+ }
+
+ /** Creates a new FullPriceTable RecordBuilder by copying an existing FullPriceTable instance */
+ public static gr.grnet.aquarium.message.avro.FullPriceTable.Builder newBuilder(gr.grnet.aquarium.message.avro.FullPriceTable other) {
+ return new gr.grnet.aquarium.message.avro.FullPriceTable.Builder(other);
+ }
+
+ /**
+ * RecordBuilder for FullPriceTable instances.
+ */
+ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FullPriceTable>
+ implements org.apache.avro.data.RecordBuilder<FullPriceTable> {
+
+ private java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> perResource;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(gr.grnet.aquarium.message.avro.FullPriceTable.SCHEMA$);
+ }
+
+ /** Creates a Builder by copying an existing Builder */
+ private Builder(gr.grnet.aquarium.message.avro.FullPriceTable.Builder other) {
+ super(other);
+ }
+
+ /** Creates a Builder by copying an existing FullPriceTable instance */
+ private Builder(gr.grnet.aquarium.message.avro.FullPriceTable other) {
+ super(gr.grnet.aquarium.message.avro.FullPriceTable.SCHEMA$);
+ if (isValidValue(fields()[0], other.perResource)) {
+ this.perResource = (java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>>) data().deepCopy(fields()[0].schema(), other.perResource);
+ fieldSetFlags()[0] = true;
+ }
+ }
+
+ /** Gets the value of the 'perResource' field */
+ public java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> getPerResource() {
+ return perResource;
+ }
+
+ /** Sets the value of the 'perResource' field */
+ public gr.grnet.aquarium.message.avro.FullPriceTable.Builder setPerResource(java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>> value) {
+ validate(fields()[0], value);
+ this.perResource = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+
+ /** Checks whether the 'perResource' field has been set */
+ public boolean hasPerResource() {
+ return fieldSetFlags()[0];
+ }
+
+ /** Clears the value of the 'perResource' field */
+ public gr.grnet.aquarium.message.avro.FullPriceTable.Builder clearPerResource() {
+ perResource = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+
+ @Override
+ public FullPriceTable build() {
+ try {
+ FullPriceTable record = new FullPriceTable();
+ record.perResource = fieldSetFlags()[0] ? this.perResource : (java.util.Map<java.lang.CharSequence,java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.SelectorValue>>) defaultValue(fields()[0]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ }
+}
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+@SuppressWarnings("all")
+public class Policy 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\":\"Policy\",\"namespace\":\"gr.grnet.aquarium.message.avro\",\"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\":{\"type\":\"record\",\"name\":\"ResourceType\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}}},{\"name\":\"chargingBehaviors\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"roleMapping\",\"type\":{\"type\":\"map\",\"values\":{\"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\":[]},{\"type\":\"map\",\"values\":\"SelectorValue\"}]}]}}}}]}}}]}");
+ @Deprecated public java.lang.CharSequence ID;
+ @Deprecated public java.lang.CharSequence parentID;
+ @Deprecated public long validFromMillis;
+ @Deprecated public long validToMillis;
+ @Deprecated public java.util.List<gr.grnet.aquarium.message.avro.ResourceType> resourceTypes;
+ @Deprecated public java.util.List<java.lang.CharSequence> chargingBehaviors;
+ @Deprecated public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> roleMapping;
+ 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 parentID;
+ case 2: return validFromMillis;
+ case 3: return validToMillis;
+ case 4: return resourceTypes;
+ case 5: return chargingBehaviors;
+ case 6: return roleMapping;
+ 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: parentID = (java.lang.CharSequence)value$; break;
+ case 2: validFromMillis = (java.lang.Long)value$; break;
+ case 3: validToMillis = (java.lang.Long)value$; break;
+ case 4: resourceTypes = (java.util.List<gr.grnet.aquarium.message.avro.ResourceType>)value$; break;
+ case 5: chargingBehaviors = (java.util.List<java.lang.CharSequence>)value$; break;
+ case 6: roleMapping = (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.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 'parentID' field.
+ */
+ public java.lang.CharSequence getParentID() {
+ return parentID;
+ }
+
+ /**
+ * Sets the value of the 'parentID' field.
+ * @param value the value to set.
+ */
+ public void setParentID(java.lang.CharSequence value) {
+ this.parentID = 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 'resourceTypes' field.
+ */
+ public java.util.List<gr.grnet.aquarium.message.avro.ResourceType> getResourceTypes() {
+ return resourceTypes;
+ }
+
+ /**
+ * Sets the value of the 'resourceTypes' field.
+ * @param value the value to set.
+ */
+ public void setResourceTypes(java.util.List<gr.grnet.aquarium.message.avro.ResourceType> value) {
+ this.resourceTypes = value;
+ }
+
+ /**
+ * Gets the value of the 'chargingBehaviors' field.
+ */
+ public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
+ return chargingBehaviors;
+ }
+
+ /**
+ * Sets the value of the 'chargingBehaviors' field.
+ * @param value the value to set.
+ */
+ public void setChargingBehaviors(java.util.List<java.lang.CharSequence> value) {
+ this.chargingBehaviors = value;
+ }
+
+ /**
+ * Gets the value of the 'roleMapping' field.
+ */
+ public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> getRoleMapping() {
+ return roleMapping;
+ }
+
+ /**
+ * Sets the value of the 'roleMapping' field.
+ * @param value the value to set.
+ */
+ public void setRoleMapping(java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> value) {
+ this.roleMapping = value;
+ }
+
+ /** Creates a new Policy RecordBuilder */
+ public static gr.grnet.aquarium.message.avro.Policy.Builder newBuilder() {
+ return new gr.grnet.aquarium.message.avro.Policy.Builder();
+ }
+
+ /** Creates a new Policy RecordBuilder by copying an existing Builder */
+ public static gr.grnet.aquarium.message.avro.Policy.Builder newBuilder(gr.grnet.aquarium.message.avro.Policy.Builder other) {
+ return new gr.grnet.aquarium.message.avro.Policy.Builder(other);
+ }
+
+ /** Creates a new Policy RecordBuilder by copying an existing Policy instance */
+ public static gr.grnet.aquarium.message.avro.Policy.Builder newBuilder(gr.grnet.aquarium.message.avro.Policy other) {
+ return new gr.grnet.aquarium.message.avro.Policy.Builder(other);
+ }
+
+ /**
+ * RecordBuilder for Policy instances.
+ */
+ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Policy>
+ implements org.apache.avro.data.RecordBuilder<Policy> {
+
+ private java.lang.CharSequence ID;
+ private java.lang.CharSequence parentID;
+ private long validFromMillis;
+ private long validToMillis;
+ private java.util.List<gr.grnet.aquarium.message.avro.ResourceType> resourceTypes;
+ private java.util.List<java.lang.CharSequence> chargingBehaviors;
+ private java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> roleMapping;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(gr.grnet.aquarium.message.avro.Policy.SCHEMA$);
+ }
+
+ /** Creates a Builder by copying an existing Builder */
+ private Builder(gr.grnet.aquarium.message.avro.Policy.Builder other) {
+ super(other);
+ }
+
+ /** Creates a Builder by copying an existing Policy instance */
+ private Builder(gr.grnet.aquarium.message.avro.Policy other) {
+ super(gr.grnet.aquarium.message.avro.Policy.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.parentID)) {
+ this.parentID = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.parentID);
+ 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.resourceTypes)) {
+ this.resourceTypes = (java.util.List<gr.grnet.aquarium.message.avro.ResourceType>) data().deepCopy(fields()[4].schema(), other.resourceTypes);
+ fieldSetFlags()[4] = true;
+ }
+ if (isValidValue(fields()[5], other.chargingBehaviors)) {
+ this.chargingBehaviors = (java.util.List<java.lang.CharSequence>) data().deepCopy(fields()[5].schema(), other.chargingBehaviors);
+ fieldSetFlags()[5] = true;
+ }
+ if (isValidValue(fields()[6], other.roleMapping)) {
+ this.roleMapping = (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable>) data().deepCopy(fields()[6].schema(), other.roleMapping);
+ fieldSetFlags()[6] = 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.Policy.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.Policy.Builder clearID() {
+ ID = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'parentID' field */
+ public java.lang.CharSequence getParentID() {
+ return parentID;
+ }
+
+ /** Sets the value of the 'parentID' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder setParentID(java.lang.CharSequence value) {
+ validate(fields()[1], value);
+ this.parentID = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+
+ /** Checks whether the 'parentID' field has been set */
+ public boolean hasParentID() {
+ return fieldSetFlags()[1];
+ }
+
+ /** Clears the value of the 'parentID' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder clearParentID() {
+ parentID = 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.Policy.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.Policy.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.Policy.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.Policy.Builder clearValidToMillis() {
+ fieldSetFlags()[3] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'resourceTypes' field */
+ public java.util.List<gr.grnet.aquarium.message.avro.ResourceType> getResourceTypes() {
+ return resourceTypes;
+ }
+
+ /** Sets the value of the 'resourceTypes' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder setResourceTypes(java.util.List<gr.grnet.aquarium.message.avro.ResourceType> value) {
+ validate(fields()[4], value);
+ this.resourceTypes = value;
+ fieldSetFlags()[4] = true;
+ return this;
+ }
+
+ /** Checks whether the 'resourceTypes' field has been set */
+ public boolean hasResourceTypes() {
+ return fieldSetFlags()[4];
+ }
+
+ /** Clears the value of the 'resourceTypes' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder clearResourceTypes() {
+ resourceTypes = null;
+ fieldSetFlags()[4] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'chargingBehaviors' field */
+ public java.util.List<java.lang.CharSequence> getChargingBehaviors() {
+ return chargingBehaviors;
+ }
+
+ /** Sets the value of the 'chargingBehaviors' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder setChargingBehaviors(java.util.List<java.lang.CharSequence> value) {
+ validate(fields()[5], value);
+ this.chargingBehaviors = value;
+ fieldSetFlags()[5] = true;
+ return this;
+ }
+
+ /** Checks whether the 'chargingBehaviors' field has been set */
+ public boolean hasChargingBehaviors() {
+ return fieldSetFlags()[5];
+ }
+
+ /** Clears the value of the 'chargingBehaviors' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder clearChargingBehaviors() {
+ chargingBehaviors = null;
+ fieldSetFlags()[5] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'roleMapping' field */
+ public java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> getRoleMapping() {
+ return roleMapping;
+ }
+
+ /** Sets the value of the 'roleMapping' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder setRoleMapping(java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable> value) {
+ validate(fields()[6], value);
+ this.roleMapping = value;
+ fieldSetFlags()[6] = true;
+ return this;
+ }
+
+ /** Checks whether the 'roleMapping' field has been set */
+ public boolean hasRoleMapping() {
+ return fieldSetFlags()[6];
+ }
+
+ /** Clears the value of the 'roleMapping' field */
+ public gr.grnet.aquarium.message.avro.Policy.Builder clearRoleMapping() {
+ roleMapping = null;
+ fieldSetFlags()[6] = false;
+ return this;
+ }
+
+ @Override
+ public Policy build() {
+ try {
+ Policy record = new Policy();
+ record.ID = fieldSetFlags()[0] ? this.ID : (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.parentID = fieldSetFlags()[1] ? this.parentID : (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.resourceTypes = fieldSetFlags()[4] ? this.resourceTypes : (java.util.List<gr.grnet.aquarium.message.avro.ResourceType>) defaultValue(fields()[4]);
+ record.chargingBehaviors = fieldSetFlags()[5] ? this.chargingBehaviors : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[5]);
+ record.roleMapping = fieldSetFlags()[6] ? this.roleMapping : (java.util.Map<java.lang.CharSequence,gr.grnet.aquarium.message.avro.FullPriceTable>) defaultValue(fields()[6]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ }
+}
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+@SuppressWarnings("all")
+public class ResourceType 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\":\"ResourceType\",\"namespace\":\"gr.grnet.aquarium.message.avro\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"unit\",\"type\":\"string\"},{\"name\":\"chargingBehaviorClass\",\"type\":\"string\"}]}");
+ @Deprecated public java.lang.CharSequence name;
+ @Deprecated public java.lang.CharSequence unit;
+ @Deprecated public java.lang.CharSequence chargingBehaviorClass;
+ 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 name;
+ case 1: return unit;
+ case 2: return chargingBehaviorClass;
+ 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: name = (java.lang.CharSequence)value$; break;
+ case 1: unit = (java.lang.CharSequence)value$; break;
+ case 2: chargingBehaviorClass = (java.lang.CharSequence)value$; break;
+ default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+ }
+ }
+
+ /**
+ * Gets the value of the 'name' field.
+ */
+ public java.lang.CharSequence getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the 'name' field.
+ * @param value the value to set.
+ */
+ public void setName(java.lang.CharSequence value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the 'unit' field.
+ */
+ public java.lang.CharSequence getUnit() {
+ return unit;
+ }
+
+ /**
+ * Sets the value of the 'unit' field.
+ * @param value the value to set.
+ */
+ public void setUnit(java.lang.CharSequence value) {
+ this.unit = value;
+ }
+
+ /**
+ * Gets the value of the 'chargingBehaviorClass' field.
+ */
+ public java.lang.CharSequence getChargingBehaviorClass() {
+ return chargingBehaviorClass;
+ }
+
+ /**
+ * Sets the value of the 'chargingBehaviorClass' field.
+ * @param value the value to set.
+ */
+ public void setChargingBehaviorClass(java.lang.CharSequence value) {
+ this.chargingBehaviorClass = value;
+ }
+
+ /** Creates a new ResourceType RecordBuilder */
+ public static gr.grnet.aquarium.message.avro.ResourceType.Builder newBuilder() {
+ return new gr.grnet.aquarium.message.avro.ResourceType.Builder();
+ }
+
+ /** Creates a new ResourceType RecordBuilder by copying an existing Builder */
+ public static gr.grnet.aquarium.message.avro.ResourceType.Builder newBuilder(gr.grnet.aquarium.message.avro.ResourceType.Builder other) {
+ return new gr.grnet.aquarium.message.avro.ResourceType.Builder(other);
+ }
+
+ /** Creates a new ResourceType RecordBuilder by copying an existing ResourceType instance */
+ public static gr.grnet.aquarium.message.avro.ResourceType.Builder newBuilder(gr.grnet.aquarium.message.avro.ResourceType other) {
+ return new gr.grnet.aquarium.message.avro.ResourceType.Builder(other);
+ }
+
+ /**
+ * RecordBuilder for ResourceType instances.
+ */
+ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<ResourceType>
+ implements org.apache.avro.data.RecordBuilder<ResourceType> {
+
+ private java.lang.CharSequence name;
+ private java.lang.CharSequence unit;
+ private java.lang.CharSequence chargingBehaviorClass;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(gr.grnet.aquarium.message.avro.ResourceType.SCHEMA$);
+ }
+
+ /** Creates a Builder by copying an existing Builder */
+ private Builder(gr.grnet.aquarium.message.avro.ResourceType.Builder other) {
+ super(other);
+ }
+
+ /** Creates a Builder by copying an existing ResourceType instance */
+ private Builder(gr.grnet.aquarium.message.avro.ResourceType other) {
+ super(gr.grnet.aquarium.message.avro.ResourceType.SCHEMA$);
+ if (isValidValue(fields()[0], other.name)) {
+ this.name = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.name);
+ fieldSetFlags()[0] = true;
+ }
+ if (isValidValue(fields()[1], other.unit)) {
+ this.unit = (java.lang.CharSequence) data().deepCopy(fields()[1].schema(), other.unit);
+ fieldSetFlags()[1] = true;
+ }
+ if (isValidValue(fields()[2], other.chargingBehaviorClass)) {
+ this.chargingBehaviorClass = (java.lang.CharSequence) data().deepCopy(fields()[2].schema(), other.chargingBehaviorClass);
+ fieldSetFlags()[2] = true;
+ }
+ }
+
+ /** Gets the value of the 'name' field */
+ public java.lang.CharSequence getName() {
+ return name;
+ }
+
+ /** Sets the value of the 'name' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder setName(java.lang.CharSequence value) {
+ validate(fields()[0], value);
+ this.name = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+
+ /** Checks whether the 'name' field has been set */
+ public boolean hasName() {
+ return fieldSetFlags()[0];
+ }
+
+ /** Clears the value of the 'name' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder clearName() {
+ name = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'unit' field */
+ public java.lang.CharSequence getUnit() {
+ return unit;
+ }
+
+ /** Sets the value of the 'unit' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder setUnit(java.lang.CharSequence value) {
+ validate(fields()[1], value);
+ this.unit = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+
+ /** Checks whether the 'unit' field has been set */
+ public boolean hasUnit() {
+ return fieldSetFlags()[1];
+ }
+
+ /** Clears the value of the 'unit' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder clearUnit() {
+ unit = null;
+ fieldSetFlags()[1] = false;
+ return this;
+ }
+
+ /** Gets the value of the 'chargingBehaviorClass' field */
+ public java.lang.CharSequence getChargingBehaviorClass() {
+ return chargingBehaviorClass;
+ }
+
+ /** Sets the value of the 'chargingBehaviorClass' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder setChargingBehaviorClass(java.lang.CharSequence value) {
+ validate(fields()[2], value);
+ this.chargingBehaviorClass = value;
+ fieldSetFlags()[2] = true;
+ return this;
+ }
+
+ /** Checks whether the 'chargingBehaviorClass' field has been set */
+ public boolean hasChargingBehaviorClass() {
+ return fieldSetFlags()[2];
+ }
+
+ /** Clears the value of the 'chargingBehaviorClass' field */
+ public gr.grnet.aquarium.message.avro.ResourceType.Builder clearChargingBehaviorClass() {
+ chargingBehaviorClass = null;
+ fieldSetFlags()[2] = false;
+ return this;
+ }
+
+ @Override
+ public ResourceType build() {
+ try {
+ ResourceType record = new ResourceType();
+ record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.unit = fieldSetFlags()[1] ? this.unit : (java.lang.CharSequence) defaultValue(fields()[1]);
+ record.chargingBehaviorClass = fieldSetFlags()[2] ? this.chargingBehaviorClass : (java.lang.CharSequence) defaultValue(fields()[2]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ }
+}
--- /dev/null
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package gr.grnet.aquarium.message.avro;
+@SuppressWarnings("all")
+public class SelectorValue 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\":\"SelectorValue\",\"namespace\":\"gr.grnet.aquarium.message.avro\",\"fields\":[{\"name\":\"selectorValue\",\"type\":[{\"type\":\"record\",\"name\":\"EffectivePriceTable\",\"fields\":[]},{\"type\":\"map\",\"values\":\"SelectorValue\"}]}]}");
+ @Deprecated public java.lang.Object selectorValue;
+ 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 selectorValue;
+ 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: selectorValue = (java.lang.Object)value$; break;
+ default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+ }
+ }
+
+ /**
+ * Gets the value of the 'selectorValue' field.
+ */
+ public java.lang.Object getSelectorValue() {
+ return selectorValue;
+ }
+
+ /**
+ * Sets the value of the 'selectorValue' field.
+ * @param value the value to set.
+ */
+ public void setSelectorValue(java.lang.Object value) {
+ this.selectorValue = value;
+ }
+
+ /** Creates a new SelectorValue RecordBuilder */
+ public static gr.grnet.aquarium.message.avro.SelectorValue.Builder newBuilder() {
+ return new gr.grnet.aquarium.message.avro.SelectorValue.Builder();
+ }
+
+ /** Creates a new SelectorValue RecordBuilder by copying an existing Builder */
+ public static gr.grnet.aquarium.message.avro.SelectorValue.Builder newBuilder(gr.grnet.aquarium.message.avro.SelectorValue.Builder other) {
+ return new gr.grnet.aquarium.message.avro.SelectorValue.Builder(other);
+ }
+
+ /** Creates a new SelectorValue RecordBuilder by copying an existing SelectorValue instance */
+ public static gr.grnet.aquarium.message.avro.SelectorValue.Builder newBuilder(gr.grnet.aquarium.message.avro.SelectorValue other) {
+ return new gr.grnet.aquarium.message.avro.SelectorValue.Builder(other);
+ }
+
+ /**
+ * RecordBuilder for SelectorValue instances.
+ */
+ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<SelectorValue>
+ implements org.apache.avro.data.RecordBuilder<SelectorValue> {
+
+ private java.lang.Object selectorValue;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(gr.grnet.aquarium.message.avro.SelectorValue.SCHEMA$);
+ }
+
+ /** Creates a Builder by copying an existing Builder */
+ private Builder(gr.grnet.aquarium.message.avro.SelectorValue.Builder other) {
+ super(other);
+ }
+
+ /** Creates a Builder by copying an existing SelectorValue instance */
+ private Builder(gr.grnet.aquarium.message.avro.SelectorValue other) {
+ super(gr.grnet.aquarium.message.avro.SelectorValue.SCHEMA$);
+ if (isValidValue(fields()[0], other.selectorValue)) {
+ this.selectorValue = (java.lang.Object) data().deepCopy(fields()[0].schema(), other.selectorValue);
+ fieldSetFlags()[0] = true;
+ }
+ }
+
+ /** Gets the value of the 'selectorValue' field */
+ public java.lang.Object getSelectorValue() {
+ return selectorValue;
+ }
+
+ /** Sets the value of the 'selectorValue' field */
+ public gr.grnet.aquarium.message.avro.SelectorValue.Builder setSelectorValue(java.lang.Object value) {
+ validate(fields()[0], value);
+ this.selectorValue = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+
+ /** Checks whether the 'selectorValue' field has been set */
+ public boolean hasSelectorValue() {
+ return fieldSetFlags()[0];
+ }
+
+ /** Clears the value of the 'selectorValue' field */
+ public gr.grnet.aquarium.message.avro.SelectorValue.Builder clearSelectorValue() {
+ selectorValue = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+
+ @Override
+ public SelectorValue build() {
+ try {
+ SelectorValue record = new SelectorValue();
+ record.selectorValue = fieldSetFlags()[0] ? this.selectorValue : (java.lang.Object) defaultValue(fields()[0]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ }
+}