From 059bbea748df2f7a5173d6b66299f52b77ca5b99 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Tue, 4 Feb 2020 12:02:03 +0100 Subject: [PATCH 1/7] alert for epoch rewards distribution --- .../monitoring/stream/EventProcessor.java | 9 +++++ .../monitoring/stream/EventStreamManager.java | 3 ++ .../keyko/monitoring/EventProcessorTest.java | 34 +++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index 7c8870d..f448409 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -6,6 +6,8 @@ import net.consensys.eventeum.BlockEvent; import net.consensys.eventeum.ContractEvent; import net.consensys.eventeum.EventBlock; +import net.consensys.eventeum.NumberParameter; +import net.consensys.eventeum.StringParameter; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.common.utils.Bytes; @@ -146,4 +148,11 @@ private KStream formatAccountCreatedAggregati }); } + + public void alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { + builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) + .filter((key, event) -> ((NumberParameter) event.getDetails().getNonIndexedParameters().get(0)).getValue().equals("0")) + .foreach((x, y) -> System.out.println("NoEpochRewardsDistributed for group: " + ((StringParameter) y.getDetails().getIndexedParameters().get(0)).getValue())); + } + } diff --git a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java index fbad796..af5ff1c 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java +++ b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java @@ -18,6 +18,7 @@ import org.apache.kafka.streams.kstream.KTable; import org.apache.kafka.streams.kstream.Produced; +import java.lang.reflect.Array; import java.util.*; public class EventStreamManager implements EventSerdes { @@ -99,6 +100,8 @@ private KafkaStreams createStreams() { KStream accountsCreatedDayStream = eventProcessor.accountDailyAggregation(accountsTopics, builder, eventBlockAvroSerde); accountsCreatedDayStream.to(configuration.getAccountsAggregationTopic(), Produced.with(Serdes.String(), new JsonPOJOSerde(AccountCreatedAggregation.class))); + eventProcessor.alertNoEpochRewardsDistributed(builder, Collections.singletonList("EpochRewardsDistributedToVoters".toLowerCase()),eventBlockAvroSerde); + return new KafkaStreams(builder.build(), this.getStreamConfiguration()); } diff --git a/src/test/java/io/keyko/monitoring/EventProcessorTest.java b/src/test/java/io/keyko/monitoring/EventProcessorTest.java index 846d46e..b671bdb 100644 --- a/src/test/java/io/keyko/monitoring/EventProcessorTest.java +++ b/src/test/java/io/keyko/monitoring/EventProcessorTest.java @@ -54,6 +54,26 @@ public class EventProcessorTest { public EventBlock oracleReportedEventWithBlock = new EventBlock("0x27bc3eda4e3eaae838dd44f4a9fd4564f4455c51e336daa4232afd4ea190f0f1-0x73090d8e7bb7b2a2b550474c2c90e8059d9bfdcd752c5fc55af18f54debfb88d-0", "", oracleReportedDetails, blockOracleReportedDetails, 0); + public ContractEventDetails epochrewardsdistributedtovotersDetails = new ContractEventDetails("EpochRewardsDistributedToVoters", "EpochRewardsDistributedToVoters", "default", + Collections.singletonList(new StringParameter("group", "address", "VG3")), + Collections.singletonList(new NumberParameter("value", "uint256", "0")), "0x294d73910e7c1e7cd8f0bf341e513c0269a089b36c22c2ac006269eb59e6e6be", + "0", "43", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "0xC03c31f91b893317C786AB6b6A2a6BdD61db9c55", ContractEventStatus.CONFIRMED, + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "default", + "43"); + public BlockDetails blockEpochrewardsdistributedtovotersDetails = new BlockDetails("43", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "1234", "default"); + public EventBlock epochrewardsdistributedtovotersEventWithBlock = new EventBlock("43", "", epochrewardsdistributedtovotersDetails, blockEpochrewardsdistributedtovotersDetails, 0); + + public ContractEventDetails epochrewardsdistributedtovotersDetails1 = new ContractEventDetails("EpochRewardsDistributedToVoters", "EpochRewardsDistributedToVoters", "default", + Collections.singletonList(new StringParameter("group", "address", "VG3")), + Collections.singletonList(new NumberParameter("value", "uint256", "3")), "0x294d73910e7c1e7cd8f0bf341e513c0269a089b36c22c2ac006269eb59e6e6be", + "0", "45", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "0xC03c31f91b893317C786AB6b6A2a6BdD61db9c55", ContractEventStatus.CONFIRMED, + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "default", + "45"); + public BlockDetails blockEpochrewardsdistributedtovotersDetails1 = new BlockDetails("45", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "1234", "default"); + public EventBlock epochrewardsdistributedtovotersEventWithBlock1 = new EventBlock("45", "", epochrewardsdistributedtovotersDetails1, blockEpochrewardsdistributedtovotersDetails1, 0); + + + final Serde eventAvroSerde = new SpecificAvroSerde<>(); final Serde blockAvroSerde = new SpecificAvroSerde(); final Serde eventBlockAvroSerde = new SpecificAvroSerde<>(); @@ -121,4 +141,18 @@ public void splitConfirmedTopics() { assertEquals(oracleReportedTopic.readValue().getId(), oracleReportedEventWithBlock.getId()); driver.close(); } + + @Test + public void shouldReleaseAlertWhenRewardsAreZero() { + new EventProcessor().alertNoEpochRewardsDistributed(builder, Collections.singletonList("epochrewardsdistributedtovoters"), eventBlockAvroSerde); + Topology topology = builder.build(); + TopologyTestDriver driver = new TopologyTestDriver(topology, config); + TestInputTopic inputTopicValidatorRegistered = driver.createInputTopic("epochrewardsdistributedtovoters", new StringSerializer(), eventBlockAvroSerde.serializer()); + inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock.getId(), epochrewardsdistributedtovotersEventWithBlock); + inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock1.getId(), epochrewardsdistributedtovotersEventWithBlock1); + + driver.close(); + + } + } From bebcda9bf50744d06d4e43f5d5b9a4fa8c85259e Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Tue, 4 Feb 2020 14:31:26 +0100 Subject: [PATCH 2/7] Send alert into a topic --- src/main/java/io/keyko/monitoring/stream/EventProcessor.java | 3 ++- .../java/io/keyko/monitoring/stream/EventStreamManager.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index f448409..6d34015 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -152,7 +152,8 @@ private KStream formatAccountCreatedAggregati public void alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) .filter((key, event) -> ((NumberParameter) event.getDetails().getNonIndexedParameters().get(0)).getValue().equals("0")) - .foreach((x, y) -> System.out.println("NoEpochRewardsDistributed for group: " + ((StringParameter) y.getDetails().getIndexedParameters().get(0)).getValue())); + .to("w3m-alerts"); +// .foreach((x, y) -> System.out.println("NoEpochRewardsDistributed for group: " + ((StringParameter) y.getDetails().getIndexedParameters().get(0)).getValue())); } } diff --git a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java index af5ff1c..5fba620 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java +++ b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java @@ -18,7 +18,6 @@ import org.apache.kafka.streams.kstream.KTable; import org.apache.kafka.streams.kstream.Produced; -import java.lang.reflect.Array; import java.util.*; public class EventStreamManager implements EventSerdes { From 2b12adc50056c7e7415313f03958c45d117a2c53 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Tue, 4 Feb 2020 16:55:57 +0100 Subject: [PATCH 3/7] Send the alerts to a topic using the alerts schema --- .../monitoring/config/StreamerConfig.java | 11 + .../keyko/monitoring/schemas/AlertEvent.java | 628 ++++++++++++++++ .../monitoring/schemas/AlertEventStatus.java | 13 + .../monitoring/schemas}/BlockDetails.java | 275 +++---- .../keyko/monitoring/schemas}/BlockEvent.java | 315 ++++---- .../monitoring/schemas}/ContractEvent.java | 254 +++---- .../schemas}/ContractEventDetails.java | 642 +++++++--------- .../schemas/ContractEventStatus.java | 13 + .../keyko/monitoring/schemas}/EventBlock.java | 316 ++++---- .../monitoring/schemas}/NumberParameter.java | 229 +++--- .../monitoring/schemas}/StringParameter.java | 229 +++--- .../schemas}/TransactionDetails.java | 703 ++++++++---------- .../monitoring/schemas}/TransactionEvent.java | 315 ++++---- .../monitoring/schemas/TransactionStatus.java | 13 + .../keyko/monitoring/serde/EventSerdes.java | 8 +- .../monitoring/stream/EventProcessor.java | 22 +- .../monitoring/stream/EventStreamManager.java | 11 +- .../time/EventBlockTimestampExtractor.java | 2 +- .../eventeum/ContractEventStatus.java | 20 - .../consensys/eventeum/TransactionStatus.java | 20 - .../keyko/monitoring/EventProcessorTest.java | 11 +- src/test/resources/application.conf | 3 +- 22 files changed, 2174 insertions(+), 1879 deletions(-) create mode 100644 src/main/java/io/keyko/monitoring/schemas/AlertEvent.java create mode 100644 src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/BlockDetails.java (63%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/BlockEvent.java (60%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/ContractEvent.java (56%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/ContractEventDetails.java (61%) create mode 100644 src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/EventBlock.java (55%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/NumberParameter.java (64%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/StringParameter.java (65%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/TransactionDetails.java (60%) rename src/main/java/{net/consensys/eventeum => io/keyko/monitoring/schemas}/TransactionEvent.java (58%) create mode 100644 src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java delete mode 100644 src/main/java/net/consensys/eventeum/ContractEventStatus.java delete mode 100644 src/main/java/net/consensys/eventeum/TransactionStatus.java diff --git a/src/main/java/io/keyko/monitoring/config/StreamerConfig.java b/src/main/java/io/keyko/monitoring/config/StreamerConfig.java index 70f84d7..6a0729a 100644 --- a/src/main/java/io/keyko/monitoring/config/StreamerConfig.java +++ b/src/main/java/io/keyko/monitoring/config/StreamerConfig.java @@ -11,6 +11,7 @@ public class StreamerConfig { private static final String EVENT_BLOCK_TOPIC = "kafka.event-block-topic"; private static final String FLAT_EVENT_TOPIC = "kafka.flat-event-topic"; private static final String ACCOUNTS_AGGREGATION_TOPIC = "kafka.accounts-aggregation-topic"; + private static final String ALERTS_TOPIC = "kafka.alerts-topic"; private StreamerConfig() { @@ -23,6 +24,7 @@ private StreamerConfig() { private String eventBlockTopic; private String flatEventTopic; private String accountsAggregationTopic; + private String alertsTopic; private static StreamerConfig streamerConfig; @@ -41,6 +43,7 @@ public static StreamerConfig getInstance(Config config) { streamerConfig.setEventBlockTopic(config.getString(EVENT_BLOCK_TOPIC)); streamerConfig.setFlatEventTopic(config.getString(FLAT_EVENT_TOPIC)); streamerConfig.setAccountsAggregationTopic(config.getString(ACCOUNTS_AGGREGATION_TOPIC)); + streamerConfig.setAlertsTopic(config.getString(ALERTS_TOPIC)); return streamerConfig; @@ -104,4 +107,12 @@ public void setAccountsAggregationTopic(String accountsAggregationTopic) { this.accountsAggregationTopic = accountsAggregationTopic; } + public String getAlertsTopic() { + return alertsTopic; + } + + public void setAlertsTopic(String alertsTopic) { + this.alertsTopic = alertsTopic; + } + } diff --git a/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java b/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java new file mode 100644 index 0000000..0978bf0 --- /dev/null +++ b/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java @@ -0,0 +1,628 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package io.keyko.monitoring.schemas; + +import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.message.BinaryMessageEncoder; +import org.apache.avro.message.SchemaStore; +import org.apache.avro.specific.SpecificData; + +@org.apache.avro.specific.AvroGenerated +public class AlertEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + private static final long serialVersionUID = -202773870068325002L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AlertEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"reference\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"AlertEventStatus\",\"symbols\":[\"FATAL\",\"ERROR\",\"WARNING\",\"INFO\",\"DEBUG\"]}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"description\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + + private static SpecificData MODEL$ = new SpecificData(); + + private static final BinaryMessageEncoder ENCODER = + new BinaryMessageEncoder(MODEL$, SCHEMA$); + + private static final BinaryMessageDecoder DECODER = + new BinaryMessageDecoder(MODEL$, SCHEMA$); + + /** + * Return the BinaryMessageEncoder instance used by this class. + * @return the message encoder used by this class + */ + public static BinaryMessageEncoder getEncoder() { + return ENCODER; + } + + /** + * Return the BinaryMessageDecoder instance used by this class. + * @return the message decoder used by this class + */ + public static BinaryMessageDecoder getDecoder() { + return DECODER; + } + + /** + * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. + * @param resolver a {@link SchemaStore} used to find schemas by fingerprint + * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore + */ + public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { + return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); + } + + /** + * Serializes this AlertEvent to a ByteBuffer. + * @return a buffer holding the serialized data for this instance + * @throws java.io.IOException if this instance could not be serialized + */ + public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { + return ENCODER.encode(this); + } + + /** + * Deserializes a AlertEvent from a ByteBuffer. + * @param b a byte buffer holding serialized data for an instance of this class + * @return a AlertEvent instance decoded from the given buffer + * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class + */ + public static AlertEvent fromByteBuffer( + java.nio.ByteBuffer b) throws java.io.IOException { + return DECODER.decode(b); + } + + @Deprecated public String name; + @Deprecated public String reference; + @Deprecated public io.keyko.monitoring.schemas.AlertEventStatus status; + @Deprecated public String timestamp; + @Deprecated public String description; + + /** + * Default constructor. Note that this does not initialize fields + * to their default values from the schema. If that is desired then + * one should use newBuilder(). + */ + public AlertEvent() {} + + /** + * All-args constructor. + * @param name The new value for name + * @param reference The new value for reference + * @param status The new value for status + * @param timestamp The new value for timestamp + * @param description The new value for description + */ + public AlertEvent(String name, String reference, io.keyko.monitoring.schemas.AlertEventStatus status, String timestamp, String description) { + this.name = name; + this.reference = reference; + this.status = status; + this.timestamp = timestamp; + this.description = description; + } + + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } + // Used by DatumWriter. Applications should not call. + public Object get(int field$) { + switch (field$) { + case 0: return name; + case 1: return reference; + case 2: return status; + case 3: return timestamp; + case 4: return description; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value="unchecked") + public void put(int field$, Object value$) { + switch (field$) { + case 0: name = (String)value$; break; + case 1: reference = (String)value$; break; + case 2: status = (io.keyko.monitoring.schemas.AlertEventStatus)value$; break; + case 3: timestamp = (String)value$; break; + case 4: description = (String)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); + } + } + + /** + * Gets the value of the 'name' field. + * @return The value of the 'name' field. + */ + public String getName() { + return name; + } + + + /** + * Sets the value of the 'name' field. + * @param value the value to set. + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the 'reference' field. + * @return The value of the 'reference' field. + */ + public String getReference() { + return reference; + } + + + /** + * Sets the value of the 'reference' field. + * @param value the value to set. + */ + public void setReference(String value) { + this.reference = value; + } + + /** + * Gets the value of the 'status' field. + * @return The value of the 'status' field. + */ + public io.keyko.monitoring.schemas.AlertEventStatus getStatus() { + return status; + } + + + /** + * Sets the value of the 'status' field. + * @param value the value to set. + */ + public void setStatus(io.keyko.monitoring.schemas.AlertEventStatus value) { + this.status = value; + } + + /** + * Gets the value of the 'timestamp' field. + * @return The value of the 'timestamp' field. + */ + public String getTimestamp() { + return timestamp; + } + + + /** + * Sets the value of the 'timestamp' field. + * @param value the value to set. + */ + public void setTimestamp(String value) { + this.timestamp = value; + } + + /** + * Gets the value of the 'description' field. + * @return The value of the 'description' field. + */ + public String getDescription() { + return description; + } + + + /** + * Sets the value of the 'description' field. + * @param value the value to set. + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Creates a new AlertEvent RecordBuilder. + * @return A new AlertEvent RecordBuilder + */ + public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder() { + return new io.keyko.monitoring.schemas.AlertEvent.Builder(); + } + + /** + * Creates a new AlertEvent RecordBuilder by copying an existing Builder. + * @param other The existing builder to copy. + * @return A new AlertEvent RecordBuilder + */ + public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder(io.keyko.monitoring.schemas.AlertEvent.Builder other) { + if (other == null) { + return new io.keyko.monitoring.schemas.AlertEvent.Builder(); + } else { + return new io.keyko.monitoring.schemas.AlertEvent.Builder(other); + } + } + + /** + * Creates a new AlertEvent RecordBuilder by copying an existing AlertEvent instance. + * @param other The existing instance to copy. + * @return A new AlertEvent RecordBuilder + */ + public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder(io.keyko.monitoring.schemas.AlertEvent other) { + if (other == null) { + return new io.keyko.monitoring.schemas.AlertEvent.Builder(); + } else { + return new io.keyko.monitoring.schemas.AlertEvent.Builder(other); + } + } + + /** + * RecordBuilder for AlertEvent instances. + */ + public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase + implements org.apache.avro.data.RecordBuilder { + + private String name; + private String reference; + private io.keyko.monitoring.schemas.AlertEventStatus status; + private String timestamp; + private String description; + + /** Creates a new Builder */ + private Builder() { + super(SCHEMA$); + } + + /** + * Creates a Builder by copying an existing Builder. + * @param other The existing Builder to copy. + */ + private Builder(io.keyko.monitoring.schemas.AlertEvent.Builder other) { + super(other); + if (isValidValue(fields()[0], other.name)) { + this.name = data().deepCopy(fields()[0].schema(), other.name); + fieldSetFlags()[0] = other.fieldSetFlags()[0]; + } + if (isValidValue(fields()[1], other.reference)) { + this.reference = data().deepCopy(fields()[1].schema(), other.reference); + fieldSetFlags()[1] = other.fieldSetFlags()[1]; + } + if (isValidValue(fields()[2], other.status)) { + this.status = data().deepCopy(fields()[2].schema(), other.status); + fieldSetFlags()[2] = other.fieldSetFlags()[2]; + } + if (isValidValue(fields()[3], other.timestamp)) { + this.timestamp = data().deepCopy(fields()[3].schema(), other.timestamp); + fieldSetFlags()[3] = other.fieldSetFlags()[3]; + } + if (isValidValue(fields()[4], other.description)) { + this.description = data().deepCopy(fields()[4].schema(), other.description); + fieldSetFlags()[4] = other.fieldSetFlags()[4]; + } + } + + /** + * Creates a Builder by copying an existing AlertEvent instance + * @param other The existing instance to copy. + */ + private Builder(io.keyko.monitoring.schemas.AlertEvent other) { + super(SCHEMA$); + if (isValidValue(fields()[0], other.name)) { + this.name = data().deepCopy(fields()[0].schema(), other.name); + fieldSetFlags()[0] = true; + } + if (isValidValue(fields()[1], other.reference)) { + this.reference = data().deepCopy(fields()[1].schema(), other.reference); + fieldSetFlags()[1] = true; + } + if (isValidValue(fields()[2], other.status)) { + this.status = data().deepCopy(fields()[2].schema(), other.status); + fieldSetFlags()[2] = true; + } + if (isValidValue(fields()[3], other.timestamp)) { + this.timestamp = data().deepCopy(fields()[3].schema(), other.timestamp); + fieldSetFlags()[3] = true; + } + if (isValidValue(fields()[4], other.description)) { + this.description = data().deepCopy(fields()[4].schema(), other.description); + fieldSetFlags()[4] = true; + } + } + + /** + * Gets the value of the 'name' field. + * @return The value. + */ + public String getName() { + return name; + } + + + /** + * Sets the value of the 'name' field. + * @param value The value of 'name'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder setName(String value) { + validate(fields()[0], value); + this.name = value; + fieldSetFlags()[0] = true; + return this; + } + + /** + * Checks whether the 'name' field has been set. + * @return True if the 'name' field has been set, false otherwise. + */ + public boolean hasName() { + return fieldSetFlags()[0]; + } + + + /** + * Clears the value of the 'name' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder clearName() { + name = null; + fieldSetFlags()[0] = false; + return this; + } + + /** + * Gets the value of the 'reference' field. + * @return The value. + */ + public String getReference() { + return reference; + } + + + /** + * Sets the value of the 'reference' field. + * @param value The value of 'reference'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder setReference(String value) { + validate(fields()[1], value); + this.reference = value; + fieldSetFlags()[1] = true; + return this; + } + + /** + * Checks whether the 'reference' field has been set. + * @return True if the 'reference' field has been set, false otherwise. + */ + public boolean hasReference() { + return fieldSetFlags()[1]; + } + + + /** + * Clears the value of the 'reference' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder clearReference() { + reference = null; + fieldSetFlags()[1] = false; + return this; + } + + /** + * Gets the value of the 'status' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.AlertEventStatus getStatus() { + return status; + } + + + /** + * Sets the value of the 'status' field. + * @param value The value of 'status'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder setStatus(io.keyko.monitoring.schemas.AlertEventStatus value) { + validate(fields()[2], value); + this.status = value; + fieldSetFlags()[2] = true; + return this; + } + + /** + * Checks whether the 'status' field has been set. + * @return True if the 'status' field has been set, false otherwise. + */ + public boolean hasStatus() { + return fieldSetFlags()[2]; + } + + + /** + * Clears the value of the 'status' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder clearStatus() { + status = null; + fieldSetFlags()[2] = false; + return this; + } + + /** + * Gets the value of the 'timestamp' field. + * @return The value. + */ + public String getTimestamp() { + return timestamp; + } + + + /** + * Sets the value of the 'timestamp' field. + * @param value The value of 'timestamp'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder setTimestamp(String value) { + validate(fields()[3], value); + this.timestamp = value; + fieldSetFlags()[3] = true; + return this; + } + + /** + * Checks whether the 'timestamp' field has been set. + * @return True if the 'timestamp' field has been set, false otherwise. + */ + public boolean hasTimestamp() { + return fieldSetFlags()[3]; + } + + + /** + * Clears the value of the 'timestamp' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder clearTimestamp() { + timestamp = null; + fieldSetFlags()[3] = false; + return this; + } + + /** + * Gets the value of the 'description' field. + * @return The value. + */ + public String getDescription() { + return description; + } + + + /** + * Sets the value of the 'description' field. + * @param value The value of 'description'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder setDescription(String value) { + validate(fields()[4], value); + this.description = value; + fieldSetFlags()[4] = true; + return this; + } + + /** + * Checks whether the 'description' field has been set. + * @return True if the 'description' field has been set, false otherwise. + */ + public boolean hasDescription() { + return fieldSetFlags()[4]; + } + + + /** + * Clears the value of the 'description' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.AlertEvent.Builder clearDescription() { + description = null; + fieldSetFlags()[4] = false; + return this; + } + + @Override + @SuppressWarnings("unchecked") + public AlertEvent build() { + try { + AlertEvent record = new AlertEvent(); + record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); + record.reference = fieldSetFlags()[1] ? this.reference : (String) defaultValue(fields()[1]); + record.status = fieldSetFlags()[2] ? this.status : (io.keyko.monitoring.schemas.AlertEventStatus) defaultValue(fields()[2]); + record.timestamp = fieldSetFlags()[3] ? this.timestamp : (String) defaultValue(fields()[3]); + record.description = fieldSetFlags()[4] ? this.description : (String) defaultValue(fields()[4]); + return record; + } catch (org.apache.avro.AvroMissingFieldException e) { + throw e; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumWriter + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); + + @Override public void writeExternal(java.io.ObjectOutput out) + throws java.io.IOException { + WRITER$.write(this, SpecificData.getEncoder(out)); + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumReader + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); + + @Override public void readExternal(java.io.ObjectInput in) + throws java.io.IOException { + READER$.read(this, SpecificData.getDecoder(in)); + } + + @Override protected boolean hasCustomCoders() { return true; } + + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { + out.writeString(this.name); + + out.writeString(this.reference); + + out.writeEnum(this.status.ordinal()); + + out.writeString(this.timestamp); + + out.writeString(this.description); + + } + + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { + org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); + if (fieldOrder == null) { + this.name = in.readString(); + + this.reference = in.readString(); + + this.status = io.keyko.monitoring.schemas.AlertEventStatus.values()[in.readEnum()]; + + this.timestamp = in.readString(); + + this.description = in.readString(); + + } else { + for (int i = 0; i < 5; i++) { + switch (fieldOrder[i].pos()) { + case 0: + this.name = in.readString(); + break; + + case 1: + this.reference = in.readString(); + break; + + case 2: + this.status = io.keyko.monitoring.schemas.AlertEventStatus.values()[in.readEnum()]; + break; + + case 3: + this.timestamp = in.readString(); + break; + + case 4: + this.description = in.readString(); + break; + + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); + } + } + } + } +} + + + + + + + + + + diff --git a/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java b/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java new file mode 100644 index 0000000..4ac0524 --- /dev/null +++ b/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java @@ -0,0 +1,13 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package io.keyko.monitoring.schemas; +@org.apache.avro.specific.AvroGenerated +public enum AlertEventStatus implements org.apache.avro.generic.GenericEnumSymbol { + FATAL, ERROR, WARNING, INFO, DEBUG ; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"AlertEventStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"FATAL\",\"ERROR\",\"WARNING\",\"INFO\",\"DEBUG\"]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } +} diff --git a/src/main/java/net/consensys/eventeum/BlockDetails.java b/src/main/java/io/keyko/monitoring/schemas/BlockDetails.java similarity index 63% rename from src/main/java/net/consensys/eventeum/BlockDetails.java rename to src/main/java/io/keyko/monitoring/schemas/BlockDetails.java index 55441e2..edd865e 100644 --- a/src/main/java/net/consensys/eventeum/BlockDetails.java +++ b/src/main/java/io/keyko/monitoring/schemas/BlockDetails.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class BlockDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 6934724161586224901L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = 6955880457069237337L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,26 +65,21 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static BlockDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String number; - @Deprecated - public String hash; - @Deprecated - public String timestamp; - @Deprecated - public String nodeName; + @Deprecated public String number; + @Deprecated public String hash; + @Deprecated public String timestamp; + @Deprecated public String nodeName; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public BlockDetails() { - } + public BlockDetails() {} /** * All-args constructor. @@ -103,48 +95,28 @@ public BlockDetails(String number, String hash, String timestamp, String nodeNam this.nodeName = nodeName; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return number; - case 1: - return hash; - case 2: - return timestamp; - case 3: - return nodeName; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return number; + case 1: return hash; + case 2: return timestamp; + case 3: return nodeName; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - number = (String) value$; - break; - case 1: - hash = (String) value$; - break; - case 2: - timestamp = (String) value$; - break; - case 3: - nodeName = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: number = (String)value$; break; + case 1: hash = (String)value$; break; + case 2: timestamp = (String)value$; break; + case 3: nodeName = (String)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -220,8 +192,8 @@ public void setNodeName(String value) { * Creates a new BlockDetails RecordBuilder. * @return A new BlockDetails RecordBuilder */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder() { - return new net.consensys.eventeum.BlockDetails.Builder(); + public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder() { + return new io.keyko.monitoring.schemas.BlockDetails.Builder(); } /** @@ -229,11 +201,11 @@ public static net.consensys.eventeum.BlockDetails.Builder newBuilder() { * @param other The existing builder to copy. * @return A new BlockDetails RecordBuilder */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder(net.consensys.eventeum.BlockDetails.Builder other) { + public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder other) { if (other == null) { - return new net.consensys.eventeum.BlockDetails.Builder(); + return new io.keyko.monitoring.schemas.BlockDetails.Builder(); } else { - return new net.consensys.eventeum.BlockDetails.Builder(other); + return new io.keyko.monitoring.schemas.BlockDetails.Builder(other); } } @@ -242,11 +214,11 @@ public static net.consensys.eventeum.BlockDetails.Builder newBuilder(net.consens * @param other The existing instance to copy. * @return A new BlockDetails RecordBuilder */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder(net.consensys.eventeum.BlockDetails other) { + public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder(io.keyko.monitoring.schemas.BlockDetails other) { if (other == null) { - return new net.consensys.eventeum.BlockDetails.Builder(); + return new io.keyko.monitoring.schemas.BlockDetails.Builder(); } else { - return new net.consensys.eventeum.BlockDetails.Builder(other); + return new io.keyko.monitoring.schemas.BlockDetails.Builder(other); } } @@ -270,7 +242,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.BlockDetails.Builder other) { + private Builder(io.keyko.monitoring.schemas.BlockDetails.Builder other) { super(other); if (isValidValue(fields()[0], other.number)) { this.number = data().deepCopy(fields()[0].schema(), other.number); @@ -294,7 +266,7 @@ private Builder(net.consensys.eventeum.BlockDetails.Builder other) { * Creates a Builder by copying an existing BlockDetails instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.BlockDetails other) { + private Builder(io.keyko.monitoring.schemas.BlockDetails other) { super(SCHEMA$); if (isValidValue(fields()[0], other.number)) { this.number = data().deepCopy(fields()[0].schema(), other.number); @@ -315,20 +287,20 @@ private Builder(net.consensys.eventeum.BlockDetails other) { } /** - * Gets the value of the 'number' field. - * @return The value. - */ + * Gets the value of the 'number' field. + * @return The value. + */ public String getNumber() { return number; } /** - * Sets the value of the 'number' field. - * @param value The value of 'number'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setNumber(String value) { + * Sets the value of the 'number' field. + * @param value The value of 'number'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder setNumber(String value) { validate(fields()[0], value); this.number = value; fieldSetFlags()[0] = true; @@ -336,39 +308,39 @@ public net.consensys.eventeum.BlockDetails.Builder setNumber(String value) { } /** - * Checks whether the 'number' field has been set. - * @return True if the 'number' field has been set, false otherwise. - */ + * Checks whether the 'number' field has been set. + * @return True if the 'number' field has been set, false otherwise. + */ public boolean hasNumber() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'number' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearNumber() { + * Clears the value of the 'number' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder clearNumber() { number = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'hash' field. - * @return The value. - */ + * Gets the value of the 'hash' field. + * @return The value. + */ public String getHash() { return hash; } /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setHash(String value) { + * Sets the value of the 'hash' field. + * @param value The value of 'hash'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder setHash(String value) { validate(fields()[1], value); this.hash = value; fieldSetFlags()[1] = true; @@ -376,39 +348,39 @@ public net.consensys.eventeum.BlockDetails.Builder setHash(String value) { } /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ + * Checks whether the 'hash' field has been set. + * @return True if the 'hash' field has been set, false otherwise. + */ public boolean hasHash() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearHash() { + * Clears the value of the 'hash' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder clearHash() { hash = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'timestamp' field. - * @return The value. - */ + * Gets the value of the 'timestamp' field. + * @return The value. + */ public String getTimestamp() { return timestamp; } /** - * Sets the value of the 'timestamp' field. - * @param value The value of 'timestamp'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setTimestamp(String value) { + * Sets the value of the 'timestamp' field. + * @param value The value of 'timestamp'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder setTimestamp(String value) { validate(fields()[2], value); this.timestamp = value; fieldSetFlags()[2] = true; @@ -416,39 +388,39 @@ public net.consensys.eventeum.BlockDetails.Builder setTimestamp(String value) { } /** - * Checks whether the 'timestamp' field has been set. - * @return True if the 'timestamp' field has been set, false otherwise. - */ + * Checks whether the 'timestamp' field has been set. + * @return True if the 'timestamp' field has been set, false otherwise. + */ public boolean hasTimestamp() { return fieldSetFlags()[2]; } /** - * Clears the value of the 'timestamp' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearTimestamp() { + * Clears the value of the 'timestamp' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder clearTimestamp() { timestamp = null; fieldSetFlags()[2] = false; return this; } /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ + * Gets the value of the 'nodeName' field. + * @return The value. + */ public String getNodeName() { return nodeName; } /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setNodeName(String value) { + * Sets the value of the 'nodeName' field. + * @param value The value of 'nodeName'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder setNodeName(String value) { validate(fields()[3], value); this.nodeName = value; fieldSetFlags()[3] = true; @@ -456,19 +428,19 @@ public net.consensys.eventeum.BlockDetails.Builder setNodeName(String value) { } /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ + * Checks whether the 'nodeName' field has been set. + * @return True if the 'nodeName' field has been set, false otherwise. + */ public boolean hasNodeName() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearNodeName() { + * Clears the value of the 'nodeName' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockDetails.Builder clearNodeName() { nodeName = null; fieldSetFlags()[3] = false; return this; @@ -494,32 +466,27 @@ public BlockDetails build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.number); out.writeString(this.hash); @@ -530,9 +497,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.number = in.readString(); @@ -546,24 +513,24 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) } else { for (int i = 0; i < 4; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.number = in.readString(); - break; + case 0: + this.number = in.readString(); + break; - case 1: - this.hash = in.readString(); - break; + case 1: + this.hash = in.readString(); + break; - case 2: - this.timestamp = in.readString(); - break; + case 2: + this.timestamp = in.readString(); + break; - case 3: - this.nodeName = in.readString(); - break; + case 3: + this.nodeName = in.readString(); + break; - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/net/consensys/eventeum/BlockEvent.java b/src/main/java/io/keyko/monitoring/schemas/BlockEvent.java similarity index 60% rename from src/main/java/net/consensys/eventeum/BlockEvent.java rename to src/main/java/io/keyko/monitoring/schemas/BlockEvent.java index abf00de..50ee003 100644 --- a/src/main/java/net/consensys/eventeum/BlockEvent.java +++ b/src/main/java/io/keyko/monitoring/schemas/BlockEvent.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class BlockEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -4269460057361371108L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = 7285302814443941338L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,26 +65,21 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static BlockEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.BlockDetails details; - @Deprecated - public int retries; + @Deprecated public String id; + @Deprecated public String type; + @Deprecated public io.keyko.monitoring.schemas.BlockDetails details; + @Deprecated public int retries; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public BlockEvent() { - } + public BlockEvent() {} /** * All-args constructor. @@ -96,55 +88,35 @@ public BlockEvent() { * @param details The new value for details * @param retries The new value for retries */ - public BlockEvent(String id, String type, net.consensys.eventeum.BlockDetails details, Integer retries) { + public BlockEvent(String id, String type, io.keyko.monitoring.schemas.BlockDetails details, Integer retries) { this.id = id; this.type = type; this.details = details; this.retries = retries; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return id; + case 1: return type; + case 2: return details; + case 3: return retries; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.BlockDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: id = (String)value$; break; + case 1: type = (String)value$; break; + case 2: details = (io.keyko.monitoring.schemas.BlockDetails)value$; break; + case 3: retries = (Integer)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -186,7 +158,7 @@ public void setType(String value) { * Gets the value of the 'details' field. * @return The value of the 'details' field. */ - public net.consensys.eventeum.BlockDetails getDetails() { + public io.keyko.monitoring.schemas.BlockDetails getDetails() { return details; } @@ -195,7 +167,7 @@ public net.consensys.eventeum.BlockDetails getDetails() { * Sets the value of the 'details' field. * @param value the value to set. */ - public void setDetails(net.consensys.eventeum.BlockDetails value) { + public void setDetails(io.keyko.monitoring.schemas.BlockDetails value) { this.details = value; } @@ -220,8 +192,8 @@ public void setRetries(int value) { * Creates a new BlockEvent RecordBuilder. * @return A new BlockEvent RecordBuilder */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder() { - return new net.consensys.eventeum.BlockEvent.Builder(); + public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder() { + return new io.keyko.monitoring.schemas.BlockEvent.Builder(); } /** @@ -229,11 +201,11 @@ public static net.consensys.eventeum.BlockEvent.Builder newBuilder() { * @param other The existing builder to copy. * @return A new BlockEvent RecordBuilder */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder(net.consensys.eventeum.BlockEvent.Builder other) { + public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder(io.keyko.monitoring.schemas.BlockEvent.Builder other) { if (other == null) { - return new net.consensys.eventeum.BlockEvent.Builder(); + return new io.keyko.monitoring.schemas.BlockEvent.Builder(); } else { - return new net.consensys.eventeum.BlockEvent.Builder(other); + return new io.keyko.monitoring.schemas.BlockEvent.Builder(other); } } @@ -242,11 +214,11 @@ public static net.consensys.eventeum.BlockEvent.Builder newBuilder(net.consensys * @param other The existing instance to copy. * @return A new BlockEvent RecordBuilder */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder(net.consensys.eventeum.BlockEvent other) { + public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder(io.keyko.monitoring.schemas.BlockEvent other) { if (other == null) { - return new net.consensys.eventeum.BlockEvent.Builder(); + return new io.keyko.monitoring.schemas.BlockEvent.Builder(); } else { - return new net.consensys.eventeum.BlockEvent.Builder(other); + return new io.keyko.monitoring.schemas.BlockEvent.Builder(other); } } @@ -258,8 +230,8 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String id; private String type; - private net.consensys.eventeum.BlockDetails details; - private net.consensys.eventeum.BlockDetails.Builder detailsBuilder; + private io.keyko.monitoring.schemas.BlockDetails details; + private io.keyko.monitoring.schemas.BlockDetails.Builder detailsBuilder; private int retries; /** Creates a new Builder */ @@ -271,7 +243,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.BlockEvent.Builder other) { + private Builder(io.keyko.monitoring.schemas.BlockEvent.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -286,7 +258,7 @@ private Builder(net.consensys.eventeum.BlockEvent.Builder other) { fieldSetFlags()[2] = other.fieldSetFlags()[2]; } if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.BlockDetails.newBuilder(other.getDetailsBuilder()); + this.detailsBuilder = io.keyko.monitoring.schemas.BlockDetails.newBuilder(other.getDetailsBuilder()); } if (isValidValue(fields()[3], other.retries)) { this.retries = data().deepCopy(fields()[3].schema(), other.retries); @@ -298,7 +270,7 @@ private Builder(net.consensys.eventeum.BlockEvent.Builder other) { * Creates a Builder by copying an existing BlockEvent instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.BlockEvent other) { + private Builder(io.keyko.monitoring.schemas.BlockEvent other) { super(SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -320,20 +292,20 @@ private Builder(net.consensys.eventeum.BlockEvent other) { } /** - * Gets the value of the 'id' field. - * @return The value. - */ + * Gets the value of the 'id' field. + * @return The value. + */ public String getId() { return id; } /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setId(String value) { + * Sets the value of the 'id' field. + * @param value The value of 'id'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder setId(String value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; @@ -341,39 +313,39 @@ public net.consensys.eventeum.BlockEvent.Builder setId(String value) { } /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ + * Checks whether the 'id' field has been set. + * @return True if the 'id' field has been set, false otherwise. + */ public boolean hasId() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearId() { + * Clears the value of the 'id' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -381,39 +353,39 @@ public net.consensys.eventeum.BlockEvent.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.BlockDetails getDetails() { + * Gets the value of the 'details' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.BlockDetails getDetails() { return details; } /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setDetails(net.consensys.eventeum.BlockDetails value) { + * Sets the value of the 'details' field. + * @param value The value of 'details'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder setDetails(io.keyko.monitoring.schemas.BlockDetails value) { validate(fields()[2], value); this.detailsBuilder = null; this.details = value; @@ -422,9 +394,9 @@ public net.consensys.eventeum.BlockEvent.Builder setDetails(net.consensys.evente } /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ + * Checks whether the 'details' field has been set. + * @return True if the 'details' field has been set, false otherwise. + */ public boolean hasDetails() { return fieldSetFlags()[2]; } @@ -433,12 +405,12 @@ public boolean hasDetails() { * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. * @return This builder. */ - public net.consensys.eventeum.BlockDetails.Builder getDetailsBuilder() { + public io.keyko.monitoring.schemas.BlockDetails.Builder getDetailsBuilder() { if (detailsBuilder == null) { if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.BlockDetails.newBuilder(details)); + setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder(details)); } else { - setDetailsBuilder(net.consensys.eventeum.BlockDetails.newBuilder()); + setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder()); } } return detailsBuilder; @@ -449,7 +421,7 @@ public net.consensys.eventeum.BlockDetails.Builder getDetailsBuilder() { * @param value The builder instance that must be set. * @return This builder. */ - public net.consensys.eventeum.BlockEvent.Builder setDetailsBuilder(net.consensys.eventeum.BlockDetails.Builder value) { + public io.keyko.monitoring.schemas.BlockEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder value) { clearDetails(); detailsBuilder = value; return this; @@ -464,10 +436,10 @@ public boolean hasDetailsBuilder() { } /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearDetails() { + * Clears the value of the 'details' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder clearDetails() { details = null; detailsBuilder = null; fieldSetFlags()[2] = false; @@ -475,20 +447,20 @@ public net.consensys.eventeum.BlockEvent.Builder clearDetails() { } /** - * Gets the value of the 'retries' field. - * @return The value. - */ + * Gets the value of the 'retries' field. + * @return The value. + */ public int getRetries() { return retries; } /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setRetries(int value) { + * Sets the value of the 'retries' field. + * @param value The value of 'retries'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder setRetries(int value) { validate(fields()[3], value); this.retries = value; fieldSetFlags()[3] = true; @@ -496,19 +468,19 @@ public net.consensys.eventeum.BlockEvent.Builder setRetries(int value) { } /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ + * Checks whether the 'retries' field has been set. + * @return True if the 'retries' field has been set, false otherwise. + */ public boolean hasRetries() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearRetries() { + * Clears the value of the 'retries' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.BlockEvent.Builder clearRetries() { fieldSetFlags()[3] = false; return this; } @@ -528,7 +500,7 @@ public BlockEvent build() { throw e; } } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.BlockDetails) defaultValue(fields()[2]); + record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.BlockDetails) defaultValue(fields()[2]); } record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); return record; @@ -542,32 +514,27 @@ public BlockEvent build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.id); out.writeString(this.type); @@ -578,9 +545,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.id = in.readString(); @@ -588,7 +555,7 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) this.type = in.readString(); if (this.details == null) { - this.details = new net.consensys.eventeum.BlockDetails(); + this.details = new io.keyko.monitoring.schemas.BlockDetails(); } this.details.customDecode(in); @@ -597,27 +564,27 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) } else { for (int i = 0; i < 4; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new net.consensys.eventeum.BlockDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + case 0: + this.id = in.readString(); + break; + + case 1: + this.type = in.readString(); + break; + + case 2: + if (this.details == null) { + this.details = new io.keyko.monitoring.schemas.BlockDetails(); + } + this.details.customDecode(in); + break; + + case 3: + this.retries = in.readInt(); + break; + + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/net/consensys/eventeum/ContractEvent.java b/src/main/java/io/keyko/monitoring/schemas/ContractEvent.java similarity index 56% rename from src/main/java/net/consensys/eventeum/ContractEvent.java rename to src/main/java/io/keyko/monitoring/schemas/ContractEvent.java index 6fd5087..770733d 100644 --- a/src/main/java/net/consensys/eventeum/ContractEvent.java +++ b/src/main/java/io/keyko/monitoring/schemas/ContractEvent.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class ContractEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -7300114330920817296L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = -3492402380681590992L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,26 +65,21 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static ContractEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.ContractEventDetails details; - @Deprecated - public int retries; + @Deprecated public String id; + @Deprecated public String type; + @Deprecated public io.keyko.monitoring.schemas.ContractEventDetails details; + @Deprecated public int retries; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public ContractEvent() { - } + public ContractEvent() {} /** * All-args constructor. @@ -96,55 +88,35 @@ public ContractEvent() { * @param details The new value for details * @param retries The new value for retries */ - public ContractEvent(String id, String type, net.consensys.eventeum.ContractEventDetails details, Integer retries) { + public ContractEvent(String id, String type, io.keyko.monitoring.schemas.ContractEventDetails details, Integer retries) { this.id = id; this.type = type; this.details = details; this.retries = retries; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return id; + case 1: return type; + case 2: return details; + case 3: return retries; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.ContractEventDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: id = (String)value$; break; + case 1: type = (String)value$; break; + case 2: details = (io.keyko.monitoring.schemas.ContractEventDetails)value$; break; + case 3: retries = (Integer)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -186,7 +158,7 @@ public void setType(String value) { * Gets the value of the 'details' field. * @return The value of the 'details' field. */ - public net.consensys.eventeum.ContractEventDetails getDetails() { + public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { return details; } @@ -195,7 +167,7 @@ public net.consensys.eventeum.ContractEventDetails getDetails() { * Sets the value of the 'details' field. * @param value the value to set. */ - public void setDetails(net.consensys.eventeum.ContractEventDetails value) { + public void setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { this.details = value; } @@ -220,8 +192,8 @@ public void setRetries(int value) { * Creates a new ContractEvent RecordBuilder. * @return A new ContractEvent RecordBuilder */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder() { - return new net.consensys.eventeum.ContractEvent.Builder(); + public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder() { + return new io.keyko.monitoring.schemas.ContractEvent.Builder(); } /** @@ -229,11 +201,11 @@ public static net.consensys.eventeum.ContractEvent.Builder newBuilder() { * @param other The existing builder to copy. * @return A new ContractEvent RecordBuilder */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder(net.consensys.eventeum.ContractEvent.Builder other) { + public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder(io.keyko.monitoring.schemas.ContractEvent.Builder other) { if (other == null) { - return new net.consensys.eventeum.ContractEvent.Builder(); + return new io.keyko.monitoring.schemas.ContractEvent.Builder(); } else { - return new net.consensys.eventeum.ContractEvent.Builder(other); + return new io.keyko.monitoring.schemas.ContractEvent.Builder(other); } } @@ -242,11 +214,11 @@ public static net.consensys.eventeum.ContractEvent.Builder newBuilder(net.consen * @param other The existing instance to copy. * @return A new ContractEvent RecordBuilder */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder(net.consensys.eventeum.ContractEvent other) { + public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder(io.keyko.monitoring.schemas.ContractEvent other) { if (other == null) { - return new net.consensys.eventeum.ContractEvent.Builder(); + return new io.keyko.monitoring.schemas.ContractEvent.Builder(); } else { - return new net.consensys.eventeum.ContractEvent.Builder(other); + return new io.keyko.monitoring.schemas.ContractEvent.Builder(other); } } @@ -258,8 +230,8 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String id; private String type; - private net.consensys.eventeum.ContractEventDetails details; - private net.consensys.eventeum.ContractEventDetails.Builder detailsBuilder; + private io.keyko.monitoring.schemas.ContractEventDetails details; + private io.keyko.monitoring.schemas.ContractEventDetails.Builder detailsBuilder; private int retries; /** Creates a new Builder */ @@ -271,7 +243,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.ContractEvent.Builder other) { + private Builder(io.keyko.monitoring.schemas.ContractEvent.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -286,7 +258,7 @@ private Builder(net.consensys.eventeum.ContractEvent.Builder other) { fieldSetFlags()[2] = other.fieldSetFlags()[2]; } if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.ContractEventDetails.newBuilder(other.getDetailsBuilder()); + this.detailsBuilder = io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(other.getDetailsBuilder()); } if (isValidValue(fields()[3], other.retries)) { this.retries = data().deepCopy(fields()[3].schema(), other.retries); @@ -298,7 +270,7 @@ private Builder(net.consensys.eventeum.ContractEvent.Builder other) { * Creates a Builder by copying an existing ContractEvent instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.ContractEvent other) { + private Builder(io.keyko.monitoring.schemas.ContractEvent other) { super(SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -320,20 +292,20 @@ private Builder(net.consensys.eventeum.ContractEvent other) { } /** - * Gets the value of the 'id' field. - * @return The value. - */ + * Gets the value of the 'id' field. + * @return The value. + */ public String getId() { return id; } /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setId(String value) { + * Sets the value of the 'id' field. + * @param value The value of 'id'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder setId(String value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; @@ -341,39 +313,39 @@ public net.consensys.eventeum.ContractEvent.Builder setId(String value) { } /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ + * Checks whether the 'id' field has been set. + * @return True if the 'id' field has been set, false otherwise. + */ public boolean hasId() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearId() { + * Clears the value of the 'id' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -381,39 +353,39 @@ public net.consensys.eventeum.ContractEvent.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { + * Gets the value of the 'details' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { return details; } /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setDetails(net.consensys.eventeum.ContractEventDetails value) { + * Sets the value of the 'details' field. + * @param value The value of 'details'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { validate(fields()[2], value); this.detailsBuilder = null; this.details = value; @@ -422,9 +394,9 @@ public net.consensys.eventeum.ContractEvent.Builder setDetails(net.consensys.eve } /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ + * Checks whether the 'details' field has been set. + * @return True if the 'details' field has been set, false otherwise. + */ public boolean hasDetails() { return fieldSetFlags()[2]; } @@ -433,12 +405,12 @@ public boolean hasDetails() { * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. * @return This builder. */ - public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { + public io.keyko.monitoring.schemas.ContractEventDetails.Builder getDetailsBuilder() { if (detailsBuilder == null) { if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder(details)); + setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(details)); } else { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder()); + setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder()); } } return detailsBuilder; @@ -449,7 +421,7 @@ public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { * @param value The builder instance that must be set. * @return This builder. */ - public net.consensys.eventeum.ContractEvent.Builder setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.Builder value) { + public io.keyko.monitoring.schemas.ContractEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder value) { clearDetails(); detailsBuilder = value; return this; @@ -464,10 +436,10 @@ public boolean hasDetailsBuilder() { } /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearDetails() { + * Clears the value of the 'details' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder clearDetails() { details = null; detailsBuilder = null; fieldSetFlags()[2] = false; @@ -475,20 +447,20 @@ public net.consensys.eventeum.ContractEvent.Builder clearDetails() { } /** - * Gets the value of the 'retries' field. - * @return The value. - */ + * Gets the value of the 'retries' field. + * @return The value. + */ public int getRetries() { return retries; } /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setRetries(int value) { + * Sets the value of the 'retries' field. + * @param value The value of 'retries'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder setRetries(int value) { validate(fields()[3], value); this.retries = value; fieldSetFlags()[3] = true; @@ -496,19 +468,19 @@ public net.consensys.eventeum.ContractEvent.Builder setRetries(int value) { } /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ + * Checks whether the 'retries' field has been set. + * @return True if the 'retries' field has been set, false otherwise. + */ public boolean hasRetries() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearRetries() { + * Clears the value of the 'retries' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEvent.Builder clearRetries() { fieldSetFlags()[3] = false; return this; } @@ -528,7 +500,7 @@ public ContractEvent build() { throw e; } } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.ContractEventDetails) defaultValue(fields()[2]); + record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.ContractEventDetails) defaultValue(fields()[2]); } record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); return record; @@ -542,20 +514,18 @@ public ContractEvent build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } diff --git a/src/main/java/net/consensys/eventeum/ContractEventDetails.java b/src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java similarity index 61% rename from src/main/java/net/consensys/eventeum/ContractEventDetails.java rename to src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java index b4e8bc1..4a7b1d0 100644 --- a/src/main/java/net/consensys/eventeum/ContractEventDetails.java +++ b/src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class ContractEventDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3223974792905382143L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = -3202235962030049371L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,46 +65,31 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static ContractEventDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String name; - @Deprecated - public String filterId; - @Deprecated - public String nodeName; - @Deprecated - public java.util.List indexedParameters; - @Deprecated - public java.util.List nonIndexedParameters; - @Deprecated - public String transactionHash; - @Deprecated - public String logIndex; - @Deprecated - public String blockNumber; - @Deprecated - public String blockHash; - @Deprecated - public String address; - @Deprecated - public net.consensys.eventeum.ContractEventStatus status; - @Deprecated - public String eventSpecificationSignature; - @Deprecated - public String networkName; - @Deprecated - public String id; + @Deprecated public String name; + @Deprecated public String filterId; + @Deprecated public String nodeName; + @Deprecated public java.util.List indexedParameters; + @Deprecated public java.util.List nonIndexedParameters; + @Deprecated public String transactionHash; + @Deprecated public String logIndex; + @Deprecated public String blockNumber; + @Deprecated public String blockHash; + @Deprecated public String address; + @Deprecated public io.keyko.monitoring.schemas.ContractEventStatus status; + @Deprecated public String eventSpecificationSignature; + @Deprecated public String networkName; + @Deprecated public String id; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public ContractEventDetails() { - } + public ContractEventDetails() {} /** * All-args constructor. @@ -126,7 +108,7 @@ public ContractEventDetails() { * @param networkName The new value for networkName * @param id The new value for id */ - public ContractEventDetails(String name, String filterId, String nodeName, java.util.List indexedParameters, java.util.List nonIndexedParameters, String transactionHash, String logIndex, String blockNumber, String blockHash, String address, net.consensys.eventeum.ContractEventStatus status, String eventSpecificationSignature, String networkName, String id) { + public ContractEventDetails(String name, String filterId, String nodeName, java.util.List indexedParameters, java.util.List nonIndexedParameters, String transactionHash, String logIndex, String blockNumber, String blockHash, String address, io.keyko.monitoring.schemas.ContractEventStatus status, String eventSpecificationSignature, String networkName, String id) { this.name = name; this.filterId = filterId; this.nodeName = nodeName; @@ -143,98 +125,48 @@ public ContractEventDetails(String name, String filterId, String nodeName, java. this.id = id; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return name; - case 1: - return filterId; - case 2: - return nodeName; - case 3: - return indexedParameters; - case 4: - return nonIndexedParameters; - case 5: - return transactionHash; - case 6: - return logIndex; - case 7: - return blockNumber; - case 8: - return blockHash; - case 9: - return address; - case 10: - return status; - case 11: - return eventSpecificationSignature; - case 12: - return networkName; - case 13: - return id; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return name; + case 1: return filterId; + case 2: return nodeName; + case 3: return indexedParameters; + case 4: return nonIndexedParameters; + case 5: return transactionHash; + case 6: return logIndex; + case 7: return blockNumber; + case 8: return blockHash; + case 9: return address; + case 10: return status; + case 11: return eventSpecificationSignature; + case 12: return networkName; + case 13: return id; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - filterId = (String) value$; - break; - case 2: - nodeName = (String) value$; - break; - case 3: - indexedParameters = (java.util.List) value$; - break; - case 4: - nonIndexedParameters = (java.util.List) value$; - break; - case 5: - transactionHash = (String) value$; - break; - case 6: - logIndex = (String) value$; - break; - case 7: - blockNumber = (String) value$; - break; - case 8: - blockHash = (String) value$; - break; - case 9: - address = (String) value$; - break; - case 10: - status = (net.consensys.eventeum.ContractEventStatus) value$; - break; - case 11: - eventSpecificationSignature = (String) value$; - break; - case 12: - networkName = (String) value$; - break; - case 13: - id = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: name = (String)value$; break; + case 1: filterId = (String)value$; break; + case 2: nodeName = (String)value$; break; + case 3: indexedParameters = (java.util.List)value$; break; + case 4: nonIndexedParameters = (java.util.List)value$; break; + case 5: transactionHash = (String)value$; break; + case 6: logIndex = (String)value$; break; + case 7: blockNumber = (String)value$; break; + case 8: blockHash = (String)value$; break; + case 9: address = (String)value$; break; + case 10: status = (io.keyko.monitoring.schemas.ContractEventStatus)value$; break; + case 11: eventSpecificationSignature = (String)value$; break; + case 12: networkName = (String)value$; break; + case 13: id = (String)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -412,7 +344,7 @@ public void setAddress(String value) { * Gets the value of the 'status' field. * @return The value of the 'status' field. */ - public net.consensys.eventeum.ContractEventStatus getStatus() { + public io.keyko.monitoring.schemas.ContractEventStatus getStatus() { return status; } @@ -421,7 +353,7 @@ public net.consensys.eventeum.ContractEventStatus getStatus() { * Sets the value of the 'status' field. * @param value the value to set. */ - public void setStatus(net.consensys.eventeum.ContractEventStatus value) { + public void setStatus(io.keyko.monitoring.schemas.ContractEventStatus value) { this.status = value; } @@ -480,8 +412,8 @@ public void setId(String value) { * Creates a new ContractEventDetails RecordBuilder. * @return A new ContractEventDetails RecordBuilder */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder() { - return new net.consensys.eventeum.ContractEventDetails.Builder(); + public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder() { + return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); } /** @@ -489,11 +421,11 @@ public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder() { * @param other The existing builder to copy. * @return A new ContractEventDetails RecordBuilder */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder(net.consensys.eventeum.ContractEventDetails.Builder other) { + public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder other) { if (other == null) { - return new net.consensys.eventeum.ContractEventDetails.Builder(); + return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); } else { - return new net.consensys.eventeum.ContractEventDetails.Builder(other); + return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(other); } } @@ -502,11 +434,11 @@ public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder(net * @param other The existing instance to copy. * @return A new ContractEventDetails RecordBuilder */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder(net.consensys.eventeum.ContractEventDetails other) { + public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder(io.keyko.monitoring.schemas.ContractEventDetails other) { if (other == null) { - return new net.consensys.eventeum.ContractEventDetails.Builder(); + return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); } else { - return new net.consensys.eventeum.ContractEventDetails.Builder(other); + return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(other); } } @@ -526,7 +458,7 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String blockNumber; private String blockHash; private String address; - private net.consensys.eventeum.ContractEventStatus status; + private io.keyko.monitoring.schemas.ContractEventStatus status; private String eventSpecificationSignature; private String networkName; private String id; @@ -540,7 +472,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.ContractEventDetails.Builder other) { + private Builder(io.keyko.monitoring.schemas.ContractEventDetails.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -604,7 +536,7 @@ private Builder(net.consensys.eventeum.ContractEventDetails.Builder other) { * Creates a Builder by copying an existing ContractEventDetails instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.ContractEventDetails other) { + private Builder(io.keyko.monitoring.schemas.ContractEventDetails other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -665,20 +597,20 @@ private Builder(net.consensys.eventeum.ContractEventDetails other) { } /** - * Gets the value of the 'name' field. - * @return The value. - */ + * Gets the value of the 'name' field. + * @return The value. + */ public String getName() { return name; } /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setName(String value) { + * Sets the value of the 'name' field. + * @param value The value of 'name'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setName(String value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; @@ -686,39 +618,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setName(String value) } /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ + * Checks whether the 'name' field has been set. + * @return True if the 'name' field has been set, false otherwise. + */ public boolean hasName() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearName() { + * Clears the value of the 'name' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'filterId' field. - * @return The value. - */ + * Gets the value of the 'filterId' field. + * @return The value. + */ public String getFilterId() { return filterId; } /** - * Sets the value of the 'filterId' field. - * @param value The value of 'filterId'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setFilterId(String value) { + * Sets the value of the 'filterId' field. + * @param value The value of 'filterId'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setFilterId(String value) { validate(fields()[1], value); this.filterId = value; fieldSetFlags()[1] = true; @@ -726,39 +658,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setFilterId(String va } /** - * Checks whether the 'filterId' field has been set. - * @return True if the 'filterId' field has been set, false otherwise. - */ + * Checks whether the 'filterId' field has been set. + * @return True if the 'filterId' field has been set, false otherwise. + */ public boolean hasFilterId() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'filterId' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearFilterId() { + * Clears the value of the 'filterId' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearFilterId() { filterId = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ + * Gets the value of the 'nodeName' field. + * @return The value. + */ public String getNodeName() { return nodeName; } /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNodeName(String value) { + * Sets the value of the 'nodeName' field. + * @param value The value of 'nodeName'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNodeName(String value) { validate(fields()[2], value); this.nodeName = value; fieldSetFlags()[2] = true; @@ -766,39 +698,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setNodeName(String va } /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ + * Checks whether the 'nodeName' field has been set. + * @return True if the 'nodeName' field has been set, false otherwise. + */ public boolean hasNodeName() { return fieldSetFlags()[2]; } /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNodeName() { + * Clears the value of the 'nodeName' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNodeName() { nodeName = null; fieldSetFlags()[2] = false; return this; } /** - * Gets the value of the 'indexedParameters' field. - * @return The value. - */ + * Gets the value of the 'indexedParameters' field. + * @return The value. + */ public java.util.List getIndexedParameters() { return indexedParameters; } /** - * Sets the value of the 'indexedParameters' field. - * @param value The value of 'indexedParameters'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setIndexedParameters(java.util.List value) { + * Sets the value of the 'indexedParameters' field. + * @param value The value of 'indexedParameters'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setIndexedParameters(java.util.List value) { validate(fields()[3], value); this.indexedParameters = value; fieldSetFlags()[3] = true; @@ -806,39 +738,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setIndexedParameters( } /** - * Checks whether the 'indexedParameters' field has been set. - * @return True if the 'indexedParameters' field has been set, false otherwise. - */ + * Checks whether the 'indexedParameters' field has been set. + * @return True if the 'indexedParameters' field has been set, false otherwise. + */ public boolean hasIndexedParameters() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'indexedParameters' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearIndexedParameters() { + * Clears the value of the 'indexedParameters' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearIndexedParameters() { indexedParameters = null; fieldSetFlags()[3] = false; return this; } /** - * Gets the value of the 'nonIndexedParameters' field. - * @return The value. - */ + * Gets the value of the 'nonIndexedParameters' field. + * @return The value. + */ public java.util.List getNonIndexedParameters() { return nonIndexedParameters; } /** - * Sets the value of the 'nonIndexedParameters' field. - * @param value The value of 'nonIndexedParameters'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNonIndexedParameters(java.util.List value) { + * Sets the value of the 'nonIndexedParameters' field. + * @param value The value of 'nonIndexedParameters'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNonIndexedParameters(java.util.List value) { validate(fields()[4], value); this.nonIndexedParameters = value; fieldSetFlags()[4] = true; @@ -846,39 +778,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setNonIndexedParamete } /** - * Checks whether the 'nonIndexedParameters' field has been set. - * @return True if the 'nonIndexedParameters' field has been set, false otherwise. - */ + * Checks whether the 'nonIndexedParameters' field has been set. + * @return True if the 'nonIndexedParameters' field has been set, false otherwise. + */ public boolean hasNonIndexedParameters() { return fieldSetFlags()[4]; } /** - * Clears the value of the 'nonIndexedParameters' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNonIndexedParameters() { + * Clears the value of the 'nonIndexedParameters' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNonIndexedParameters() { nonIndexedParameters = null; fieldSetFlags()[4] = false; return this; } /** - * Gets the value of the 'transactionHash' field. - * @return The value. - */ + * Gets the value of the 'transactionHash' field. + * @return The value. + */ public String getTransactionHash() { return transactionHash; } /** - * Sets the value of the 'transactionHash' field. - * @param value The value of 'transactionHash'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setTransactionHash(String value) { + * Sets the value of the 'transactionHash' field. + * @param value The value of 'transactionHash'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setTransactionHash(String value) { validate(fields()[5], value); this.transactionHash = value; fieldSetFlags()[5] = true; @@ -886,39 +818,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setTransactionHash(St } /** - * Checks whether the 'transactionHash' field has been set. - * @return True if the 'transactionHash' field has been set, false otherwise. - */ + * Checks whether the 'transactionHash' field has been set. + * @return True if the 'transactionHash' field has been set, false otherwise. + */ public boolean hasTransactionHash() { return fieldSetFlags()[5]; } /** - * Clears the value of the 'transactionHash' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearTransactionHash() { + * Clears the value of the 'transactionHash' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearTransactionHash() { transactionHash = null; fieldSetFlags()[5] = false; return this; } /** - * Gets the value of the 'logIndex' field. - * @return The value. - */ + * Gets the value of the 'logIndex' field. + * @return The value. + */ public String getLogIndex() { return logIndex; } /** - * Sets the value of the 'logIndex' field. - * @param value The value of 'logIndex'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setLogIndex(String value) { + * Sets the value of the 'logIndex' field. + * @param value The value of 'logIndex'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setLogIndex(String value) { validate(fields()[6], value); this.logIndex = value; fieldSetFlags()[6] = true; @@ -926,39 +858,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setLogIndex(String va } /** - * Checks whether the 'logIndex' field has been set. - * @return True if the 'logIndex' field has been set, false otherwise. - */ + * Checks whether the 'logIndex' field has been set. + * @return True if the 'logIndex' field has been set, false otherwise. + */ public boolean hasLogIndex() { return fieldSetFlags()[6]; } /** - * Clears the value of the 'logIndex' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearLogIndex() { + * Clears the value of the 'logIndex' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearLogIndex() { logIndex = null; fieldSetFlags()[6] = false; return this; } /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ + * Gets the value of the 'blockNumber' field. + * @return The value. + */ public String getBlockNumber() { return blockNumber; } /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setBlockNumber(String value) { + * Sets the value of the 'blockNumber' field. + * @param value The value of 'blockNumber'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setBlockNumber(String value) { validate(fields()[7], value); this.blockNumber = value; fieldSetFlags()[7] = true; @@ -966,39 +898,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setBlockNumber(String } /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ + * Checks whether the 'blockNumber' field has been set. + * @return True if the 'blockNumber' field has been set, false otherwise. + */ public boolean hasBlockNumber() { return fieldSetFlags()[7]; } /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearBlockNumber() { + * Clears the value of the 'blockNumber' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearBlockNumber() { blockNumber = null; fieldSetFlags()[7] = false; return this; } /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ + * Gets the value of the 'blockHash' field. + * @return The value. + */ public String getBlockHash() { return blockHash; } /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setBlockHash(String value) { + * Sets the value of the 'blockHash' field. + * @param value The value of 'blockHash'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setBlockHash(String value) { validate(fields()[8], value); this.blockHash = value; fieldSetFlags()[8] = true; @@ -1006,39 +938,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setBlockHash(String v } /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ + * Checks whether the 'blockHash' field has been set. + * @return True if the 'blockHash' field has been set, false otherwise. + */ public boolean hasBlockHash() { return fieldSetFlags()[8]; } /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearBlockHash() { + * Clears the value of the 'blockHash' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearBlockHash() { blockHash = null; fieldSetFlags()[8] = false; return this; } /** - * Gets the value of the 'address' field. - * @return The value. - */ + * Gets the value of the 'address' field. + * @return The value. + */ public String getAddress() { return address; } /** - * Sets the value of the 'address' field. - * @param value The value of 'address'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setAddress(String value) { + * Sets the value of the 'address' field. + * @param value The value of 'address'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setAddress(String value) { validate(fields()[9], value); this.address = value; fieldSetFlags()[9] = true; @@ -1046,39 +978,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setAddress(String val } /** - * Checks whether the 'address' field has been set. - * @return True if the 'address' field has been set, false otherwise. - */ + * Checks whether the 'address' field has been set. + * @return True if the 'address' field has been set, false otherwise. + */ public boolean hasAddress() { return fieldSetFlags()[9]; } /** - * Clears the value of the 'address' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearAddress() { + * Clears the value of the 'address' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearAddress() { address = null; fieldSetFlags()[9] = false; return this; } /** - * Gets the value of the 'status' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventStatus getStatus() { + * Gets the value of the 'status' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.ContractEventStatus getStatus() { return status; } /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setStatus(net.consensys.eventeum.ContractEventStatus value) { + * Sets the value of the 'status' field. + * @param value The value of 'status'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setStatus(io.keyko.monitoring.schemas.ContractEventStatus value) { validate(fields()[10], value); this.status = value; fieldSetFlags()[10] = true; @@ -1086,39 +1018,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setStatus(net.consens } /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ + * Checks whether the 'status' field has been set. + * @return True if the 'status' field has been set, false otherwise. + */ public boolean hasStatus() { return fieldSetFlags()[10]; } /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearStatus() { + * Clears the value of the 'status' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearStatus() { status = null; fieldSetFlags()[10] = false; return this; } /** - * Gets the value of the 'eventSpecificationSignature' field. - * @return The value. - */ + * Gets the value of the 'eventSpecificationSignature' field. + * @return The value. + */ public String getEventSpecificationSignature() { return eventSpecificationSignature; } /** - * Sets the value of the 'eventSpecificationSignature' field. - * @param value The value of 'eventSpecificationSignature'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setEventSpecificationSignature(String value) { + * Sets the value of the 'eventSpecificationSignature' field. + * @param value The value of 'eventSpecificationSignature'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setEventSpecificationSignature(String value) { validate(fields()[11], value); this.eventSpecificationSignature = value; fieldSetFlags()[11] = true; @@ -1126,39 +1058,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setEventSpecification } /** - * Checks whether the 'eventSpecificationSignature' field has been set. - * @return True if the 'eventSpecificationSignature' field has been set, false otherwise. - */ + * Checks whether the 'eventSpecificationSignature' field has been set. + * @return True if the 'eventSpecificationSignature' field has been set, false otherwise. + */ public boolean hasEventSpecificationSignature() { return fieldSetFlags()[11]; } /** - * Clears the value of the 'eventSpecificationSignature' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearEventSpecificationSignature() { + * Clears the value of the 'eventSpecificationSignature' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearEventSpecificationSignature() { eventSpecificationSignature = null; fieldSetFlags()[11] = false; return this; } /** - * Gets the value of the 'networkName' field. - * @return The value. - */ + * Gets the value of the 'networkName' field. + * @return The value. + */ public String getNetworkName() { return networkName; } /** - * Sets the value of the 'networkName' field. - * @param value The value of 'networkName'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNetworkName(String value) { + * Sets the value of the 'networkName' field. + * @param value The value of 'networkName'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNetworkName(String value) { validate(fields()[12], value); this.networkName = value; fieldSetFlags()[12] = true; @@ -1166,39 +1098,39 @@ public net.consensys.eventeum.ContractEventDetails.Builder setNetworkName(String } /** - * Checks whether the 'networkName' field has been set. - * @return True if the 'networkName' field has been set, false otherwise. - */ + * Checks whether the 'networkName' field has been set. + * @return True if the 'networkName' field has been set, false otherwise. + */ public boolean hasNetworkName() { return fieldSetFlags()[12]; } /** - * Clears the value of the 'networkName' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNetworkName() { + * Clears the value of the 'networkName' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNetworkName() { networkName = null; fieldSetFlags()[12] = false; return this; } /** - * Gets the value of the 'id' field. - * @return The value. - */ + * Gets the value of the 'id' field. + * @return The value. + */ public String getId() { return id; } /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setId(String value) { + * Sets the value of the 'id' field. + * @param value The value of 'id'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder setId(String value) { validate(fields()[13], value); this.id = value; fieldSetFlags()[13] = true; @@ -1206,19 +1138,19 @@ public net.consensys.eventeum.ContractEventDetails.Builder setId(String value) { } /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ + * Checks whether the 'id' field has been set. + * @return True if the 'id' field has been set, false otherwise. + */ public boolean hasId() { return fieldSetFlags()[13]; } /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearId() { + * Clears the value of the 'id' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearId() { id = null; fieldSetFlags()[13] = false; return this; @@ -1239,7 +1171,7 @@ public ContractEventDetails build() { record.blockNumber = fieldSetFlags()[7] ? this.blockNumber : (String) defaultValue(fields()[7]); record.blockHash = fieldSetFlags()[8] ? this.blockHash : (String) defaultValue(fields()[8]); record.address = fieldSetFlags()[9] ? this.address : (String) defaultValue(fields()[9]); - record.status = fieldSetFlags()[10] ? this.status : (net.consensys.eventeum.ContractEventStatus) defaultValue(fields()[10]); + record.status = fieldSetFlags()[10] ? this.status : (io.keyko.monitoring.schemas.ContractEventStatus) defaultValue(fields()[10]); record.eventSpecificationSignature = fieldSetFlags()[11] ? this.eventSpecificationSignature : (String) defaultValue(fields()[11]); record.networkName = fieldSetFlags()[12] ? this.networkName : (String) defaultValue(fields()[12]); record.id = fieldSetFlags()[13] ? this.id : (String) defaultValue(fields()[13]); @@ -1254,20 +1186,18 @@ public ContractEventDetails build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } diff --git a/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java b/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java new file mode 100644 index 0000000..109ea82 --- /dev/null +++ b/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java @@ -0,0 +1,13 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package io.keyko.monitoring.schemas; +@org.apache.avro.specific.AvroGenerated +public enum ContractEventStatus implements org.apache.avro.generic.GenericEnumSymbol { + UNCONFIRMED, CONFIRMED, INVALIDATED ; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } +} diff --git a/src/main/java/net/consensys/eventeum/EventBlock.java b/src/main/java/io/keyko/monitoring/schemas/EventBlock.java similarity index 55% rename from src/main/java/net/consensys/eventeum/EventBlock.java rename to src/main/java/io/keyko/monitoring/schemas/EventBlock.java index ac4af20..56c06a0 100644 --- a/src/main/java/net/consensys/eventeum/EventBlock.java +++ b/src/main/java/io/keyko/monitoring/schemas/EventBlock.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class EventBlock extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3360333280331309414L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EventBlock\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"detailsBlock\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = -2673260571713821605L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EventBlock\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"detailsBlock\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,28 +65,22 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static EventBlock fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.ContractEventDetails details; - @Deprecated - public net.consensys.eventeum.BlockDetails detailsBlock; - @Deprecated - public int retries; + @Deprecated public String id; + @Deprecated public String type; + @Deprecated public io.keyko.monitoring.schemas.ContractEventDetails details; + @Deprecated public io.keyko.monitoring.schemas.BlockDetails detailsBlock; + @Deprecated public int retries; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public EventBlock() { - } + public EventBlock() {} /** * All-args constructor. @@ -99,7 +90,7 @@ public EventBlock() { * @param detailsBlock The new value for detailsBlock * @param retries The new value for retries */ - public EventBlock(String id, String type, net.consensys.eventeum.ContractEventDetails details, net.consensys.eventeum.BlockDetails detailsBlock, Integer retries) { + public EventBlock(String id, String type, io.keyko.monitoring.schemas.ContractEventDetails details, io.keyko.monitoring.schemas.BlockDetails detailsBlock, Integer retries) { this.id = id; this.type = type; this.details = details; @@ -107,53 +98,30 @@ public EventBlock(String id, String type, net.consensys.eventeum.ContractEventDe this.retries = retries; } - public SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return detailsBlock; - case 4: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return id; + case 1: return type; + case 2: return details; + case 3: return detailsBlock; + case 4: return retries; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.ContractEventDetails) value$; - break; - case 3: - detailsBlock = (net.consensys.eventeum.BlockDetails) value$; - break; - case 4: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: id = (String)value$; break; + case 1: type = (String)value$; break; + case 2: details = (io.keyko.monitoring.schemas.ContractEventDetails)value$; break; + case 3: detailsBlock = (io.keyko.monitoring.schemas.BlockDetails)value$; break; + case 4: retries = (Integer)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -195,7 +163,7 @@ public void setType(String value) { * Gets the value of the 'details' field. * @return The value of the 'details' field. */ - public net.consensys.eventeum.ContractEventDetails getDetails() { + public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { return details; } @@ -204,7 +172,7 @@ public net.consensys.eventeum.ContractEventDetails getDetails() { * Sets the value of the 'details' field. * @param value the value to set. */ - public void setDetails(net.consensys.eventeum.ContractEventDetails value) { + public void setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { this.details = value; } @@ -212,7 +180,7 @@ public void setDetails(net.consensys.eventeum.ContractEventDetails value) { * Gets the value of the 'detailsBlock' field. * @return The value of the 'detailsBlock' field. */ - public net.consensys.eventeum.BlockDetails getDetailsBlock() { + public io.keyko.monitoring.schemas.BlockDetails getDetailsBlock() { return detailsBlock; } @@ -221,7 +189,7 @@ public net.consensys.eventeum.BlockDetails getDetailsBlock() { * Sets the value of the 'detailsBlock' field. * @param value the value to set. */ - public void setDetailsBlock(net.consensys.eventeum.BlockDetails value) { + public void setDetailsBlock(io.keyko.monitoring.schemas.BlockDetails value) { this.detailsBlock = value; } @@ -246,8 +214,8 @@ public void setRetries(int value) { * Creates a new EventBlock RecordBuilder. * @return A new EventBlock RecordBuilder */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder() { - return new net.consensys.eventeum.EventBlock.Builder(); + public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder() { + return new io.keyko.monitoring.schemas.EventBlock.Builder(); } /** @@ -255,11 +223,11 @@ public static net.consensys.eventeum.EventBlock.Builder newBuilder() { * @param other The existing builder to copy. * @return A new EventBlock RecordBuilder */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder(net.consensys.eventeum.EventBlock.Builder other) { + public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder(io.keyko.monitoring.schemas.EventBlock.Builder other) { if (other == null) { - return new net.consensys.eventeum.EventBlock.Builder(); + return new io.keyko.monitoring.schemas.EventBlock.Builder(); } else { - return new net.consensys.eventeum.EventBlock.Builder(other); + return new io.keyko.monitoring.schemas.EventBlock.Builder(other); } } @@ -268,11 +236,11 @@ public static net.consensys.eventeum.EventBlock.Builder newBuilder(net.consensys * @param other The existing instance to copy. * @return A new EventBlock RecordBuilder */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder(net.consensys.eventeum.EventBlock other) { + public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder(io.keyko.monitoring.schemas.EventBlock other) { if (other == null) { - return new net.consensys.eventeum.EventBlock.Builder(); + return new io.keyko.monitoring.schemas.EventBlock.Builder(); } else { - return new net.consensys.eventeum.EventBlock.Builder(other); + return new io.keyko.monitoring.schemas.EventBlock.Builder(other); } } @@ -284,10 +252,10 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String id; private String type; - private net.consensys.eventeum.ContractEventDetails details; - private net.consensys.eventeum.ContractEventDetails.Builder detailsBuilder; - private net.consensys.eventeum.BlockDetails detailsBlock; - private net.consensys.eventeum.BlockDetails.Builder detailsBlockBuilder; + private io.keyko.monitoring.schemas.ContractEventDetails details; + private io.keyko.monitoring.schemas.ContractEventDetails.Builder detailsBuilder; + private io.keyko.monitoring.schemas.BlockDetails detailsBlock; + private io.keyko.monitoring.schemas.BlockDetails.Builder detailsBlockBuilder; private int retries; /** Creates a new Builder */ @@ -299,7 +267,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.EventBlock.Builder other) { + private Builder(io.keyko.monitoring.schemas.EventBlock.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -314,14 +282,14 @@ private Builder(net.consensys.eventeum.EventBlock.Builder other) { fieldSetFlags()[2] = other.fieldSetFlags()[2]; } if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.ContractEventDetails.newBuilder(other.getDetailsBuilder()); + this.detailsBuilder = io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(other.getDetailsBuilder()); } if (isValidValue(fields()[3], other.detailsBlock)) { this.detailsBlock = data().deepCopy(fields()[3].schema(), other.detailsBlock); fieldSetFlags()[3] = other.fieldSetFlags()[3]; } if (other.hasDetailsBlockBuilder()) { - this.detailsBlockBuilder = net.consensys.eventeum.BlockDetails.newBuilder(other.getDetailsBlockBuilder()); + this.detailsBlockBuilder = io.keyko.monitoring.schemas.BlockDetails.newBuilder(other.getDetailsBlockBuilder()); } if (isValidValue(fields()[4], other.retries)) { this.retries = data().deepCopy(fields()[4].schema(), other.retries); @@ -333,7 +301,7 @@ private Builder(net.consensys.eventeum.EventBlock.Builder other) { * Creates a Builder by copying an existing EventBlock instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.EventBlock other) { + private Builder(io.keyko.monitoring.schemas.EventBlock other) { super(SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -360,20 +328,20 @@ private Builder(net.consensys.eventeum.EventBlock other) { } /** - * Gets the value of the 'id' field. - * @return The value. - */ + * Gets the value of the 'id' field. + * @return The value. + */ public String getId() { return id; } /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setId(String value) { + * Sets the value of the 'id' field. + * @param value The value of 'id'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder setId(String value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; @@ -381,39 +349,39 @@ public net.consensys.eventeum.EventBlock.Builder setId(String value) { } /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ + * Checks whether the 'id' field has been set. + * @return True if the 'id' field has been set, false otherwise. + */ public boolean hasId() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearId() { + * Clears the value of the 'id' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -421,39 +389,39 @@ public net.consensys.eventeum.EventBlock.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { + * Gets the value of the 'details' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { return details; } /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetails(net.consensys.eventeum.ContractEventDetails value) { + * Sets the value of the 'details' field. + * @param value The value of 'details'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { validate(fields()[2], value); this.detailsBuilder = null; this.details = value; @@ -462,9 +430,9 @@ public net.consensys.eventeum.EventBlock.Builder setDetails(net.consensys.evente } /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ + * Checks whether the 'details' field has been set. + * @return True if the 'details' field has been set, false otherwise. + */ public boolean hasDetails() { return fieldSetFlags()[2]; } @@ -473,12 +441,12 @@ public boolean hasDetails() { * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. * @return This builder. */ - public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { + public io.keyko.monitoring.schemas.ContractEventDetails.Builder getDetailsBuilder() { if (detailsBuilder == null) { if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder(details)); + setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(details)); } else { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder()); + setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder()); } } return detailsBuilder; @@ -489,7 +457,7 @@ public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { * @param value The builder instance that must be set. * @return This builder. */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.Builder value) { + public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder value) { clearDetails(); detailsBuilder = value; return this; @@ -504,10 +472,10 @@ public boolean hasDetailsBuilder() { } /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearDetails() { + * Clears the value of the 'details' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder clearDetails() { details = null; detailsBuilder = null; fieldSetFlags()[2] = false; @@ -515,20 +483,20 @@ public net.consensys.eventeum.EventBlock.Builder clearDetails() { } /** - * Gets the value of the 'detailsBlock' field. - * @return The value. - */ - public net.consensys.eventeum.BlockDetails getDetailsBlock() { + * Gets the value of the 'detailsBlock' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.BlockDetails getDetailsBlock() { return detailsBlock; } /** - * Sets the value of the 'detailsBlock' field. - * @param value The value of 'detailsBlock'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBlock(net.consensys.eventeum.BlockDetails value) { + * Sets the value of the 'detailsBlock' field. + * @param value The value of 'detailsBlock'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBlock(io.keyko.monitoring.schemas.BlockDetails value) { validate(fields()[3], value); this.detailsBlockBuilder = null; this.detailsBlock = value; @@ -537,9 +505,9 @@ public net.consensys.eventeum.EventBlock.Builder setDetailsBlock(net.consensys.e } /** - * Checks whether the 'detailsBlock' field has been set. - * @return True if the 'detailsBlock' field has been set, false otherwise. - */ + * Checks whether the 'detailsBlock' field has been set. + * @return True if the 'detailsBlock' field has been set, false otherwise. + */ public boolean hasDetailsBlock() { return fieldSetFlags()[3]; } @@ -548,12 +516,12 @@ public boolean hasDetailsBlock() { * Gets the Builder instance for the 'detailsBlock' field and creates one if it doesn't exist yet. * @return This builder. */ - public net.consensys.eventeum.BlockDetails.Builder getDetailsBlockBuilder() { + public io.keyko.monitoring.schemas.BlockDetails.Builder getDetailsBlockBuilder() { if (detailsBlockBuilder == null) { if (hasDetailsBlock()) { - setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.newBuilder(detailsBlock)); + setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder(detailsBlock)); } else { - setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.newBuilder()); + setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder()); } } return detailsBlockBuilder; @@ -564,7 +532,7 @@ public net.consensys.eventeum.BlockDetails.Builder getDetailsBlockBuilder() { * @param value The builder instance that must be set. * @return This builder. */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.Builder value) { + public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder value) { clearDetailsBlock(); detailsBlockBuilder = value; return this; @@ -579,10 +547,10 @@ public boolean hasDetailsBlockBuilder() { } /** - * Clears the value of the 'detailsBlock' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearDetailsBlock() { + * Clears the value of the 'detailsBlock' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder clearDetailsBlock() { detailsBlock = null; detailsBlockBuilder = null; fieldSetFlags()[3] = false; @@ -590,20 +558,20 @@ public net.consensys.eventeum.EventBlock.Builder clearDetailsBlock() { } /** - * Gets the value of the 'retries' field. - * @return The value. - */ + * Gets the value of the 'retries' field. + * @return The value. + */ public int getRetries() { return retries; } /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setRetries(int value) { + * Sets the value of the 'retries' field. + * @param value The value of 'retries'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder setRetries(int value) { validate(fields()[4], value); this.retries = value; fieldSetFlags()[4] = true; @@ -611,19 +579,19 @@ public net.consensys.eventeum.EventBlock.Builder setRetries(int value) { } /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ + * Checks whether the 'retries' field has been set. + * @return True if the 'retries' field has been set, false otherwise. + */ public boolean hasRetries() { return fieldSetFlags()[4]; } /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearRetries() { + * Clears the value of the 'retries' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.EventBlock.Builder clearRetries() { fieldSetFlags()[4] = false; return this; } @@ -643,7 +611,7 @@ public EventBlock build() { throw e; } } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.ContractEventDetails) defaultValue(fields()[2]); + record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.ContractEventDetails) defaultValue(fields()[2]); } if (detailsBlockBuilder != null) { try { @@ -653,7 +621,7 @@ public EventBlock build() { throw e; } } else { - record.detailsBlock = fieldSetFlags()[3] ? this.detailsBlock : (net.consensys.eventeum.BlockDetails) defaultValue(fields()[3]); + record.detailsBlock = fieldSetFlags()[3] ? this.detailsBlock : (io.keyko.monitoring.schemas.BlockDetails) defaultValue(fields()[3]); } record.retries = fieldSetFlags()[4] ? this.retries : (Integer) defaultValue(fields()[4]); return record; @@ -667,20 +635,18 @@ public EventBlock build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } diff --git a/src/main/java/net/consensys/eventeum/NumberParameter.java b/src/main/java/io/keyko/monitoring/schemas/NumberParameter.java similarity index 64% rename from src/main/java/net/consensys/eventeum/NumberParameter.java rename to src/main/java/io/keyko/monitoring/schemas/NumberParameter.java index 855f4ea..3234dcb 100644 --- a/src/main/java/net/consensys/eventeum/NumberParameter.java +++ b/src/main/java/io/keyko/monitoring/schemas/NumberParameter.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class NumberParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -5788241449146873692L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"NumberParameter\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = 715459069521122234L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"NumberParameter\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,24 +65,20 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static NumberParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String name; - @Deprecated - public String type; - @Deprecated - public String value; + @Deprecated public String name; + @Deprecated public String type; + @Deprecated public String value; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public NumberParameter() { - } + public NumberParameter() {} /** * All-args constructor. @@ -99,43 +92,26 @@ public NumberParameter(String name, String type, String value) { this.value = value; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return name; - case 1: - return type; - case 2: - return value; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return name; + case 1: return type; + case 2: return value; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - value = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: name = (String)value$; break; + case 1: type = (String)value$; break; + case 2: value = (String)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -194,8 +170,8 @@ public void setValue(String value) { * Creates a new NumberParameter RecordBuilder. * @return A new NumberParameter RecordBuilder */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder() { - return new net.consensys.eventeum.NumberParameter.Builder(); + public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder() { + return new io.keyko.monitoring.schemas.NumberParameter.Builder(); } /** @@ -203,11 +179,11 @@ public static net.consensys.eventeum.NumberParameter.Builder newBuilder() { * @param other The existing builder to copy. * @return A new NumberParameter RecordBuilder */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder(net.consensys.eventeum.NumberParameter.Builder other) { + public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder(io.keyko.monitoring.schemas.NumberParameter.Builder other) { if (other == null) { - return new net.consensys.eventeum.NumberParameter.Builder(); + return new io.keyko.monitoring.schemas.NumberParameter.Builder(); } else { - return new net.consensys.eventeum.NumberParameter.Builder(other); + return new io.keyko.monitoring.schemas.NumberParameter.Builder(other); } } @@ -216,11 +192,11 @@ public static net.consensys.eventeum.NumberParameter.Builder newBuilder(net.cons * @param other The existing instance to copy. * @return A new NumberParameter RecordBuilder */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder(net.consensys.eventeum.NumberParameter other) { + public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder(io.keyko.monitoring.schemas.NumberParameter other) { if (other == null) { - return new net.consensys.eventeum.NumberParameter.Builder(); + return new io.keyko.monitoring.schemas.NumberParameter.Builder(); } else { - return new net.consensys.eventeum.NumberParameter.Builder(other); + return new io.keyko.monitoring.schemas.NumberParameter.Builder(other); } } @@ -243,7 +219,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.NumberParameter.Builder other) { + private Builder(io.keyko.monitoring.schemas.NumberParameter.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -263,7 +239,7 @@ private Builder(net.consensys.eventeum.NumberParameter.Builder other) { * Creates a Builder by copying an existing NumberParameter instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.NumberParameter other) { + private Builder(io.keyko.monitoring.schemas.NumberParameter other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -280,20 +256,20 @@ private Builder(net.consensys.eventeum.NumberParameter other) { } /** - * Gets the value of the 'name' field. - * @return The value. - */ + * Gets the value of the 'name' field. + * @return The value. + */ public String getName() { return name; } /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setName(String value) { + * Sets the value of the 'name' field. + * @param value The value of 'name'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder setName(String value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; @@ -301,39 +277,39 @@ public net.consensys.eventeum.NumberParameter.Builder setName(String value) { } /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ + * Checks whether the 'name' field has been set. + * @return True if the 'name' field has been set, false otherwise. + */ public boolean hasName() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearName() { + * Clears the value of the 'name' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -341,39 +317,39 @@ public net.consensys.eventeum.NumberParameter.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'value' field. - * @return The value. - */ + * Gets the value of the 'value' field. + * @return The value. + */ public String getValue() { return value; } /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setValue(String value) { + * Sets the value of the 'value' field. + * @param value The value of 'value'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder setValue(String value) { validate(fields()[2], value); this.value = value; fieldSetFlags()[2] = true; @@ -381,19 +357,19 @@ public net.consensys.eventeum.NumberParameter.Builder setValue(String value) { } /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ + * Checks whether the 'value' field has been set. + * @return True if the 'value' field has been set, false otherwise. + */ public boolean hasValue() { return fieldSetFlags()[2]; } /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearValue() { + * Clears the value of the 'value' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.NumberParameter.Builder clearValue() { value = null; fieldSetFlags()[2] = false; return this; @@ -418,32 +394,27 @@ public NumberParameter build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.name); out.writeString(this.type); @@ -452,9 +423,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.name = in.readString(); @@ -466,20 +437,20 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) } else { for (int i = 0; i < 3; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; + case 0: + this.name = in.readString(); + break; - case 1: - this.type = in.readString(); - break; + case 1: + this.type = in.readString(); + break; - case 2: - this.value = in.readString(); - break; + case 2: + this.value = in.readString(); + break; - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/net/consensys/eventeum/StringParameter.java b/src/main/java/io/keyko/monitoring/schemas/StringParameter.java similarity index 65% rename from src/main/java/net/consensys/eventeum/StringParameter.java rename to src/main/java/io/keyko/monitoring/schemas/StringParameter.java index 728882d..7e551e5 100644 --- a/src/main/java/net/consensys/eventeum/StringParameter.java +++ b/src/main/java/io/keyko/monitoring/schemas/StringParameter.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class StringParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -7626022158636516734L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"StringParameter\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = 3488942165868781980L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"StringParameter\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,24 +65,20 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static StringParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String name; - @Deprecated - public String type; - @Deprecated - public String value; + @Deprecated public String name; + @Deprecated public String type; + @Deprecated public String value; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public StringParameter() { - } + public StringParameter() {} /** * All-args constructor. @@ -99,43 +92,26 @@ public StringParameter(String name, String type, String value) { this.value = value; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return name; - case 1: - return type; - case 2: - return value; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return name; + case 1: return type; + case 2: return value; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - value = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: name = (String)value$; break; + case 1: type = (String)value$; break; + case 2: value = (String)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -194,8 +170,8 @@ public void setValue(String value) { * Creates a new StringParameter RecordBuilder. * @return A new StringParameter RecordBuilder */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder() { - return new net.consensys.eventeum.StringParameter.Builder(); + public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder() { + return new io.keyko.monitoring.schemas.StringParameter.Builder(); } /** @@ -203,11 +179,11 @@ public static net.consensys.eventeum.StringParameter.Builder newBuilder() { * @param other The existing builder to copy. * @return A new StringParameter RecordBuilder */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder(net.consensys.eventeum.StringParameter.Builder other) { + public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder(io.keyko.monitoring.schemas.StringParameter.Builder other) { if (other == null) { - return new net.consensys.eventeum.StringParameter.Builder(); + return new io.keyko.monitoring.schemas.StringParameter.Builder(); } else { - return new net.consensys.eventeum.StringParameter.Builder(other); + return new io.keyko.monitoring.schemas.StringParameter.Builder(other); } } @@ -216,11 +192,11 @@ public static net.consensys.eventeum.StringParameter.Builder newBuilder(net.cons * @param other The existing instance to copy. * @return A new StringParameter RecordBuilder */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder(net.consensys.eventeum.StringParameter other) { + public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder(io.keyko.monitoring.schemas.StringParameter other) { if (other == null) { - return new net.consensys.eventeum.StringParameter.Builder(); + return new io.keyko.monitoring.schemas.StringParameter.Builder(); } else { - return new net.consensys.eventeum.StringParameter.Builder(other); + return new io.keyko.monitoring.schemas.StringParameter.Builder(other); } } @@ -243,7 +219,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.StringParameter.Builder other) { + private Builder(io.keyko.monitoring.schemas.StringParameter.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -263,7 +239,7 @@ private Builder(net.consensys.eventeum.StringParameter.Builder other) { * Creates a Builder by copying an existing StringParameter instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.StringParameter other) { + private Builder(io.keyko.monitoring.schemas.StringParameter other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); @@ -280,20 +256,20 @@ private Builder(net.consensys.eventeum.StringParameter other) { } /** - * Gets the value of the 'name' field. - * @return The value. - */ + * Gets the value of the 'name' field. + * @return The value. + */ public String getName() { return name; } /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setName(String value) { + * Sets the value of the 'name' field. + * @param value The value of 'name'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder setName(String value) { validate(fields()[0], value); this.name = value; fieldSetFlags()[0] = true; @@ -301,39 +277,39 @@ public net.consensys.eventeum.StringParameter.Builder setName(String value) { } /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ + * Checks whether the 'name' field has been set. + * @return True if the 'name' field has been set, false otherwise. + */ public boolean hasName() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearName() { + * Clears the value of the 'name' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -341,39 +317,39 @@ public net.consensys.eventeum.StringParameter.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'value' field. - * @return The value. - */ + * Gets the value of the 'value' field. + * @return The value. + */ public String getValue() { return value; } /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setValue(String value) { + * Sets the value of the 'value' field. + * @param value The value of 'value'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder setValue(String value) { validate(fields()[2], value); this.value = value; fieldSetFlags()[2] = true; @@ -381,19 +357,19 @@ public net.consensys.eventeum.StringParameter.Builder setValue(String value) { } /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ + * Checks whether the 'value' field has been set. + * @return True if the 'value' field has been set, false otherwise. + */ public boolean hasValue() { return fieldSetFlags()[2]; } /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearValue() { + * Clears the value of the 'value' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.StringParameter.Builder clearValue() { value = null; fieldSetFlags()[2] = false; return this; @@ -418,32 +394,27 @@ public StringParameter build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.name); out.writeString(this.type); @@ -452,9 +423,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.name = in.readString(); @@ -466,20 +437,20 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) } else { for (int i = 0; i < 3; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; + case 0: + this.name = in.readString(); + break; - case 1: - this.type = in.readString(); - break; + case 1: + this.type = in.readString(); + break; - case 2: - this.value = in.readString(); - break; + case 2: + this.value = in.readString(); + break; - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/net/consensys/eventeum/TransactionDetails.java b/src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java similarity index 60% rename from src/main/java/net/consensys/eventeum/TransactionDetails.java rename to src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java index 076ce01..5ae37dd 100644 --- a/src/main/java/net/consensys/eventeum/TransactionDetails.java +++ b/src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class TransactionDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3487675989958263773L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = -349061294898434206L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,44 +65,30 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static TransactionDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String hash; - @Deprecated - public String nonce; - @Deprecated - public String blockNumber; - @Deprecated - public String blockHash; - @Deprecated - public String transactionIndex; - @Deprecated - public String from; - @Deprecated - public String to; - @Deprecated - public String value; - @Deprecated - public String nodeName; - @Deprecated - public String contractAddress; - @Deprecated - public String input; - @Deprecated - public String revertReason; - @Deprecated - public net.consensys.eventeum.TransactionStatus status; + @Deprecated public String hash; + @Deprecated public String nonce; + @Deprecated public String blockNumber; + @Deprecated public String blockHash; + @Deprecated public String transactionIndex; + @Deprecated public String from; + @Deprecated public String to; + @Deprecated public String value; + @Deprecated public String nodeName; + @Deprecated public String contractAddress; + @Deprecated public String input; + @Deprecated public String revertReason; + @Deprecated public io.keyko.monitoring.schemas.TransactionStatus status; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public TransactionDetails() { - } + public TransactionDetails() {} /** * All-args constructor. @@ -123,7 +106,7 @@ public TransactionDetails() { * @param revertReason The new value for revertReason * @param status The new value for status */ - public TransactionDetails(String hash, String nonce, String blockNumber, String blockHash, String transactionIndex, String from, String to, String value, String nodeName, String contractAddress, String input, String revertReason, net.consensys.eventeum.TransactionStatus status) { + public TransactionDetails(String hash, String nonce, String blockNumber, String blockHash, String transactionIndex, String from, String to, String value, String nodeName, String contractAddress, String input, String revertReason, io.keyko.monitoring.schemas.TransactionStatus status) { this.hash = hash; this.nonce = nonce; this.blockNumber = blockNumber; @@ -139,93 +122,46 @@ public TransactionDetails(String hash, String nonce, String blockNumber, String this.status = status; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return hash; - case 1: - return nonce; - case 2: - return blockNumber; - case 3: - return blockHash; - case 4: - return transactionIndex; - case 5: - return from; - case 6: - return to; - case 7: - return value; - case 8: - return nodeName; - case 9: - return contractAddress; - case 10: - return input; - case 11: - return revertReason; - case 12: - return status; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return hash; + case 1: return nonce; + case 2: return blockNumber; + case 3: return blockHash; + case 4: return transactionIndex; + case 5: return from; + case 6: return to; + case 7: return value; + case 8: return nodeName; + case 9: return contractAddress; + case 10: return input; + case 11: return revertReason; + case 12: return status; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - hash = (String) value$; - break; - case 1: - nonce = (String) value$; - break; - case 2: - blockNumber = (String) value$; - break; - case 3: - blockHash = (String) value$; - break; - case 4: - transactionIndex = (String) value$; - break; - case 5: - from = (String) value$; - break; - case 6: - to = (String) value$; - break; - case 7: - value = (String) value$; - break; - case 8: - nodeName = (String) value$; - break; - case 9: - contractAddress = (String) value$; - break; - case 10: - input = (String) value$; - break; - case 11: - revertReason = (String) value$; - break; - case 12: - status = (net.consensys.eventeum.TransactionStatus) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: hash = (String)value$; break; + case 1: nonce = (String)value$; break; + case 2: blockNumber = (String)value$; break; + case 3: blockHash = (String)value$; break; + case 4: transactionIndex = (String)value$; break; + case 5: from = (String)value$; break; + case 6: to = (String)value$; break; + case 7: value = (String)value$; break; + case 8: nodeName = (String)value$; break; + case 9: contractAddress = (String)value$; break; + case 10: input = (String)value$; break; + case 11: revertReason = (String)value$; break; + case 12: status = (io.keyko.monitoring.schemas.TransactionStatus)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -437,7 +373,7 @@ public void setRevertReason(String value) { * Gets the value of the 'status' field. * @return The value of the 'status' field. */ - public net.consensys.eventeum.TransactionStatus getStatus() { + public io.keyko.monitoring.schemas.TransactionStatus getStatus() { return status; } @@ -446,7 +382,7 @@ public net.consensys.eventeum.TransactionStatus getStatus() { * Sets the value of the 'status' field. * @param value the value to set. */ - public void setStatus(net.consensys.eventeum.TransactionStatus value) { + public void setStatus(io.keyko.monitoring.schemas.TransactionStatus value) { this.status = value; } @@ -454,8 +390,8 @@ public void setStatus(net.consensys.eventeum.TransactionStatus value) { * Creates a new TransactionDetails RecordBuilder. * @return A new TransactionDetails RecordBuilder */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder() { - return new net.consensys.eventeum.TransactionDetails.Builder(); + public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder() { + return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); } /** @@ -463,11 +399,11 @@ public static net.consensys.eventeum.TransactionDetails.Builder newBuilder() { * @param other The existing builder to copy. * @return A new TransactionDetails RecordBuilder */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder(net.consensys.eventeum.TransactionDetails.Builder other) { + public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder(io.keyko.monitoring.schemas.TransactionDetails.Builder other) { if (other == null) { - return new net.consensys.eventeum.TransactionDetails.Builder(); + return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); } else { - return new net.consensys.eventeum.TransactionDetails.Builder(other); + return new io.keyko.monitoring.schemas.TransactionDetails.Builder(other); } } @@ -476,11 +412,11 @@ public static net.consensys.eventeum.TransactionDetails.Builder newBuilder(net.c * @param other The existing instance to copy. * @return A new TransactionDetails RecordBuilder */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder(net.consensys.eventeum.TransactionDetails other) { + public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder(io.keyko.monitoring.schemas.TransactionDetails other) { if (other == null) { - return new net.consensys.eventeum.TransactionDetails.Builder(); + return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); } else { - return new net.consensys.eventeum.TransactionDetails.Builder(other); + return new io.keyko.monitoring.schemas.TransactionDetails.Builder(other); } } @@ -502,7 +438,7 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String contractAddress; private String input; private String revertReason; - private net.consensys.eventeum.TransactionStatus status; + private io.keyko.monitoring.schemas.TransactionStatus status; /** Creates a new Builder */ private Builder() { @@ -513,7 +449,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.TransactionDetails.Builder other) { + private Builder(io.keyko.monitoring.schemas.TransactionDetails.Builder other) { super(other); if (isValidValue(fields()[0], other.hash)) { this.hash = data().deepCopy(fields()[0].schema(), other.hash); @@ -573,7 +509,7 @@ private Builder(net.consensys.eventeum.TransactionDetails.Builder other) { * Creates a Builder by copying an existing TransactionDetails instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.TransactionDetails other) { + private Builder(io.keyko.monitoring.schemas.TransactionDetails other) { super(SCHEMA$); if (isValidValue(fields()[0], other.hash)) { this.hash = data().deepCopy(fields()[0].schema(), other.hash); @@ -630,20 +566,20 @@ private Builder(net.consensys.eventeum.TransactionDetails other) { } /** - * Gets the value of the 'hash' field. - * @return The value. - */ + * Gets the value of the 'hash' field. + * @return The value. + */ public String getHash() { return hash; } /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setHash(String value) { + * Sets the value of the 'hash' field. + * @param value The value of 'hash'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setHash(String value) { validate(fields()[0], value); this.hash = value; fieldSetFlags()[0] = true; @@ -651,39 +587,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setHash(String value) { } /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ + * Checks whether the 'hash' field has been set. + * @return True if the 'hash' field has been set, false otherwise. + */ public boolean hasHash() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearHash() { + * Clears the value of the 'hash' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearHash() { hash = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'nonce' field. - * @return The value. - */ + * Gets the value of the 'nonce' field. + * @return The value. + */ public String getNonce() { return nonce; } /** - * Sets the value of the 'nonce' field. - * @param value The value of 'nonce'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setNonce(String value) { + * Sets the value of the 'nonce' field. + * @param value The value of 'nonce'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setNonce(String value) { validate(fields()[1], value); this.nonce = value; fieldSetFlags()[1] = true; @@ -691,39 +627,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setNonce(String value) } /** - * Checks whether the 'nonce' field has been set. - * @return True if the 'nonce' field has been set, false otherwise. - */ + * Checks whether the 'nonce' field has been set. + * @return True if the 'nonce' field has been set, false otherwise. + */ public boolean hasNonce() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'nonce' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearNonce() { + * Clears the value of the 'nonce' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearNonce() { nonce = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ + * Gets the value of the 'blockNumber' field. + * @return The value. + */ public String getBlockNumber() { return blockNumber; } /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setBlockNumber(String value) { + * Sets the value of the 'blockNumber' field. + * @param value The value of 'blockNumber'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setBlockNumber(String value) { validate(fields()[2], value); this.blockNumber = value; fieldSetFlags()[2] = true; @@ -731,39 +667,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setBlockNumber(String v } /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ + * Checks whether the 'blockNumber' field has been set. + * @return True if the 'blockNumber' field has been set, false otherwise. + */ public boolean hasBlockNumber() { return fieldSetFlags()[2]; } /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearBlockNumber() { + * Clears the value of the 'blockNumber' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearBlockNumber() { blockNumber = null; fieldSetFlags()[2] = false; return this; } /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ + * Gets the value of the 'blockHash' field. + * @return The value. + */ public String getBlockHash() { return blockHash; } /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setBlockHash(String value) { + * Sets the value of the 'blockHash' field. + * @param value The value of 'blockHash'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setBlockHash(String value) { validate(fields()[3], value); this.blockHash = value; fieldSetFlags()[3] = true; @@ -771,39 +707,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setBlockHash(String val } /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ + * Checks whether the 'blockHash' field has been set. + * @return True if the 'blockHash' field has been set, false otherwise. + */ public boolean hasBlockHash() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearBlockHash() { + * Clears the value of the 'blockHash' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearBlockHash() { blockHash = null; fieldSetFlags()[3] = false; return this; } /** - * Gets the value of the 'transactionIndex' field. - * @return The value. - */ + * Gets the value of the 'transactionIndex' field. + * @return The value. + */ public String getTransactionIndex() { return transactionIndex; } /** - * Sets the value of the 'transactionIndex' field. - * @param value The value of 'transactionIndex'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setTransactionIndex(String value) { + * Sets the value of the 'transactionIndex' field. + * @param value The value of 'transactionIndex'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setTransactionIndex(String value) { validate(fields()[4], value); this.transactionIndex = value; fieldSetFlags()[4] = true; @@ -811,39 +747,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setTransactionIndex(Str } /** - * Checks whether the 'transactionIndex' field has been set. - * @return True if the 'transactionIndex' field has been set, false otherwise. - */ + * Checks whether the 'transactionIndex' field has been set. + * @return True if the 'transactionIndex' field has been set, false otherwise. + */ public boolean hasTransactionIndex() { return fieldSetFlags()[4]; } /** - * Clears the value of the 'transactionIndex' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearTransactionIndex() { + * Clears the value of the 'transactionIndex' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearTransactionIndex() { transactionIndex = null; fieldSetFlags()[4] = false; return this; } /** - * Gets the value of the 'from' field. - * @return The value. - */ + * Gets the value of the 'from' field. + * @return The value. + */ public String getFrom() { return from; } /** - * Sets the value of the 'from' field. - * @param value The value of 'from'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setFrom(String value) { + * Sets the value of the 'from' field. + * @param value The value of 'from'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setFrom(String value) { validate(fields()[5], value); this.from = value; fieldSetFlags()[5] = true; @@ -851,39 +787,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setFrom(String value) { } /** - * Checks whether the 'from' field has been set. - * @return True if the 'from' field has been set, false otherwise. - */ + * Checks whether the 'from' field has been set. + * @return True if the 'from' field has been set, false otherwise. + */ public boolean hasFrom() { return fieldSetFlags()[5]; } /** - * Clears the value of the 'from' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearFrom() { + * Clears the value of the 'from' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearFrom() { from = null; fieldSetFlags()[5] = false; return this; } /** - * Gets the value of the 'to' field. - * @return The value. - */ + * Gets the value of the 'to' field. + * @return The value. + */ public String getTo() { return to; } /** - * Sets the value of the 'to' field. - * @param value The value of 'to'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setTo(String value) { + * Sets the value of the 'to' field. + * @param value The value of 'to'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setTo(String value) { validate(fields()[6], value); this.to = value; fieldSetFlags()[6] = true; @@ -891,39 +827,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setTo(String value) { } /** - * Checks whether the 'to' field has been set. - * @return True if the 'to' field has been set, false otherwise. - */ + * Checks whether the 'to' field has been set. + * @return True if the 'to' field has been set, false otherwise. + */ public boolean hasTo() { return fieldSetFlags()[6]; } /** - * Clears the value of the 'to' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearTo() { + * Clears the value of the 'to' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearTo() { to = null; fieldSetFlags()[6] = false; return this; } /** - * Gets the value of the 'value' field. - * @return The value. - */ + * Gets the value of the 'value' field. + * @return The value. + */ public String getValue() { return value; } /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setValue(String value) { + * Sets the value of the 'value' field. + * @param value The value of 'value'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setValue(String value) { validate(fields()[7], value); this.value = value; fieldSetFlags()[7] = true; @@ -931,39 +867,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setValue(String value) } /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ + * Checks whether the 'value' field has been set. + * @return True if the 'value' field has been set, false otherwise. + */ public boolean hasValue() { return fieldSetFlags()[7]; } /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearValue() { + * Clears the value of the 'value' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearValue() { value = null; fieldSetFlags()[7] = false; return this; } /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ + * Gets the value of the 'nodeName' field. + * @return The value. + */ public String getNodeName() { return nodeName; } /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setNodeName(String value) { + * Sets the value of the 'nodeName' field. + * @param value The value of 'nodeName'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setNodeName(String value) { validate(fields()[8], value); this.nodeName = value; fieldSetFlags()[8] = true; @@ -971,39 +907,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setNodeName(String valu } /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ + * Checks whether the 'nodeName' field has been set. + * @return True if the 'nodeName' field has been set, false otherwise. + */ public boolean hasNodeName() { return fieldSetFlags()[8]; } /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearNodeName() { + * Clears the value of the 'nodeName' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearNodeName() { nodeName = null; fieldSetFlags()[8] = false; return this; } /** - * Gets the value of the 'contractAddress' field. - * @return The value. - */ + * Gets the value of the 'contractAddress' field. + * @return The value. + */ public String getContractAddress() { return contractAddress; } /** - * Sets the value of the 'contractAddress' field. - * @param value The value of 'contractAddress'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setContractAddress(String value) { + * Sets the value of the 'contractAddress' field. + * @param value The value of 'contractAddress'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setContractAddress(String value) { validate(fields()[9], value); this.contractAddress = value; fieldSetFlags()[9] = true; @@ -1011,39 +947,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setContractAddress(Stri } /** - * Checks whether the 'contractAddress' field has been set. - * @return True if the 'contractAddress' field has been set, false otherwise. - */ + * Checks whether the 'contractAddress' field has been set. + * @return True if the 'contractAddress' field has been set, false otherwise. + */ public boolean hasContractAddress() { return fieldSetFlags()[9]; } /** - * Clears the value of the 'contractAddress' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearContractAddress() { + * Clears the value of the 'contractAddress' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearContractAddress() { contractAddress = null; fieldSetFlags()[9] = false; return this; } /** - * Gets the value of the 'input' field. - * @return The value. - */ + * Gets the value of the 'input' field. + * @return The value. + */ public String getInput() { return input; } /** - * Sets the value of the 'input' field. - * @param value The value of 'input'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setInput(String value) { + * Sets the value of the 'input' field. + * @param value The value of 'input'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setInput(String value) { validate(fields()[10], value); this.input = value; fieldSetFlags()[10] = true; @@ -1051,39 +987,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setInput(String value) } /** - * Checks whether the 'input' field has been set. - * @return True if the 'input' field has been set, false otherwise. - */ + * Checks whether the 'input' field has been set. + * @return True if the 'input' field has been set, false otherwise. + */ public boolean hasInput() { return fieldSetFlags()[10]; } /** - * Clears the value of the 'input' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearInput() { + * Clears the value of the 'input' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearInput() { input = null; fieldSetFlags()[10] = false; return this; } /** - * Gets the value of the 'revertReason' field. - * @return The value. - */ + * Gets the value of the 'revertReason' field. + * @return The value. + */ public String getRevertReason() { return revertReason; } /** - * Sets the value of the 'revertReason' field. - * @param value The value of 'revertReason'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setRevertReason(String value) { + * Sets the value of the 'revertReason' field. + * @param value The value of 'revertReason'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setRevertReason(String value) { validate(fields()[11], value); this.revertReason = value; fieldSetFlags()[11] = true; @@ -1091,39 +1027,39 @@ public net.consensys.eventeum.TransactionDetails.Builder setRevertReason(String } /** - * Checks whether the 'revertReason' field has been set. - * @return True if the 'revertReason' field has been set, false otherwise. - */ + * Checks whether the 'revertReason' field has been set. + * @return True if the 'revertReason' field has been set, false otherwise. + */ public boolean hasRevertReason() { return fieldSetFlags()[11]; } /** - * Clears the value of the 'revertReason' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearRevertReason() { + * Clears the value of the 'revertReason' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearRevertReason() { revertReason = null; fieldSetFlags()[11] = false; return this; } /** - * Gets the value of the 'status' field. - * @return The value. - */ - public net.consensys.eventeum.TransactionStatus getStatus() { + * Gets the value of the 'status' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.TransactionStatus getStatus() { return status; } /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setStatus(net.consensys.eventeum.TransactionStatus value) { + * Sets the value of the 'status' field. + * @param value The value of 'status'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder setStatus(io.keyko.monitoring.schemas.TransactionStatus value) { validate(fields()[12], value); this.status = value; fieldSetFlags()[12] = true; @@ -1131,19 +1067,19 @@ public net.consensys.eventeum.TransactionDetails.Builder setStatus(net.consensys } /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ + * Checks whether the 'status' field has been set. + * @return True if the 'status' field has been set, false otherwise. + */ public boolean hasStatus() { return fieldSetFlags()[12]; } /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearStatus() { + * Clears the value of the 'status' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionDetails.Builder clearStatus() { status = null; fieldSetFlags()[12] = false; return this; @@ -1166,7 +1102,7 @@ public TransactionDetails build() { record.contractAddress = fieldSetFlags()[9] ? this.contractAddress : (String) defaultValue(fields()[9]); record.input = fieldSetFlags()[10] ? this.input : (String) defaultValue(fields()[10]); record.revertReason = fieldSetFlags()[11] ? this.revertReason : (String) defaultValue(fields()[11]); - record.status = fieldSetFlags()[12] ? this.status : (net.consensys.eventeum.TransactionStatus) defaultValue(fields()[12]); + record.status = fieldSetFlags()[12] ? this.status : (io.keyko.monitoring.schemas.TransactionStatus) defaultValue(fields()[12]); return record; } catch (org.apache.avro.AvroMissingFieldException e) { throw e; @@ -1178,32 +1114,27 @@ public TransactionDetails build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.hash); out.writeString(this.nonce); @@ -1232,9 +1163,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.hash = in.readString(); @@ -1261,65 +1192,65 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) this.revertReason = in.readString(); - this.status = net.consensys.eventeum.TransactionStatus.values()[in.readEnum()]; + this.status = io.keyko.monitoring.schemas.TransactionStatus.values()[in.readEnum()]; } else { for (int i = 0; i < 13; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.hash = in.readString(); - break; + case 0: + this.hash = in.readString(); + break; - case 1: - this.nonce = in.readString(); - break; + case 1: + this.nonce = in.readString(); + break; - case 2: - this.blockNumber = in.readString(); - break; + case 2: + this.blockNumber = in.readString(); + break; - case 3: - this.blockHash = in.readString(); - break; + case 3: + this.blockHash = in.readString(); + break; - case 4: - this.transactionIndex = in.readString(); - break; + case 4: + this.transactionIndex = in.readString(); + break; - case 5: - this.from = in.readString(); - break; + case 5: + this.from = in.readString(); + break; - case 6: - this.to = in.readString(); - break; + case 6: + this.to = in.readString(); + break; - case 7: - this.value = in.readString(); - break; + case 7: + this.value = in.readString(); + break; - case 8: - this.nodeName = in.readString(); - break; + case 8: + this.nodeName = in.readString(); + break; - case 9: - this.contractAddress = in.readString(); - break; + case 9: + this.contractAddress = in.readString(); + break; - case 10: - this.input = in.readString(); - break; + case 10: + this.input = in.readString(); + break; - case 11: - this.revertReason = in.readString(); - break; + case 11: + this.revertReason = in.readString(); + break; - case 12: - this.status = net.consensys.eventeum.TransactionStatus.values()[in.readEnum()]; - break; + case 12: + this.status = io.keyko.monitoring.schemas.TransactionStatus.values()[in.readEnum()]; + break; - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/net/consensys/eventeum/TransactionEvent.java b/src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java similarity index 58% rename from src/main/java/net/consensys/eventeum/TransactionEvent.java rename to src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java index 2ac16e9..e206f93 100644 --- a/src/main/java/net/consensys/eventeum/TransactionEvent.java +++ b/src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java @@ -1,9 +1,9 @@ /** * Autogenerated by Avro - *

+ * * DO NOT EDIT DIRECTLY */ -package net.consensys.eventeum; +package io.keyko.monitoring.schemas; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.BinaryMessageEncoder; @@ -12,20 +12,17 @@ @org.apache.avro.specific.AvroGenerated public class TransactionEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -1439422860764450147L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"TransactionDetails\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } + private static final long serialVersionUID = 220986510352976288L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"TransactionDetails\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); + new BinaryMessageEncoder(MODEL$, SCHEMA$); private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); + new BinaryMessageDecoder(MODEL$, SCHEMA$); /** * Return the BinaryMessageEncoder instance used by this class. @@ -68,26 +65,21 @@ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class */ public static TransactionEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { + java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.TransactionDetails details; - @Deprecated - public int retries; + @Deprecated public String id; + @Deprecated public String type; + @Deprecated public io.keyko.monitoring.schemas.TransactionDetails details; + @Deprecated public int retries; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use newBuilder(). */ - public TransactionEvent() { - } + public TransactionEvent() {} /** * All-args constructor. @@ -96,55 +88,35 @@ public TransactionEvent() { * @param details The new value for details * @param retries The new value for retries */ - public TransactionEvent(String id, String type, net.consensys.eventeum.TransactionDetails details, Integer retries) { + public TransactionEvent(String id, String type, io.keyko.monitoring.schemas.TransactionDetails details, Integer retries) { this.id = id; this.type = type; this.details = details; this.retries = retries; } - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - + public SpecificData getSpecificData() { return MODEL$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public Object get(int field$) { switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: return id; + case 1: return type; + case 2: return details; + case 3: return retries; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") + @SuppressWarnings(value="unchecked") public void put(int field$, Object value$) { switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.TransactionDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); + case 0: id = (String)value$; break; + case 1: type = (String)value$; break; + case 2: details = (io.keyko.monitoring.schemas.TransactionDetails)value$; break; + case 3: retries = (Integer)value$; break; + default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } @@ -186,7 +158,7 @@ public void setType(String value) { * Gets the value of the 'details' field. * @return The value of the 'details' field. */ - public net.consensys.eventeum.TransactionDetails getDetails() { + public io.keyko.monitoring.schemas.TransactionDetails getDetails() { return details; } @@ -195,7 +167,7 @@ public net.consensys.eventeum.TransactionDetails getDetails() { * Sets the value of the 'details' field. * @param value the value to set. */ - public void setDetails(net.consensys.eventeum.TransactionDetails value) { + public void setDetails(io.keyko.monitoring.schemas.TransactionDetails value) { this.details = value; } @@ -220,8 +192,8 @@ public void setRetries(int value) { * Creates a new TransactionEvent RecordBuilder. * @return A new TransactionEvent RecordBuilder */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder() { - return new net.consensys.eventeum.TransactionEvent.Builder(); + public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder() { + return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); } /** @@ -229,11 +201,11 @@ public static net.consensys.eventeum.TransactionEvent.Builder newBuilder() { * @param other The existing builder to copy. * @return A new TransactionEvent RecordBuilder */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder(net.consensys.eventeum.TransactionEvent.Builder other) { + public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder(io.keyko.monitoring.schemas.TransactionEvent.Builder other) { if (other == null) { - return new net.consensys.eventeum.TransactionEvent.Builder(); + return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); } else { - return new net.consensys.eventeum.TransactionEvent.Builder(other); + return new io.keyko.monitoring.schemas.TransactionEvent.Builder(other); } } @@ -242,11 +214,11 @@ public static net.consensys.eventeum.TransactionEvent.Builder newBuilder(net.con * @param other The existing instance to copy. * @return A new TransactionEvent RecordBuilder */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder(net.consensys.eventeum.TransactionEvent other) { + public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder(io.keyko.monitoring.schemas.TransactionEvent other) { if (other == null) { - return new net.consensys.eventeum.TransactionEvent.Builder(); + return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); } else { - return new net.consensys.eventeum.TransactionEvent.Builder(other); + return new io.keyko.monitoring.schemas.TransactionEvent.Builder(other); } } @@ -258,8 +230,8 @@ public static class Builder extends org.apache.avro.specific.SpecificRecordBuild private String id; private String type; - private net.consensys.eventeum.TransactionDetails details; - private net.consensys.eventeum.TransactionDetails.Builder detailsBuilder; + private io.keyko.monitoring.schemas.TransactionDetails details; + private io.keyko.monitoring.schemas.TransactionDetails.Builder detailsBuilder; private int retries; /** Creates a new Builder */ @@ -271,7 +243,7 @@ private Builder() { * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ - private Builder(net.consensys.eventeum.TransactionEvent.Builder other) { + private Builder(io.keyko.monitoring.schemas.TransactionEvent.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -286,7 +258,7 @@ private Builder(net.consensys.eventeum.TransactionEvent.Builder other) { fieldSetFlags()[2] = other.fieldSetFlags()[2]; } if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.TransactionDetails.newBuilder(other.getDetailsBuilder()); + this.detailsBuilder = io.keyko.monitoring.schemas.TransactionDetails.newBuilder(other.getDetailsBuilder()); } if (isValidValue(fields()[3], other.retries)) { this.retries = data().deepCopy(fields()[3].schema(), other.retries); @@ -298,7 +270,7 @@ private Builder(net.consensys.eventeum.TransactionEvent.Builder other) { * Creates a Builder by copying an existing TransactionEvent instance * @param other The existing instance to copy. */ - private Builder(net.consensys.eventeum.TransactionEvent other) { + private Builder(io.keyko.monitoring.schemas.TransactionEvent other) { super(SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); @@ -320,20 +292,20 @@ private Builder(net.consensys.eventeum.TransactionEvent other) { } /** - * Gets the value of the 'id' field. - * @return The value. - */ + * Gets the value of the 'id' field. + * @return The value. + */ public String getId() { return id; } /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setId(String value) { + * Sets the value of the 'id' field. + * @param value The value of 'id'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder setId(String value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; @@ -341,39 +313,39 @@ public net.consensys.eventeum.TransactionEvent.Builder setId(String value) { } /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ + * Checks whether the 'id' field has been set. + * @return True if the 'id' field has been set, false otherwise. + */ public boolean hasId() { return fieldSetFlags()[0]; } /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearId() { + * Clears the value of the 'id' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder clearId() { id = null; fieldSetFlags()[0] = false; return this; } /** - * Gets the value of the 'type' field. - * @return The value. - */ + * Gets the value of the 'type' field. + * @return The value. + */ public String getType() { return type; } /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setType(String value) { + * Sets the value of the 'type' field. + * @param value The value of 'type'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder setType(String value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; @@ -381,39 +353,39 @@ public net.consensys.eventeum.TransactionEvent.Builder setType(String value) { } /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ + * Checks whether the 'type' field has been set. + * @return True if the 'type' field has been set, false otherwise. + */ public boolean hasType() { return fieldSetFlags()[1]; } /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearType() { + * Clears the value of the 'type' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder clearType() { type = null; fieldSetFlags()[1] = false; return this; } /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.TransactionDetails getDetails() { + * Gets the value of the 'details' field. + * @return The value. + */ + public io.keyko.monitoring.schemas.TransactionDetails getDetails() { return details; } /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setDetails(net.consensys.eventeum.TransactionDetails value) { + * Sets the value of the 'details' field. + * @param value The value of 'details'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder setDetails(io.keyko.monitoring.schemas.TransactionDetails value) { validate(fields()[2], value); this.detailsBuilder = null; this.details = value; @@ -422,9 +394,9 @@ public net.consensys.eventeum.TransactionEvent.Builder setDetails(net.consensys. } /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ + * Checks whether the 'details' field has been set. + * @return True if the 'details' field has been set, false otherwise. + */ public boolean hasDetails() { return fieldSetFlags()[2]; } @@ -433,12 +405,12 @@ public boolean hasDetails() { * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. * @return This builder. */ - public net.consensys.eventeum.TransactionDetails.Builder getDetailsBuilder() { + public io.keyko.monitoring.schemas.TransactionDetails.Builder getDetailsBuilder() { if (detailsBuilder == null) { if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.TransactionDetails.newBuilder(details)); + setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.newBuilder(details)); } else { - setDetailsBuilder(net.consensys.eventeum.TransactionDetails.newBuilder()); + setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.newBuilder()); } } return detailsBuilder; @@ -449,7 +421,7 @@ public net.consensys.eventeum.TransactionDetails.Builder getDetailsBuilder() { * @param value The builder instance that must be set. * @return This builder. */ - public net.consensys.eventeum.TransactionEvent.Builder setDetailsBuilder(net.consensys.eventeum.TransactionDetails.Builder value) { + public io.keyko.monitoring.schemas.TransactionEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.Builder value) { clearDetails(); detailsBuilder = value; return this; @@ -464,10 +436,10 @@ public boolean hasDetailsBuilder() { } /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearDetails() { + * Clears the value of the 'details' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder clearDetails() { details = null; detailsBuilder = null; fieldSetFlags()[2] = false; @@ -475,20 +447,20 @@ public net.consensys.eventeum.TransactionEvent.Builder clearDetails() { } /** - * Gets the value of the 'retries' field. - * @return The value. - */ + * Gets the value of the 'retries' field. + * @return The value. + */ public int getRetries() { return retries; } /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setRetries(int value) { + * Sets the value of the 'retries' field. + * @param value The value of 'retries'. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder setRetries(int value) { validate(fields()[3], value); this.retries = value; fieldSetFlags()[3] = true; @@ -496,19 +468,19 @@ public net.consensys.eventeum.TransactionEvent.Builder setRetries(int value) { } /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ + * Checks whether the 'retries' field has been set. + * @return True if the 'retries' field has been set, false otherwise. + */ public boolean hasRetries() { return fieldSetFlags()[3]; } /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearRetries() { + * Clears the value of the 'retries' field. + * @return This builder. + */ + public io.keyko.monitoring.schemas.TransactionEvent.Builder clearRetries() { fieldSetFlags()[3] = false; return this; } @@ -528,7 +500,7 @@ public TransactionEvent build() { throw e; } } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.TransactionDetails) defaultValue(fields()[2]); + record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.TransactionDetails) defaultValue(fields()[2]); } record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); return record; @@ -542,32 +514,27 @@ public TransactionEvent build() { @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); + WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - @Override - public void writeExternal(java.io.ObjectOutput out) + @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); + READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - @Override - public void readExternal(java.io.ObjectInput in) + @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } - @Override - protected boolean hasCustomCoders() { - return true; - } + @Override protected boolean hasCustomCoders() { return true; } - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { + @Override public void customEncode(org.apache.avro.io.Encoder out) + throws java.io.IOException + { out.writeString(this.id); out.writeString(this.type); @@ -578,9 +545,9 @@ public void customEncode(org.apache.avro.io.Encoder out) } - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { + @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) + throws java.io.IOException + { org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); if (fieldOrder == null) { this.id = in.readString(); @@ -588,7 +555,7 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) this.type = in.readString(); if (this.details == null) { - this.details = new net.consensys.eventeum.TransactionDetails(); + this.details = new io.keyko.monitoring.schemas.TransactionDetails(); } this.details.customDecode(in); @@ -597,27 +564,27 @@ public void customDecode(org.apache.avro.io.ResolvingDecoder in) } else { for (int i = 0; i < 4; i++) { switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new net.consensys.eventeum.TransactionDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); + case 0: + this.id = in.readString(); + break; + + case 1: + this.type = in.readString(); + break; + + case 2: + if (this.details == null) { + this.details = new io.keyko.monitoring.schemas.TransactionDetails(); + } + this.details.customDecode(in); + break; + + case 3: + this.retries = in.readInt(); + break; + + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); } } } diff --git a/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java b/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java new file mode 100644 index 0000000..c3632af --- /dev/null +++ b/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java @@ -0,0 +1,13 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package io.keyko.monitoring.schemas; +@org.apache.avro.specific.AvroGenerated +public enum TransactionStatus implements org.apache.avro.generic.GenericEnumSymbol { + UNCONFIRMED, CONFIRMED, INVALIDATED, FAILED ; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } + public org.apache.avro.Schema getSchema() { return SCHEMA$; } +} diff --git a/src/main/java/io/keyko/monitoring/serde/EventSerdes.java b/src/main/java/io/keyko/monitoring/serde/EventSerdes.java index 8131e4b..89fb590 100644 --- a/src/main/java/io/keyko/monitoring/serde/EventSerdes.java +++ b/src/main/java/io/keyko/monitoring/serde/EventSerdes.java @@ -1,13 +1,15 @@ package io.keyko.monitoring.serde; import io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; +import io.keyko.monitoring.schemas.AlertEvent; +import io.keyko.monitoring.schemas.BlockEvent; +import io.keyko.monitoring.schemas.ContractEvent; +import io.keyko.monitoring.schemas.EventBlock; public interface EventSerdes { final SpecificAvroSerde eventAvroSerde = new SpecificAvroSerde<>(); final SpecificAvroSerde blockAvroSerde = new SpecificAvroSerde(); final SpecificAvroSerde eventBlockAvroSerde = new SpecificAvroSerde<>(); + final SpecificAvroSerde alertAvroSerde = new SpecificAvroSerde<>(); } diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index 6d34015..89dd614 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -1,13 +1,9 @@ package io.keyko.monitoring.stream; import io.keyko.monitoring.model.AccountCreatedAggregation; +import io.keyko.monitoring.schemas.*; import io.keyko.monitoring.time.EventBlockTimestampExtractor; import io.keyko.monitoring.windows.DailyTimeWindows; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; -import net.consensys.eventeum.NumberParameter; -import net.consensys.eventeum.StringParameter; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.common.utils.Bytes; @@ -149,10 +145,20 @@ private KStream formatAccountCreatedAggregati } - public void alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { - builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) + public KStream alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { + return builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) .filter((key, event) -> ((NumberParameter) event.getDetails().getNonIndexedParameters().get(0)).getValue().equals("0")) - .to("w3m-alerts"); + .map((key, event) -> + KeyValue.pair(key, + AlertEvent.newBuilder() + .setName("alertNoEpochRewardsDistributed") + .setReference(event.getId()) + .setStatus(AlertEventStatus.ERROR) + .setTimestamp(event.getDetailsBlock().getTimestamp()) + .setDescription("NoEpochRewardsDistributed for group: " + ((StringParameter) event.getDetails().getIndexedParameters().get(0)).getValue()) + .build()) + ); +// .to("w3m-alerts"); // .foreach((x, y) -> System.out.println("NoEpochRewardsDistributed for group: " + ((StringParameter) y.getDetails().getIndexedParameters().get(0)).getValue())); } diff --git a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java index 5fba620..921f90a 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java +++ b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java @@ -3,11 +3,12 @@ import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig; import io.keyko.monitoring.config.StreamerConfig; import io.keyko.monitoring.model.AccountCreatedAggregation; +import io.keyko.monitoring.schemas.AlertEvent; +import io.keyko.monitoring.schemas.BlockEvent; +import io.keyko.monitoring.schemas.ContractEvent; +import io.keyko.monitoring.schemas.EventBlock; import io.keyko.monitoring.serde.EventSerdes; import io.keyko.monitoring.serde.JsonPOJOSerde; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.streams.KafkaStreams; @@ -82,6 +83,7 @@ private KafkaStreams createStreams() { eventAvroSerde.configure(serdeConfig, false); blockAvroSerde.configure(serdeConfig, false); eventBlockAvroSerde.configure(serdeConfig, false); + alertAvroSerde.configure(serdeConfig, false); KStream contractEvents = builder.stream(configuration.getContractEventTopic(), Consumed.with(Serdes.String(), eventAvroSerde)); @@ -99,7 +101,8 @@ private KafkaStreams createStreams() { KStream accountsCreatedDayStream = eventProcessor.accountDailyAggregation(accountsTopics, builder, eventBlockAvroSerde); accountsCreatedDayStream.to(configuration.getAccountsAggregationTopic(), Produced.with(Serdes.String(), new JsonPOJOSerde(AccountCreatedAggregation.class))); - eventProcessor.alertNoEpochRewardsDistributed(builder, Collections.singletonList("EpochRewardsDistributedToVoters".toLowerCase()),eventBlockAvroSerde); + KStream alertEventKStream = eventProcessor.alertNoEpochRewardsDistributed(builder, Collections.singletonList("EpochRewardsDistributedToVoters".toLowerCase()), eventBlockAvroSerde); + alertEventKStream.to(configuration.getAlertsTopic(), Produced.with(Serdes.String(),alertAvroSerde)); return new KafkaStreams(builder.build(), this.getStreamConfiguration()); diff --git a/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java b/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java index 449a26b..5243b79 100644 --- a/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java +++ b/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java @@ -1,6 +1,6 @@ package io.keyko.monitoring.time; -import net.consensys.eventeum.EventBlock; +import io.keyko.monitoring.schemas.EventBlock; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.streams.processor.TimestampExtractor; diff --git a/src/main/java/net/consensys/eventeum/ContractEventStatus.java b/src/main/java/net/consensys/eventeum/ContractEventStatus.java deleted file mode 100644 index 84c1287..0000000 --- a/src/main/java/net/consensys/eventeum/ContractEventStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -@org.apache.avro.specific.AvroGenerated -public enum ContractEventStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"namespace\":\"net.consensys.eventeum\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } -} diff --git a/src/main/java/net/consensys/eventeum/TransactionStatus.java b/src/main/java/net/consensys/eventeum/TransactionStatus.java deleted file mode 100644 index 128e8b6..0000000 --- a/src/main/java/net/consensys/eventeum/TransactionStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -@org.apache.avro.specific.AvroGenerated -public enum TransactionStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED, FAILED; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"namespace\":\"net.consensys.eventeum\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } -} diff --git a/src/test/java/io/keyko/monitoring/EventProcessorTest.java b/src/test/java/io/keyko/monitoring/EventProcessorTest.java index b671bdb..fc1f5f8 100644 --- a/src/test/java/io/keyko/monitoring/EventProcessorTest.java +++ b/src/test/java/io/keyko/monitoring/EventProcessorTest.java @@ -2,8 +2,8 @@ import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig; import io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde; +import io.keyko.monitoring.schemas.*; import io.keyko.monitoring.stream.EventProcessor; -import net.consensys.eventeum.*; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.common.serialization.StringDeserializer; @@ -11,6 +11,7 @@ import org.apache.kafka.streams.*; import org.apache.kafka.streams.kstream.KStream; import org.apache.kafka.streams.kstream.KTable; +import org.apache.kafka.streams.kstream.Produced; import org.junit.Before; import org.junit.Test; @@ -73,10 +74,10 @@ public class EventProcessorTest { public EventBlock epochrewardsdistributedtovotersEventWithBlock1 = new EventBlock("45", "", epochrewardsdistributedtovotersDetails1, blockEpochrewardsdistributedtovotersDetails1, 0); - final Serde eventAvroSerde = new SpecificAvroSerde<>(); final Serde blockAvroSerde = new SpecificAvroSerde(); final Serde eventBlockAvroSerde = new SpecificAvroSerde<>(); + final Serde alertAvroSerde = new SpecificAvroSerde<>(); private StreamsBuilder builder; @@ -94,6 +95,7 @@ public void before() { eventAvroSerde.configure(conf, false); blockAvroSerde.configure(conf, false); eventBlockAvroSerde.configure(conf, false); + alertAvroSerde.configure(conf, false); builder = new StreamsBuilder(); } @@ -144,13 +146,16 @@ public void splitConfirmedTopics() { @Test public void shouldReleaseAlertWhenRewardsAreZero() { - new EventProcessor().alertNoEpochRewardsDistributed(builder, Collections.singletonList("epochrewardsdistributedtovoters"), eventBlockAvroSerde); + new EventProcessor().alertNoEpochRewardsDistributed(builder, Collections.singletonList("epochrewardsdistributedtovoters"), eventBlockAvroSerde).to("w3m-alerts", Produced.with(Serdes.String(), alertAvroSerde)); Topology topology = builder.build(); TopologyTestDriver driver = new TopologyTestDriver(topology, config); TestInputTopic inputTopicValidatorRegistered = driver.createInputTopic("epochrewardsdistributedtovoters", new StringSerializer(), eventBlockAvroSerde.serializer()); inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock.getId(), epochrewardsdistributedtovotersEventWithBlock); inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock1.getId(), epochrewardsdistributedtovotersEventWithBlock1); + TestOutputTopic transferTopic = driver.createOutputTopic("w3m-alerts", new StringDeserializer(), alertAvroSerde.deserializer()); + assertEquals(transferTopic.readKeyValue().key,epochrewardsdistributedtovotersEventWithBlock.getId()); + driver.close(); } diff --git a/src/test/resources/application.conf b/src/test/resources/application.conf index c2f3e1d..e126a2e 100644 --- a/src/test/resources/application.conf +++ b/src/test/resources/application.conf @@ -5,7 +5,8 @@ kafka { event-block-topic = "event-block" flat-event-topic = "flat-events" accounts-aggregation-topic = "accounts-created-byday" + alerts-topic = "w3m-alerts" } schema-registry { url = "http://localhost:18081" -} \ No newline at end of file +} From c0141819d675cf682d5363f5e4fadb3cfa11bee9 Mon Sep 17 00:00:00 2001 From: jose pablo Date: Wed, 5 Feb 2020 09:19:15 +0100 Subject: [PATCH 4/7] changed aggregation window --- .../monitoring/stream/EventProcessor.java | 19 ++++++++++--------- src/main/resources/application.conf | 11 ++++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index 89dd614..3657e04 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -15,6 +15,7 @@ import java.time.Duration; import java.time.ZoneId; import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; import java.util.List; import static org.apache.kafka.streams.kstream.Suppressed.BufferConfig.unbounded; @@ -97,15 +98,15 @@ public KStream accountDailyAggregation(List event.getDetails().getName()) .groupByKey(Grouped.with(Serdes.String(), eventBlockAvroSerde)) - .windowedBy(new DailyTimeWindows(zone, windowStartHour, gracePeriod)) - // .windowedBy(TimeWindows.of(Duration.ofSeconds(10))) - .count(Materialized.>with(Serdes.String(), Serdes.Long()) + //.windowedBy(new DailyTimeWindows(zone, windowStartHour, gracePeriod)) + .windowedBy(TimeWindows.of(Duration.ofSeconds(60))) + .count()//Materialized.>with(Serdes.String(), Serdes.Long()) // the default store retention time is 1 day; // need to explicitly increase the retention time // to allow for a 1-day window plus configured grace period - .withRetention(Duration.ofDays(1L).plus(gracePeriod))) + //.withRetention(Duration.ofDays(1L).plus(gracePeriod))) // emits the final count when the window is closed. - .suppress(Suppressed.untilWindowCloses(unbounded())); + //.suppress(Suppressed.untilWindowCloses(unbounded())); ; return formatAccountCreatedAggregation(accountsCreatedDayTable, zone); @@ -133,12 +134,12 @@ private KStream formatAccountCreatedAggregati ); - //DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy - HH:mm:ss Z"); - //String formattedString = windowed.window().startTime().atZone(ZoneOffset.UTC).format(formatter); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy - HH:mm:ss Z"); + String formattedString = windowed.window().startTime().atZone(ZoneOffset.UTC).format(formatter); - //String key = windowed.key().concat("-").concat(formattedString); + String key = windowed.key().concat("-").concat(formattedString); - String key = windowed.key().concat("-").concat(accountCreatedAggregation.getDate()); + //String key = windowed.key().concat("-").concat(accountCreatedAggregation.getDate()); return KeyValue.pair(key, accountCreatedAggregation); }); diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index c2f3e1d..90f8dcc 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,11 +1,12 @@ kafka { bootstrap-server = "localhost:9092" - contract-event-topic = "contract-events" - block-topic = "block-events" - event-block-topic = "event-block" + contract-event-topic = "contract-events_2" + block-topic = "block-events_2" + event-block-topic = "event-block_2" flat-event-topic = "flat-events" - accounts-aggregation-topic = "accounts-created-byday" + accounts-aggregation-topic = "accounts-created-window" + alerts-topic = "alerts" } schema-registry { url = "http://localhost:18081" -} \ No newline at end of file +} From d96c0697106f787535cbaf7249c5a8d67b2809a3 Mon Sep 17 00:00:00 2001 From: jose pablo Date: Wed, 5 Feb 2020 11:53:03 +0100 Subject: [PATCH 5/7] changes --- .../keyko/monitoring/model/AccountCreatedAggregation.java | 8 ++++++++ .../java/io/keyko/monitoring/model/BaseAggregation.java | 2 +- src/main/resources/application.conf | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java b/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java index 5e5a884..718eec5 100644 --- a/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java +++ b/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java @@ -1,9 +1,12 @@ package io.keyko.monitoring.model; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; public class AccountCreatedAggregation extends BaseAggregation { + private static final String DATE_PATTERN = "dd/MM/yyyy HH:mm:ss"; + private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_PATTERN); private String type; @@ -13,6 +16,11 @@ public AccountCreatedAggregation(ZonedDateTime dateTime, Long count, String type } + @Override + protected String formatDateTime(ZonedDateTime datetime) { + return datetime.format(formatter); + } + public String getType() { return type; } diff --git a/src/main/java/io/keyko/monitoring/model/BaseAggregation.java b/src/main/java/io/keyko/monitoring/model/BaseAggregation.java index 210c2eb..55eba0f 100644 --- a/src/main/java/io/keyko/monitoring/model/BaseAggregation.java +++ b/src/main/java/io/keyko/monitoring/model/BaseAggregation.java @@ -19,7 +19,7 @@ public BaseAggregation(ZonedDateTime dateTime, Long count) { } - private String formatDateTime(ZonedDateTime datetime) { + protected String formatDateTime(ZonedDateTime datetime) { return datetime.format(formatter); } diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 90f8dcc..aa01472 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -4,7 +4,7 @@ kafka { block-topic = "block-events_2" event-block-topic = "event-block_2" flat-event-topic = "flat-events" - accounts-aggregation-topic = "accounts-created-window" + accounts-aggregation-topic = "accounts-created-window_minute" alerts-topic = "alerts" } schema-registry { From 31797e0c1eeeb744c2ac2af3f74cfacc0699c8c7 Mon Sep 17 00:00:00 2001 From: jose pablo Date: Thu, 6 Feb 2020 07:34:53 +0100 Subject: [PATCH 6/7] config change --- src/main/resources/application.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index aa01472..a9974cf 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -1,8 +1,8 @@ kafka { bootstrap-server = "localhost:9092" - contract-event-topic = "contract-events_2" - block-topic = "block-events_2" - event-block-topic = "event-block_2" + contract-event-topic = "contract-events" + block-topic = "block-events" + event-block-topic = "event-block" flat-event-topic = "flat-events" accounts-aggregation-topic = "accounts-created-window_minute" alerts-topic = "alerts" From e034a61f4cc3f61b2d17c287c5b9ccb659bb6e72 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Thu, 6 Feb 2020 09:09:29 +0100 Subject: [PATCH 7/7] Use avro schemas dependency --- pom.xml | 287 ++-- .../io/keyko/monitoring/KeykoMonitoring.java | 5 +- .../keyko/monitoring/schemas/AlertEvent.java | 628 -------- .../monitoring/schemas/AlertEventStatus.java | 13 - .../monitoring/schemas/BlockDetails.java | 548 ------- .../keyko/monitoring/schemas/BlockEvent.java | 602 -------- .../monitoring/schemas/ContractEvent.java | 543 ------- .../schemas/ContractEventDetails.java | 1215 ---------------- .../schemas/ContractEventStatus.java | 13 - .../keyko/monitoring/schemas/EventBlock.java | 664 --------- .../monitoring/schemas/NumberParameter.java | 468 ------ .../monitoring/schemas/StringParameter.java | 468 ------ .../schemas/TransactionDetails.java | 1268 ----------------- .../monitoring/schemas/TransactionEvent.java | 602 -------- .../monitoring/schemas/TransactionStatus.java | 13 - .../monitoring/stream/EventProcessor.java | 33 +- .../monitoring/stream/EventStreamManager.java | 3 + 17 files changed, 172 insertions(+), 7201 deletions(-) delete mode 100644 src/main/java/io/keyko/monitoring/schemas/AlertEvent.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/BlockDetails.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/BlockEvent.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/ContractEvent.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/EventBlock.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/NumberParameter.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/StringParameter.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java delete mode 100644 src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java diff --git a/pom.xml b/pom.xml index a549cdc..adf7d60 100644 --- a/pom.xml +++ b/pom.xml @@ -1,152 +1,161 @@ - 4.0.0 - io.keyko.monitoring - keyko-event-streamer - 0.0.1 - 2019 - - 2.4.0 - 1.4.0 - UTF-8 + 4.0.0 + io.keyko.monitoring + keyko-event-streamer + 0.0.1 + 2019 + + 2.4.0 + 5.3.2 + 1.9.1 + 2.13.0 + 20190722 + 1.4.0 + UTF-8 + 0.1.0 + 4.4 + - + + + confluent + https://packages.confluent.io/maven/ + + - - - confluent - https://packages.confluent.io/maven/ - - + + + com.typesafe + config + ${typesafe.config.version} + + + org.apache.kafka + kafka-streams + ${kafka.version} + + + org.apache.kafka + kafka-clients + ${kafka.version} + + + io.confluent + kafka-streams-avro-serde + ${confluent.version} + + + io.confluent + kafka-avro-serializer + ${confluent.version} + + + io.confluent + kafka-schema-registry-client + ${confluent.version} + + + io.confluent + common-config + ${confluent.version} + + + io.confluent + common-utils + ${confluent.version} + + + org.apache.avro + avro + ${avro.version} + + + + org.json + json + ${org.json.version} + + + junit + junit + ${junit.version} + test + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + io.keyko.monitoring + schemas + ${keyko.schemas.version} + + + org.apache.kafka + kafka-streams-test-utils + ${kafka.version} + test + + - - - com.typesafe - config - ${typesafe.config.version} - - - org.apache.kafka - kafka-streams - ${kafka.version} - - - org.apache.kafka - kafka-clients - ${kafka.version} - - - io.confluent - kafka-streams-avro-serde - 5.3.2 - - - io.confluent - kafka-avro-serializer - 5.3.0 - - - io.confluent - kafka-schema-registry-client - 5.3.2 - - - io.confluent - common-config - 5.3.2 - - - io.confluent - common-utils - 5.3.2 - - - org.apache.avro - avro - 1.9.1 - - - - org.json - json - 20190722 - - - com.fasterxml.jackson.module - jackson-module-scala_2.12 - 2.10.1 - - - junit - junit - 4.4 - test - - - org.apache.kafka - kafka-streams-test-utils - ${kafka.version} - test - - - org.mockito - mockito-core - 3.2.4 - test - - + - + - + + org.apache.maven.plugins + maven-shade-plugin + 2.4.3 + + + package + + shade + + + true + allinone + + + *:* + + + + + reference.conf + + + + io.keyko.monitoring.KeykoMonitoring + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + - - org.apache.maven.plugins - maven-shade-plugin - 2.4.3 - - - package - - shade - - - true - allinone - - - *:* - - - - - reference.conf - - - - io.keyko.monitoring.KeykoMonitoring - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 11 - - - - - + diff --git a/src/main/java/io/keyko/monitoring/KeykoMonitoring.java b/src/main/java/io/keyko/monitoring/KeykoMonitoring.java index 01ce69b..218bf1d 100644 --- a/src/main/java/io/keyko/monitoring/KeykoMonitoring.java +++ b/src/main/java/io/keyko/monitoring/KeykoMonitoring.java @@ -4,15 +4,18 @@ import com.typesafe.config.ConfigFactory; import io.keyko.monitoring.config.StreamerConfig; import io.keyko.monitoring.stream.EventStreamManager; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class KeykoMonitoring { + private static final Logger LOGGER = LogManager.getLogger(KeykoMonitoring.class); public static void main(final String[] args) throws Exception { Config config = args.length > 0 ? ConfigFactory.load(args[0]) : ConfigFactory.load(); StreamerConfig streamerConfig = StreamerConfig.getInstance(config); + LOGGER.info("Starting KeykoMonitoring..."); new EventStreamManager(streamerConfig).initStream(); - } } diff --git a/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java b/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java deleted file mode 100644 index 0978bf0..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/AlertEvent.java +++ /dev/null @@ -1,628 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class AlertEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -202773870068325002L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AlertEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"reference\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"AlertEventStatus\",\"symbols\":[\"FATAL\",\"ERROR\",\"WARNING\",\"INFO\",\"DEBUG\"]}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"description\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this AlertEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a AlertEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a AlertEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static AlertEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String name; - @Deprecated public String reference; - @Deprecated public io.keyko.monitoring.schemas.AlertEventStatus status; - @Deprecated public String timestamp; - @Deprecated public String description; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public AlertEvent() {} - - /** - * All-args constructor. - * @param name The new value for name - * @param reference The new value for reference - * @param status The new value for status - * @param timestamp The new value for timestamp - * @param description The new value for description - */ - public AlertEvent(String name, String reference, io.keyko.monitoring.schemas.AlertEventStatus status, String timestamp, String description) { - this.name = name; - this.reference = reference; - this.status = status; - this.timestamp = timestamp; - this.description = description; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return name; - case 1: return reference; - case 2: return status; - case 3: return timestamp; - case 4: return description; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: name = (String)value$; break; - case 1: reference = (String)value$; break; - case 2: status = (io.keyko.monitoring.schemas.AlertEventStatus)value$; break; - case 3: timestamp = (String)value$; break; - case 4: description = (String)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'reference' field. - * @return The value of the 'reference' field. - */ - public String getReference() { - return reference; - } - - - /** - * Sets the value of the 'reference' field. - * @param value the value to set. - */ - public void setReference(String value) { - this.reference = value; - } - - /** - * Gets the value of the 'status' field. - * @return The value of the 'status' field. - */ - public io.keyko.monitoring.schemas.AlertEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value the value to set. - */ - public void setStatus(io.keyko.monitoring.schemas.AlertEventStatus value) { - this.status = value; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value of the 'timestamp' field. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value the value to set. - */ - public void setTimestamp(String value) { - this.timestamp = value; - } - - /** - * Gets the value of the 'description' field. - * @return The value of the 'description' field. - */ - public String getDescription() { - return description; - } - - - /** - * Sets the value of the 'description' field. - * @param value the value to set. - */ - public void setDescription(String value) { - this.description = value; - } - - /** - * Creates a new AlertEvent RecordBuilder. - * @return A new AlertEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder() { - return new io.keyko.monitoring.schemas.AlertEvent.Builder(); - } - - /** - * Creates a new AlertEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new AlertEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder(io.keyko.monitoring.schemas.AlertEvent.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.AlertEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.AlertEvent.Builder(other); - } - } - - /** - * Creates a new AlertEvent RecordBuilder by copying an existing AlertEvent instance. - * @param other The existing instance to copy. - * @return A new AlertEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.AlertEvent.Builder newBuilder(io.keyko.monitoring.schemas.AlertEvent other) { - if (other == null) { - return new io.keyko.monitoring.schemas.AlertEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.AlertEvent.Builder(other); - } - } - - /** - * RecordBuilder for AlertEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String reference; - private io.keyko.monitoring.schemas.AlertEventStatus status; - private String timestamp; - private String description; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.AlertEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.reference)) { - this.reference = data().deepCopy(fields()[1].schema(), other.reference); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.status)) { - this.status = data().deepCopy(fields()[2].schema(), other.status); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[3].schema(), other.timestamp); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (isValidValue(fields()[4], other.description)) { - this.description = data().deepCopy(fields()[4].schema(), other.description); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - } - - /** - * Creates a Builder by copying an existing AlertEvent instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.AlertEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.reference)) { - this.reference = data().deepCopy(fields()[1].schema(), other.reference); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.status)) { - this.status = data().deepCopy(fields()[2].schema(), other.status); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[3].schema(), other.timestamp); - fieldSetFlags()[3] = true; - } - if (isValidValue(fields()[4], other.description)) { - this.description = data().deepCopy(fields()[4].schema(), other.description); - fieldSetFlags()[4] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'reference' field. - * @return The value. - */ - public String getReference() { - return reference; - } - - - /** - * Sets the value of the 'reference' field. - * @param value The value of 'reference'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder setReference(String value) { - validate(fields()[1], value); - this.reference = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'reference' field has been set. - * @return True if the 'reference' field has been set, false otherwise. - */ - public boolean hasReference() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'reference' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder clearReference() { - reference = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'status' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.AlertEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder setStatus(io.keyko.monitoring.schemas.AlertEventStatus value) { - validate(fields()[2], value); - this.status = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ - public boolean hasStatus() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder clearStatus() { - status = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value The value of 'timestamp'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder setTimestamp(String value) { - validate(fields()[3], value); - this.timestamp = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'timestamp' field has been set. - * @return True if the 'timestamp' field has been set, false otherwise. - */ - public boolean hasTimestamp() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'timestamp' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder clearTimestamp() { - timestamp = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'description' field. - * @return The value. - */ - public String getDescription() { - return description; - } - - - /** - * Sets the value of the 'description' field. - * @param value The value of 'description'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder setDescription(String value) { - validate(fields()[4], value); - this.description = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'description' field has been set. - * @return True if the 'description' field has been set, false otherwise. - */ - public boolean hasDescription() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'description' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.AlertEvent.Builder clearDescription() { - description = null; - fieldSetFlags()[4] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public AlertEvent build() { - try { - AlertEvent record = new AlertEvent(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.reference = fieldSetFlags()[1] ? this.reference : (String) defaultValue(fields()[1]); - record.status = fieldSetFlags()[2] ? this.status : (io.keyko.monitoring.schemas.AlertEventStatus) defaultValue(fields()[2]); - record.timestamp = fieldSetFlags()[3] ? this.timestamp : (String) defaultValue(fields()[3]); - record.description = fieldSetFlags()[4] ? this.description : (String) defaultValue(fields()[4]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.name); - - out.writeString(this.reference); - - out.writeEnum(this.status.ordinal()); - - out.writeString(this.timestamp); - - out.writeString(this.description); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.name = in.readString(); - - this.reference = in.readString(); - - this.status = io.keyko.monitoring.schemas.AlertEventStatus.values()[in.readEnum()]; - - this.timestamp = in.readString(); - - this.description = in.readString(); - - } else { - for (int i = 0; i < 5; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; - - case 1: - this.reference = in.readString(); - break; - - case 2: - this.status = io.keyko.monitoring.schemas.AlertEventStatus.values()[in.readEnum()]; - break; - - case 3: - this.timestamp = in.readString(); - break; - - case 4: - this.description = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java b/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java deleted file mode 100644 index 4ac0524..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/AlertEventStatus.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; -@org.apache.avro.specific.AvroGenerated -public enum AlertEventStatus implements org.apache.avro.generic.GenericEnumSymbol { - FATAL, ERROR, WARNING, INFO, DEBUG ; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"AlertEventStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"FATAL\",\"ERROR\",\"WARNING\",\"INFO\",\"DEBUG\"]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } -} diff --git a/src/main/java/io/keyko/monitoring/schemas/BlockDetails.java b/src/main/java/io/keyko/monitoring/schemas/BlockDetails.java deleted file mode 100644 index edd865e..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/BlockDetails.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class BlockDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 6955880457069237337L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this BlockDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a BlockDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a BlockDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static BlockDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String number; - @Deprecated public String hash; - @Deprecated public String timestamp; - @Deprecated public String nodeName; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public BlockDetails() {} - - /** - * All-args constructor. - * @param number The new value for number - * @param hash The new value for hash - * @param timestamp The new value for timestamp - * @param nodeName The new value for nodeName - */ - public BlockDetails(String number, String hash, String timestamp, String nodeName) { - this.number = number; - this.hash = hash; - this.timestamp = timestamp; - this.nodeName = nodeName; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return number; - case 1: return hash; - case 2: return timestamp; - case 3: return nodeName; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: number = (String)value$; break; - case 1: hash = (String)value$; break; - case 2: timestamp = (String)value$; break; - case 3: nodeName = (String)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'number' field. - * @return The value of the 'number' field. - */ - public String getNumber() { - return number; - } - - - /** - * Sets the value of the 'number' field. - * @param value the value to set. - */ - public void setNumber(String value) { - this.number = value; - } - - /** - * Gets the value of the 'hash' field. - * @return The value of the 'hash' field. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value the value to set. - */ - public void setHash(String value) { - this.hash = value; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value of the 'timestamp' field. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value the value to set. - */ - public void setTimestamp(String value) { - this.timestamp = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Creates a new BlockDetails RecordBuilder. - * @return A new BlockDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder() { - return new io.keyko.monitoring.schemas.BlockDetails.Builder(); - } - - /** - * Creates a new BlockDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new BlockDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.BlockDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.BlockDetails.Builder(other); - } - } - - /** - * Creates a new BlockDetails RecordBuilder by copying an existing BlockDetails instance. - * @param other The existing instance to copy. - * @return A new BlockDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockDetails.Builder newBuilder(io.keyko.monitoring.schemas.BlockDetails other) { - if (other == null) { - return new io.keyko.monitoring.schemas.BlockDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.BlockDetails.Builder(other); - } - } - - /** - * RecordBuilder for BlockDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String number; - private String hash; - private String timestamp; - private String nodeName; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.BlockDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.number)) { - this.number = data().deepCopy(fields()[0].schema(), other.number); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.hash)) { - this.hash = data().deepCopy(fields()[1].schema(), other.hash); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[3].schema(), other.nodeName); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing BlockDetails instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.BlockDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.number)) { - this.number = data().deepCopy(fields()[0].schema(), other.number); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.hash)) { - this.hash = data().deepCopy(fields()[1].schema(), other.hash); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[3].schema(), other.nodeName); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'number' field. - * @return The value. - */ - public String getNumber() { - return number; - } - - - /** - * Sets the value of the 'number' field. - * @param value The value of 'number'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder setNumber(String value) { - validate(fields()[0], value); - this.number = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'number' field has been set. - * @return True if the 'number' field has been set, false otherwise. - */ - public boolean hasNumber() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'number' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder clearNumber() { - number = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'hash' field. - * @return The value. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder setHash(String value) { - validate(fields()[1], value); - this.hash = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ - public boolean hasHash() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder clearHash() { - hash = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value The value of 'timestamp'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder setTimestamp(String value) { - validate(fields()[2], value); - this.timestamp = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'timestamp' field has been set. - * @return True if the 'timestamp' field has been set, false otherwise. - */ - public boolean hasTimestamp() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'timestamp' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder clearTimestamp() { - timestamp = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder setNodeName(String value) { - validate(fields()[3], value); - this.nodeName = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public BlockDetails build() { - try { - BlockDetails record = new BlockDetails(); - record.number = fieldSetFlags()[0] ? this.number : (String) defaultValue(fields()[0]); - record.hash = fieldSetFlags()[1] ? this.hash : (String) defaultValue(fields()[1]); - record.timestamp = fieldSetFlags()[2] ? this.timestamp : (String) defaultValue(fields()[2]); - record.nodeName = fieldSetFlags()[3] ? this.nodeName : (String) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.number); - - out.writeString(this.hash); - - out.writeString(this.timestamp); - - out.writeString(this.nodeName); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.number = in.readString(); - - this.hash = in.readString(); - - this.timestamp = in.readString(); - - this.nodeName = in.readString(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.number = in.readString(); - break; - - case 1: - this.hash = in.readString(); - break; - - case 2: - this.timestamp = in.readString(); - break; - - case 3: - this.nodeName = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/BlockEvent.java b/src/main/java/io/keyko/monitoring/schemas/BlockEvent.java deleted file mode 100644 index 50ee003..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/BlockEvent.java +++ /dev/null @@ -1,602 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class BlockEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 7285302814443941338L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this BlockEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a BlockEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a BlockEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static BlockEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String id; - @Deprecated public String type; - @Deprecated public io.keyko.monitoring.schemas.BlockDetails details; - @Deprecated public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public BlockEvent() {} - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public BlockEvent(String id, String type, io.keyko.monitoring.schemas.BlockDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return id; - case 1: return type; - case 2: return details; - case 3: return retries; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: id = (String)value$; break; - case 1: type = (String)value$; break; - case 2: details = (io.keyko.monitoring.schemas.BlockDetails)value$; break; - case 3: retries = (Integer)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public io.keyko.monitoring.schemas.BlockDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(io.keyko.monitoring.schemas.BlockDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new BlockEvent RecordBuilder. - * @return A new BlockEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder() { - return new io.keyko.monitoring.schemas.BlockEvent.Builder(); - } - - /** - * Creates a new BlockEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new BlockEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder(io.keyko.monitoring.schemas.BlockEvent.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.BlockEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.BlockEvent.Builder(other); - } - } - - /** - * Creates a new BlockEvent RecordBuilder by copying an existing BlockEvent instance. - * @param other The existing instance to copy. - * @return A new BlockEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.BlockEvent.Builder newBuilder(io.keyko.monitoring.schemas.BlockEvent other) { - if (other == null) { - return new io.keyko.monitoring.schemas.BlockEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.BlockEvent.Builder(other); - } - } - - /** - * RecordBuilder for BlockEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private io.keyko.monitoring.schemas.BlockDetails details; - private io.keyko.monitoring.schemas.BlockDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.BlockEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = io.keyko.monitoring.schemas.BlockDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing BlockEvent instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.BlockEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.BlockDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder setDetails(io.keyko.monitoring.schemas.BlockDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder(details)); - } else { - setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public BlockEvent build() { - try { - BlockEvent record = new BlockEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.BlockDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.id); - - out.writeString(this.type); - - this.details.customEncode(out); - - out.writeInt(this.retries); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.id = in.readString(); - - this.type = in.readString(); - - if (this.details == null) { - this.details = new io.keyko.monitoring.schemas.BlockDetails(); - } - this.details.customDecode(in); - - this.retries = in.readInt(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new io.keyko.monitoring.schemas.BlockDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/ContractEvent.java b/src/main/java/io/keyko/monitoring/schemas/ContractEvent.java deleted file mode 100644 index 770733d..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/ContractEvent.java +++ /dev/null @@ -1,543 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class ContractEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3492402380681590992L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this ContractEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a ContractEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a ContractEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static ContractEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String id; - @Deprecated public String type; - @Deprecated public io.keyko.monitoring.schemas.ContractEventDetails details; - @Deprecated public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public ContractEvent() {} - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public ContractEvent(String id, String type, io.keyko.monitoring.schemas.ContractEventDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return id; - case 1: return type; - case 2: return details; - case 3: return retries; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: id = (String)value$; break; - case 1: type = (String)value$; break; - case 2: details = (io.keyko.monitoring.schemas.ContractEventDetails)value$; break; - case 3: retries = (Integer)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new ContractEvent RecordBuilder. - * @return A new ContractEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder() { - return new io.keyko.monitoring.schemas.ContractEvent.Builder(); - } - - /** - * Creates a new ContractEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new ContractEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder(io.keyko.monitoring.schemas.ContractEvent.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.ContractEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.ContractEvent.Builder(other); - } - } - - /** - * Creates a new ContractEvent RecordBuilder by copying an existing ContractEvent instance. - * @param other The existing instance to copy. - * @return A new ContractEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEvent.Builder newBuilder(io.keyko.monitoring.schemas.ContractEvent other) { - if (other == null) { - return new io.keyko.monitoring.schemas.ContractEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.ContractEvent.Builder(other); - } - } - - /** - * RecordBuilder for ContractEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private io.keyko.monitoring.schemas.ContractEventDetails details; - private io.keyko.monitoring.schemas.ContractEventDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.ContractEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing ContractEvent instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.ContractEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(details)); - } else { - setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public ContractEvent build() { - try { - ContractEvent record = new ContractEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.ContractEventDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java b/src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java deleted file mode 100644 index 4a7b1d0..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/ContractEventDetails.java +++ /dev/null @@ -1,1215 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class ContractEventDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3202235962030049371L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this ContractEventDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a ContractEventDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a ContractEventDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static ContractEventDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String name; - @Deprecated public String filterId; - @Deprecated public String nodeName; - @Deprecated public java.util.List indexedParameters; - @Deprecated public java.util.List nonIndexedParameters; - @Deprecated public String transactionHash; - @Deprecated public String logIndex; - @Deprecated public String blockNumber; - @Deprecated public String blockHash; - @Deprecated public String address; - @Deprecated public io.keyko.monitoring.schemas.ContractEventStatus status; - @Deprecated public String eventSpecificationSignature; - @Deprecated public String networkName; - @Deprecated public String id; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public ContractEventDetails() {} - - /** - * All-args constructor. - * @param name The new value for name - * @param filterId The new value for filterId - * @param nodeName The new value for nodeName - * @param indexedParameters The new value for indexedParameters - * @param nonIndexedParameters The new value for nonIndexedParameters - * @param transactionHash The new value for transactionHash - * @param logIndex The new value for logIndex - * @param blockNumber The new value for blockNumber - * @param blockHash The new value for blockHash - * @param address The new value for address - * @param status The new value for status - * @param eventSpecificationSignature The new value for eventSpecificationSignature - * @param networkName The new value for networkName - * @param id The new value for id - */ - public ContractEventDetails(String name, String filterId, String nodeName, java.util.List indexedParameters, java.util.List nonIndexedParameters, String transactionHash, String logIndex, String blockNumber, String blockHash, String address, io.keyko.monitoring.schemas.ContractEventStatus status, String eventSpecificationSignature, String networkName, String id) { - this.name = name; - this.filterId = filterId; - this.nodeName = nodeName; - this.indexedParameters = indexedParameters; - this.nonIndexedParameters = nonIndexedParameters; - this.transactionHash = transactionHash; - this.logIndex = logIndex; - this.blockNumber = blockNumber; - this.blockHash = blockHash; - this.address = address; - this.status = status; - this.eventSpecificationSignature = eventSpecificationSignature; - this.networkName = networkName; - this.id = id; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return name; - case 1: return filterId; - case 2: return nodeName; - case 3: return indexedParameters; - case 4: return nonIndexedParameters; - case 5: return transactionHash; - case 6: return logIndex; - case 7: return blockNumber; - case 8: return blockHash; - case 9: return address; - case 10: return status; - case 11: return eventSpecificationSignature; - case 12: return networkName; - case 13: return id; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: name = (String)value$; break; - case 1: filterId = (String)value$; break; - case 2: nodeName = (String)value$; break; - case 3: indexedParameters = (java.util.List)value$; break; - case 4: nonIndexedParameters = (java.util.List)value$; break; - case 5: transactionHash = (String)value$; break; - case 6: logIndex = (String)value$; break; - case 7: blockNumber = (String)value$; break; - case 8: blockHash = (String)value$; break; - case 9: address = (String)value$; break; - case 10: status = (io.keyko.monitoring.schemas.ContractEventStatus)value$; break; - case 11: eventSpecificationSignature = (String)value$; break; - case 12: networkName = (String)value$; break; - case 13: id = (String)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'filterId' field. - * @return The value of the 'filterId' field. - */ - public String getFilterId() { - return filterId; - } - - - /** - * Sets the value of the 'filterId' field. - * @param value the value to set. - */ - public void setFilterId(String value) { - this.filterId = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Gets the value of the 'indexedParameters' field. - * @return The value of the 'indexedParameters' field. - */ - public java.util.List getIndexedParameters() { - return indexedParameters; - } - - - /** - * Sets the value of the 'indexedParameters' field. - * @param value the value to set. - */ - public void setIndexedParameters(java.util.List value) { - this.indexedParameters = value; - } - - /** - * Gets the value of the 'nonIndexedParameters' field. - * @return The value of the 'nonIndexedParameters' field. - */ - public java.util.List getNonIndexedParameters() { - return nonIndexedParameters; - } - - - /** - * Sets the value of the 'nonIndexedParameters' field. - * @param value the value to set. - */ - public void setNonIndexedParameters(java.util.List value) { - this.nonIndexedParameters = value; - } - - /** - * Gets the value of the 'transactionHash' field. - * @return The value of the 'transactionHash' field. - */ - public String getTransactionHash() { - return transactionHash; - } - - - /** - * Sets the value of the 'transactionHash' field. - * @param value the value to set. - */ - public void setTransactionHash(String value) { - this.transactionHash = value; - } - - /** - * Gets the value of the 'logIndex' field. - * @return The value of the 'logIndex' field. - */ - public String getLogIndex() { - return logIndex; - } - - - /** - * Sets the value of the 'logIndex' field. - * @param value the value to set. - */ - public void setLogIndex(String value) { - this.logIndex = value; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value of the 'blockNumber' field. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value the value to set. - */ - public void setBlockNumber(String value) { - this.blockNumber = value; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value of the 'blockHash' field. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value the value to set. - */ - public void setBlockHash(String value) { - this.blockHash = value; - } - - /** - * Gets the value of the 'address' field. - * @return The value of the 'address' field. - */ - public String getAddress() { - return address; - } - - - /** - * Sets the value of the 'address' field. - * @param value the value to set. - */ - public void setAddress(String value) { - this.address = value; - } - - /** - * Gets the value of the 'status' field. - * @return The value of the 'status' field. - */ - public io.keyko.monitoring.schemas.ContractEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value the value to set. - */ - public void setStatus(io.keyko.monitoring.schemas.ContractEventStatus value) { - this.status = value; - } - - /** - * Gets the value of the 'eventSpecificationSignature' field. - * @return The value of the 'eventSpecificationSignature' field. - */ - public String getEventSpecificationSignature() { - return eventSpecificationSignature; - } - - - /** - * Sets the value of the 'eventSpecificationSignature' field. - * @param value the value to set. - */ - public void setEventSpecificationSignature(String value) { - this.eventSpecificationSignature = value; - } - - /** - * Gets the value of the 'networkName' field. - * @return The value of the 'networkName' field. - */ - public String getNetworkName() { - return networkName; - } - - - /** - * Sets the value of the 'networkName' field. - * @param value the value to set. - */ - public void setNetworkName(String value) { - this.networkName = value; - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Creates a new ContractEventDetails RecordBuilder. - * @return A new ContractEventDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder() { - return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); - } - - /** - * Creates a new ContractEventDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new ContractEventDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(other); - } - } - - /** - * Creates a new ContractEventDetails RecordBuilder by copying an existing ContractEventDetails instance. - * @param other The existing instance to copy. - * @return A new ContractEventDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.ContractEventDetails.Builder newBuilder(io.keyko.monitoring.schemas.ContractEventDetails other) { - if (other == null) { - return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.ContractEventDetails.Builder(other); - } - } - - /** - * RecordBuilder for ContractEventDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String filterId; - private String nodeName; - private java.util.List indexedParameters; - private java.util.List nonIndexedParameters; - private String transactionHash; - private String logIndex; - private String blockNumber; - private String blockHash; - private String address; - private io.keyko.monitoring.schemas.ContractEventStatus status; - private String eventSpecificationSignature; - private String networkName; - private String id; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.ContractEventDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.filterId)) { - this.filterId = data().deepCopy(fields()[1].schema(), other.filterId); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[2].schema(), other.nodeName); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.indexedParameters)) { - this.indexedParameters = data().deepCopy(fields()[3].schema(), other.indexedParameters); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (isValidValue(fields()[4], other.nonIndexedParameters)) { - this.nonIndexedParameters = data().deepCopy(fields()[4].schema(), other.nonIndexedParameters); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - if (isValidValue(fields()[5], other.transactionHash)) { - this.transactionHash = data().deepCopy(fields()[5].schema(), other.transactionHash); - fieldSetFlags()[5] = other.fieldSetFlags()[5]; - } - if (isValidValue(fields()[6], other.logIndex)) { - this.logIndex = data().deepCopy(fields()[6].schema(), other.logIndex); - fieldSetFlags()[6] = other.fieldSetFlags()[6]; - } - if (isValidValue(fields()[7], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[7].schema(), other.blockNumber); - fieldSetFlags()[7] = other.fieldSetFlags()[7]; - } - if (isValidValue(fields()[8], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[8].schema(), other.blockHash); - fieldSetFlags()[8] = other.fieldSetFlags()[8]; - } - if (isValidValue(fields()[9], other.address)) { - this.address = data().deepCopy(fields()[9].schema(), other.address); - fieldSetFlags()[9] = other.fieldSetFlags()[9]; - } - if (isValidValue(fields()[10], other.status)) { - this.status = data().deepCopy(fields()[10].schema(), other.status); - fieldSetFlags()[10] = other.fieldSetFlags()[10]; - } - if (isValidValue(fields()[11], other.eventSpecificationSignature)) { - this.eventSpecificationSignature = data().deepCopy(fields()[11].schema(), other.eventSpecificationSignature); - fieldSetFlags()[11] = other.fieldSetFlags()[11]; - } - if (isValidValue(fields()[12], other.networkName)) { - this.networkName = data().deepCopy(fields()[12].schema(), other.networkName); - fieldSetFlags()[12] = other.fieldSetFlags()[12]; - } - if (isValidValue(fields()[13], other.id)) { - this.id = data().deepCopy(fields()[13].schema(), other.id); - fieldSetFlags()[13] = other.fieldSetFlags()[13]; - } - } - - /** - * Creates a Builder by copying an existing ContractEventDetails instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.ContractEventDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.filterId)) { - this.filterId = data().deepCopy(fields()[1].schema(), other.filterId); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[2].schema(), other.nodeName); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.indexedParameters)) { - this.indexedParameters = data().deepCopy(fields()[3].schema(), other.indexedParameters); - fieldSetFlags()[3] = true; - } - if (isValidValue(fields()[4], other.nonIndexedParameters)) { - this.nonIndexedParameters = data().deepCopy(fields()[4].schema(), other.nonIndexedParameters); - fieldSetFlags()[4] = true; - } - if (isValidValue(fields()[5], other.transactionHash)) { - this.transactionHash = data().deepCopy(fields()[5].schema(), other.transactionHash); - fieldSetFlags()[5] = true; - } - if (isValidValue(fields()[6], other.logIndex)) { - this.logIndex = data().deepCopy(fields()[6].schema(), other.logIndex); - fieldSetFlags()[6] = true; - } - if (isValidValue(fields()[7], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[7].schema(), other.blockNumber); - fieldSetFlags()[7] = true; - } - if (isValidValue(fields()[8], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[8].schema(), other.blockHash); - fieldSetFlags()[8] = true; - } - if (isValidValue(fields()[9], other.address)) { - this.address = data().deepCopy(fields()[9].schema(), other.address); - fieldSetFlags()[9] = true; - } - if (isValidValue(fields()[10], other.status)) { - this.status = data().deepCopy(fields()[10].schema(), other.status); - fieldSetFlags()[10] = true; - } - if (isValidValue(fields()[11], other.eventSpecificationSignature)) { - this.eventSpecificationSignature = data().deepCopy(fields()[11].schema(), other.eventSpecificationSignature); - fieldSetFlags()[11] = true; - } - if (isValidValue(fields()[12], other.networkName)) { - this.networkName = data().deepCopy(fields()[12].schema(), other.networkName); - fieldSetFlags()[12] = true; - } - if (isValidValue(fields()[13], other.id)) { - this.id = data().deepCopy(fields()[13].schema(), other.id); - fieldSetFlags()[13] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'filterId' field. - * @return The value. - */ - public String getFilterId() { - return filterId; - } - - - /** - * Sets the value of the 'filterId' field. - * @param value The value of 'filterId'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setFilterId(String value) { - validate(fields()[1], value); - this.filterId = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'filterId' field has been set. - * @return True if the 'filterId' field has been set, false otherwise. - */ - public boolean hasFilterId() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'filterId' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearFilterId() { - filterId = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNodeName(String value) { - validate(fields()[2], value); - this.nodeName = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'indexedParameters' field. - * @return The value. - */ - public java.util.List getIndexedParameters() { - return indexedParameters; - } - - - /** - * Sets the value of the 'indexedParameters' field. - * @param value The value of 'indexedParameters'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setIndexedParameters(java.util.List value) { - validate(fields()[3], value); - this.indexedParameters = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'indexedParameters' field has been set. - * @return True if the 'indexedParameters' field has been set, false otherwise. - */ - public boolean hasIndexedParameters() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'indexedParameters' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearIndexedParameters() { - indexedParameters = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'nonIndexedParameters' field. - * @return The value. - */ - public java.util.List getNonIndexedParameters() { - return nonIndexedParameters; - } - - - /** - * Sets the value of the 'nonIndexedParameters' field. - * @param value The value of 'nonIndexedParameters'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNonIndexedParameters(java.util.List value) { - validate(fields()[4], value); - this.nonIndexedParameters = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'nonIndexedParameters' field has been set. - * @return True if the 'nonIndexedParameters' field has been set, false otherwise. - */ - public boolean hasNonIndexedParameters() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'nonIndexedParameters' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNonIndexedParameters() { - nonIndexedParameters = null; - fieldSetFlags()[4] = false; - return this; - } - - /** - * Gets the value of the 'transactionHash' field. - * @return The value. - */ - public String getTransactionHash() { - return transactionHash; - } - - - /** - * Sets the value of the 'transactionHash' field. - * @param value The value of 'transactionHash'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setTransactionHash(String value) { - validate(fields()[5], value); - this.transactionHash = value; - fieldSetFlags()[5] = true; - return this; - } - - /** - * Checks whether the 'transactionHash' field has been set. - * @return True if the 'transactionHash' field has been set, false otherwise. - */ - public boolean hasTransactionHash() { - return fieldSetFlags()[5]; - } - - - /** - * Clears the value of the 'transactionHash' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearTransactionHash() { - transactionHash = null; - fieldSetFlags()[5] = false; - return this; - } - - /** - * Gets the value of the 'logIndex' field. - * @return The value. - */ - public String getLogIndex() { - return logIndex; - } - - - /** - * Sets the value of the 'logIndex' field. - * @param value The value of 'logIndex'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setLogIndex(String value) { - validate(fields()[6], value); - this.logIndex = value; - fieldSetFlags()[6] = true; - return this; - } - - /** - * Checks whether the 'logIndex' field has been set. - * @return True if the 'logIndex' field has been set, false otherwise. - */ - public boolean hasLogIndex() { - return fieldSetFlags()[6]; - } - - - /** - * Clears the value of the 'logIndex' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearLogIndex() { - logIndex = null; - fieldSetFlags()[6] = false; - return this; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setBlockNumber(String value) { - validate(fields()[7], value); - this.blockNumber = value; - fieldSetFlags()[7] = true; - return this; - } - - /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ - public boolean hasBlockNumber() { - return fieldSetFlags()[7]; - } - - - /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearBlockNumber() { - blockNumber = null; - fieldSetFlags()[7] = false; - return this; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setBlockHash(String value) { - validate(fields()[8], value); - this.blockHash = value; - fieldSetFlags()[8] = true; - return this; - } - - /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ - public boolean hasBlockHash() { - return fieldSetFlags()[8]; - } - - - /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearBlockHash() { - blockHash = null; - fieldSetFlags()[8] = false; - return this; - } - - /** - * Gets the value of the 'address' field. - * @return The value. - */ - public String getAddress() { - return address; - } - - - /** - * Sets the value of the 'address' field. - * @param value The value of 'address'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setAddress(String value) { - validate(fields()[9], value); - this.address = value; - fieldSetFlags()[9] = true; - return this; - } - - /** - * Checks whether the 'address' field has been set. - * @return True if the 'address' field has been set, false otherwise. - */ - public boolean hasAddress() { - return fieldSetFlags()[9]; - } - - - /** - * Clears the value of the 'address' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearAddress() { - address = null; - fieldSetFlags()[9] = false; - return this; - } - - /** - * Gets the value of the 'status' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.ContractEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setStatus(io.keyko.monitoring.schemas.ContractEventStatus value) { - validate(fields()[10], value); - this.status = value; - fieldSetFlags()[10] = true; - return this; - } - - /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ - public boolean hasStatus() { - return fieldSetFlags()[10]; - } - - - /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearStatus() { - status = null; - fieldSetFlags()[10] = false; - return this; - } - - /** - * Gets the value of the 'eventSpecificationSignature' field. - * @return The value. - */ - public String getEventSpecificationSignature() { - return eventSpecificationSignature; - } - - - /** - * Sets the value of the 'eventSpecificationSignature' field. - * @param value The value of 'eventSpecificationSignature'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setEventSpecificationSignature(String value) { - validate(fields()[11], value); - this.eventSpecificationSignature = value; - fieldSetFlags()[11] = true; - return this; - } - - /** - * Checks whether the 'eventSpecificationSignature' field has been set. - * @return True if the 'eventSpecificationSignature' field has been set, false otherwise. - */ - public boolean hasEventSpecificationSignature() { - return fieldSetFlags()[11]; - } - - - /** - * Clears the value of the 'eventSpecificationSignature' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearEventSpecificationSignature() { - eventSpecificationSignature = null; - fieldSetFlags()[11] = false; - return this; - } - - /** - * Gets the value of the 'networkName' field. - * @return The value. - */ - public String getNetworkName() { - return networkName; - } - - - /** - * Sets the value of the 'networkName' field. - * @param value The value of 'networkName'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setNetworkName(String value) { - validate(fields()[12], value); - this.networkName = value; - fieldSetFlags()[12] = true; - return this; - } - - /** - * Checks whether the 'networkName' field has been set. - * @return True if the 'networkName' field has been set, false otherwise. - */ - public boolean hasNetworkName() { - return fieldSetFlags()[12]; - } - - - /** - * Clears the value of the 'networkName' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearNetworkName() { - networkName = null; - fieldSetFlags()[12] = false; - return this; - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder setId(String value) { - validate(fields()[13], value); - this.id = value; - fieldSetFlags()[13] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[13]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder clearId() { - id = null; - fieldSetFlags()[13] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public ContractEventDetails build() { - try { - ContractEventDetails record = new ContractEventDetails(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.filterId = fieldSetFlags()[1] ? this.filterId : (String) defaultValue(fields()[1]); - record.nodeName = fieldSetFlags()[2] ? this.nodeName : (String) defaultValue(fields()[2]); - record.indexedParameters = fieldSetFlags()[3] ? this.indexedParameters : (java.util.List) defaultValue(fields()[3]); - record.nonIndexedParameters = fieldSetFlags()[4] ? this.nonIndexedParameters : (java.util.List) defaultValue(fields()[4]); - record.transactionHash = fieldSetFlags()[5] ? this.transactionHash : (String) defaultValue(fields()[5]); - record.logIndex = fieldSetFlags()[6] ? this.logIndex : (String) defaultValue(fields()[6]); - record.blockNumber = fieldSetFlags()[7] ? this.blockNumber : (String) defaultValue(fields()[7]); - record.blockHash = fieldSetFlags()[8] ? this.blockHash : (String) defaultValue(fields()[8]); - record.address = fieldSetFlags()[9] ? this.address : (String) defaultValue(fields()[9]); - record.status = fieldSetFlags()[10] ? this.status : (io.keyko.monitoring.schemas.ContractEventStatus) defaultValue(fields()[10]); - record.eventSpecificationSignature = fieldSetFlags()[11] ? this.eventSpecificationSignature : (String) defaultValue(fields()[11]); - record.networkName = fieldSetFlags()[12] ? this.networkName : (String) defaultValue(fields()[12]); - record.id = fieldSetFlags()[13] ? this.id : (String) defaultValue(fields()[13]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java b/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java deleted file mode 100644 index 109ea82..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/ContractEventStatus.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; -@org.apache.avro.specific.AvroGenerated -public enum ContractEventStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED ; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } -} diff --git a/src/main/java/io/keyko/monitoring/schemas/EventBlock.java b/src/main/java/io/keyko/monitoring/schemas/EventBlock.java deleted file mode 100644 index 56c06a0..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/EventBlock.java +++ /dev/null @@ -1,664 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class EventBlock extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -2673260571713821605L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EventBlock\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"detailsBlock\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this EventBlock to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a EventBlock from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a EventBlock instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static EventBlock fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String id; - @Deprecated public String type; - @Deprecated public io.keyko.monitoring.schemas.ContractEventDetails details; - @Deprecated public io.keyko.monitoring.schemas.BlockDetails detailsBlock; - @Deprecated public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public EventBlock() {} - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param detailsBlock The new value for detailsBlock - * @param retries The new value for retries - */ - public EventBlock(String id, String type, io.keyko.monitoring.schemas.ContractEventDetails details, io.keyko.monitoring.schemas.BlockDetails detailsBlock, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.detailsBlock = detailsBlock; - this.retries = retries; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return id; - case 1: return type; - case 2: return details; - case 3: return detailsBlock; - case 4: return retries; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: id = (String)value$; break; - case 1: type = (String)value$; break; - case 2: details = (io.keyko.monitoring.schemas.ContractEventDetails)value$; break; - case 3: detailsBlock = (io.keyko.monitoring.schemas.BlockDetails)value$; break; - case 4: retries = (Integer)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'detailsBlock' field. - * @return The value of the 'detailsBlock' field. - */ - public io.keyko.monitoring.schemas.BlockDetails getDetailsBlock() { - return detailsBlock; - } - - - /** - * Sets the value of the 'detailsBlock' field. - * @param value the value to set. - */ - public void setDetailsBlock(io.keyko.monitoring.schemas.BlockDetails value) { - this.detailsBlock = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new EventBlock RecordBuilder. - * @return A new EventBlock RecordBuilder - */ - public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder() { - return new io.keyko.monitoring.schemas.EventBlock.Builder(); - } - - /** - * Creates a new EventBlock RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new EventBlock RecordBuilder - */ - public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder(io.keyko.monitoring.schemas.EventBlock.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.EventBlock.Builder(); - } else { - return new io.keyko.monitoring.schemas.EventBlock.Builder(other); - } - } - - /** - * Creates a new EventBlock RecordBuilder by copying an existing EventBlock instance. - * @param other The existing instance to copy. - * @return A new EventBlock RecordBuilder - */ - public static io.keyko.monitoring.schemas.EventBlock.Builder newBuilder(io.keyko.monitoring.schemas.EventBlock other) { - if (other == null) { - return new io.keyko.monitoring.schemas.EventBlock.Builder(); - } else { - return new io.keyko.monitoring.schemas.EventBlock.Builder(other); - } - } - - /** - * RecordBuilder for EventBlock instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private io.keyko.monitoring.schemas.ContractEventDetails details; - private io.keyko.monitoring.schemas.ContractEventDetails.Builder detailsBuilder; - private io.keyko.monitoring.schemas.BlockDetails detailsBlock; - private io.keyko.monitoring.schemas.BlockDetails.Builder detailsBlockBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.EventBlock.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.detailsBlock)) { - this.detailsBlock = data().deepCopy(fields()[3].schema(), other.detailsBlock); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (other.hasDetailsBlockBuilder()) { - this.detailsBlockBuilder = io.keyko.monitoring.schemas.BlockDetails.newBuilder(other.getDetailsBlockBuilder()); - } - if (isValidValue(fields()[4], other.retries)) { - this.retries = data().deepCopy(fields()[4].schema(), other.retries); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - } - - /** - * Creates a Builder by copying an existing EventBlock instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.EventBlock other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.detailsBlock)) { - this.detailsBlock = data().deepCopy(fields()[3].schema(), other.detailsBlock); - fieldSetFlags()[3] = true; - } - this.detailsBlockBuilder = null; - if (isValidValue(fields()[4], other.retries)) { - this.retries = data().deepCopy(fields()[4].schema(), other.retries); - fieldSetFlags()[4] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setDetails(io.keyko.monitoring.schemas.ContractEventDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public io.keyko.monitoring.schemas.ContractEventDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder(details)); - } else { - setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBuilder(io.keyko.monitoring.schemas.ContractEventDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'detailsBlock' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.BlockDetails getDetailsBlock() { - return detailsBlock; - } - - - /** - * Sets the value of the 'detailsBlock' field. - * @param value The value of 'detailsBlock'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBlock(io.keyko.monitoring.schemas.BlockDetails value) { - validate(fields()[3], value); - this.detailsBlockBuilder = null; - this.detailsBlock = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'detailsBlock' field has been set. - * @return True if the 'detailsBlock' field has been set, false otherwise. - */ - public boolean hasDetailsBlock() { - return fieldSetFlags()[3]; - } - - /** - * Gets the Builder instance for the 'detailsBlock' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public io.keyko.monitoring.schemas.BlockDetails.Builder getDetailsBlockBuilder() { - if (detailsBlockBuilder == null) { - if (hasDetailsBlock()) { - setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder(detailsBlock)); - } else { - setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.newBuilder()); - } - } - return detailsBlockBuilder; - } - - /** - * Sets the Builder instance for the 'detailsBlock' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setDetailsBlockBuilder(io.keyko.monitoring.schemas.BlockDetails.Builder value) { - clearDetailsBlock(); - detailsBlockBuilder = value; - return this; - } - - /** - * Checks whether the 'detailsBlock' field has an active Builder instance - * @return True if the 'detailsBlock' field has an active Builder instance - */ - public boolean hasDetailsBlockBuilder() { - return detailsBlockBuilder != null; - } - - /** - * Clears the value of the 'detailsBlock' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder clearDetailsBlock() { - detailsBlock = null; - detailsBlockBuilder = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder setRetries(int value) { - validate(fields()[4], value); - this.retries = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.EventBlock.Builder clearRetries() { - fieldSetFlags()[4] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public EventBlock build() { - try { - EventBlock record = new EventBlock(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.ContractEventDetails) defaultValue(fields()[2]); - } - if (detailsBlockBuilder != null) { - try { - record.detailsBlock = this.detailsBlockBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("detailsBlock")); - throw e; - } - } else { - record.detailsBlock = fieldSetFlags()[3] ? this.detailsBlock : (io.keyko.monitoring.schemas.BlockDetails) defaultValue(fields()[3]); - } - record.retries = fieldSetFlags()[4] ? this.retries : (Integer) defaultValue(fields()[4]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/NumberParameter.java b/src/main/java/io/keyko/monitoring/schemas/NumberParameter.java deleted file mode 100644 index 3234dcb..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/NumberParameter.java +++ /dev/null @@ -1,468 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class NumberParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 715459069521122234L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"NumberParameter\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this NumberParameter to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a NumberParameter from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a NumberParameter instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static NumberParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String name; - @Deprecated public String type; - @Deprecated public String value; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public NumberParameter() {} - - /** - * All-args constructor. - * @param name The new value for name - * @param type The new value for type - * @param value The new value for value - */ - public NumberParameter(String name, String type, String value) { - this.name = name; - this.type = type; - this.value = value; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return name; - case 1: return type; - case 2: return value; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: name = (String)value$; break; - case 1: type = (String)value$; break; - case 2: value = (String)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Creates a new NumberParameter RecordBuilder. - * @return A new NumberParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder() { - return new io.keyko.monitoring.schemas.NumberParameter.Builder(); - } - - /** - * Creates a new NumberParameter RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new NumberParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder(io.keyko.monitoring.schemas.NumberParameter.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.NumberParameter.Builder(); - } else { - return new io.keyko.monitoring.schemas.NumberParameter.Builder(other); - } - } - - /** - * Creates a new NumberParameter RecordBuilder by copying an existing NumberParameter instance. - * @param other The existing instance to copy. - * @return A new NumberParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.NumberParameter.Builder newBuilder(io.keyko.monitoring.schemas.NumberParameter other) { - if (other == null) { - return new io.keyko.monitoring.schemas.NumberParameter.Builder(); - } else { - return new io.keyko.monitoring.schemas.NumberParameter.Builder(other); - } - } - - /** - * RecordBuilder for NumberParameter instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String type; - private String value; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.NumberParameter.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - } - - /** - * Creates a Builder by copying an existing NumberParameter instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.NumberParameter other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder setValue(String value) { - validate(fields()[2], value); - this.value = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.NumberParameter.Builder clearValue() { - value = null; - fieldSetFlags()[2] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public NumberParameter build() { - try { - NumberParameter record = new NumberParameter(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - record.value = fieldSetFlags()[2] ? this.value : (String) defaultValue(fields()[2]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.name); - - out.writeString(this.type); - - out.writeString(this.value); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.name = in.readString(); - - this.type = in.readString(); - - this.value = in.readString(); - - } else { - for (int i = 0; i < 3; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - this.value = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/StringParameter.java b/src/main/java/io/keyko/monitoring/schemas/StringParameter.java deleted file mode 100644 index 7e551e5..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/StringParameter.java +++ /dev/null @@ -1,468 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class StringParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 3488942165868781980L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"StringParameter\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this StringParameter to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a StringParameter from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a StringParameter instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static StringParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String name; - @Deprecated public String type; - @Deprecated public String value; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public StringParameter() {} - - /** - * All-args constructor. - * @param name The new value for name - * @param type The new value for type - * @param value The new value for value - */ - public StringParameter(String name, String type, String value) { - this.name = name; - this.type = type; - this.value = value; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return name; - case 1: return type; - case 2: return value; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: name = (String)value$; break; - case 1: type = (String)value$; break; - case 2: value = (String)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Creates a new StringParameter RecordBuilder. - * @return A new StringParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder() { - return new io.keyko.monitoring.schemas.StringParameter.Builder(); - } - - /** - * Creates a new StringParameter RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new StringParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder(io.keyko.monitoring.schemas.StringParameter.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.StringParameter.Builder(); - } else { - return new io.keyko.monitoring.schemas.StringParameter.Builder(other); - } - } - - /** - * Creates a new StringParameter RecordBuilder by copying an existing StringParameter instance. - * @param other The existing instance to copy. - * @return A new StringParameter RecordBuilder - */ - public static io.keyko.monitoring.schemas.StringParameter.Builder newBuilder(io.keyko.monitoring.schemas.StringParameter other) { - if (other == null) { - return new io.keyko.monitoring.schemas.StringParameter.Builder(); - } else { - return new io.keyko.monitoring.schemas.StringParameter.Builder(other); - } - } - - /** - * RecordBuilder for StringParameter instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String type; - private String value; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.StringParameter.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - } - - /** - * Creates a Builder by copying an existing StringParameter instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.StringParameter other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder setValue(String value) { - validate(fields()[2], value); - this.value = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.StringParameter.Builder clearValue() { - value = null; - fieldSetFlags()[2] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public StringParameter build() { - try { - StringParameter record = new StringParameter(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - record.value = fieldSetFlags()[2] ? this.value : (String) defaultValue(fields()[2]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.name); - - out.writeString(this.type); - - out.writeString(this.value); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.name = in.readString(); - - this.type = in.readString(); - - this.value = in.readString(); - - } else { - for (int i = 0; i < 3; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - this.value = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java b/src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java deleted file mode 100644 index 5ae37dd..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/TransactionDetails.java +++ /dev/null @@ -1,1268 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class TransactionDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -349061294898434206L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionDetails\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this TransactionDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a TransactionDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a TransactionDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static TransactionDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String hash; - @Deprecated public String nonce; - @Deprecated public String blockNumber; - @Deprecated public String blockHash; - @Deprecated public String transactionIndex; - @Deprecated public String from; - @Deprecated public String to; - @Deprecated public String value; - @Deprecated public String nodeName; - @Deprecated public String contractAddress; - @Deprecated public String input; - @Deprecated public String revertReason; - @Deprecated public io.keyko.monitoring.schemas.TransactionStatus status; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public TransactionDetails() {} - - /** - * All-args constructor. - * @param hash The new value for hash - * @param nonce The new value for nonce - * @param blockNumber The new value for blockNumber - * @param blockHash The new value for blockHash - * @param transactionIndex The new value for transactionIndex - * @param from The new value for from - * @param to The new value for to - * @param value The new value for value - * @param nodeName The new value for nodeName - * @param contractAddress The new value for contractAddress - * @param input The new value for input - * @param revertReason The new value for revertReason - * @param status The new value for status - */ - public TransactionDetails(String hash, String nonce, String blockNumber, String blockHash, String transactionIndex, String from, String to, String value, String nodeName, String contractAddress, String input, String revertReason, io.keyko.monitoring.schemas.TransactionStatus status) { - this.hash = hash; - this.nonce = nonce; - this.blockNumber = blockNumber; - this.blockHash = blockHash; - this.transactionIndex = transactionIndex; - this.from = from; - this.to = to; - this.value = value; - this.nodeName = nodeName; - this.contractAddress = contractAddress; - this.input = input; - this.revertReason = revertReason; - this.status = status; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return hash; - case 1: return nonce; - case 2: return blockNumber; - case 3: return blockHash; - case 4: return transactionIndex; - case 5: return from; - case 6: return to; - case 7: return value; - case 8: return nodeName; - case 9: return contractAddress; - case 10: return input; - case 11: return revertReason; - case 12: return status; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: hash = (String)value$; break; - case 1: nonce = (String)value$; break; - case 2: blockNumber = (String)value$; break; - case 3: blockHash = (String)value$; break; - case 4: transactionIndex = (String)value$; break; - case 5: from = (String)value$; break; - case 6: to = (String)value$; break; - case 7: value = (String)value$; break; - case 8: nodeName = (String)value$; break; - case 9: contractAddress = (String)value$; break; - case 10: input = (String)value$; break; - case 11: revertReason = (String)value$; break; - case 12: status = (io.keyko.monitoring.schemas.TransactionStatus)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'hash' field. - * @return The value of the 'hash' field. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value the value to set. - */ - public void setHash(String value) { - this.hash = value; - } - - /** - * Gets the value of the 'nonce' field. - * @return The value of the 'nonce' field. - */ - public String getNonce() { - return nonce; - } - - - /** - * Sets the value of the 'nonce' field. - * @param value the value to set. - */ - public void setNonce(String value) { - this.nonce = value; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value of the 'blockNumber' field. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value the value to set. - */ - public void setBlockNumber(String value) { - this.blockNumber = value; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value of the 'blockHash' field. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value the value to set. - */ - public void setBlockHash(String value) { - this.blockHash = value; - } - - /** - * Gets the value of the 'transactionIndex' field. - * @return The value of the 'transactionIndex' field. - */ - public String getTransactionIndex() { - return transactionIndex; - } - - - /** - * Sets the value of the 'transactionIndex' field. - * @param value the value to set. - */ - public void setTransactionIndex(String value) { - this.transactionIndex = value; - } - - /** - * Gets the value of the 'from' field. - * @return The value of the 'from' field. - */ - public String getFrom() { - return from; - } - - - /** - * Sets the value of the 'from' field. - * @param value the value to set. - */ - public void setFrom(String value) { - this.from = value; - } - - /** - * Gets the value of the 'to' field. - * @return The value of the 'to' field. - */ - public String getTo() { - return to; - } - - - /** - * Sets the value of the 'to' field. - * @param value the value to set. - */ - public void setTo(String value) { - this.to = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Gets the value of the 'contractAddress' field. - * @return The value of the 'contractAddress' field. - */ - public String getContractAddress() { - return contractAddress; - } - - - /** - * Sets the value of the 'contractAddress' field. - * @param value the value to set. - */ - public void setContractAddress(String value) { - this.contractAddress = value; - } - - /** - * Gets the value of the 'input' field. - * @return The value of the 'input' field. - */ - public String getInput() { - return input; - } - - - /** - * Sets the value of the 'input' field. - * @param value the value to set. - */ - public void setInput(String value) { - this.input = value; - } - - /** - * Gets the value of the 'revertReason' field. - * @return The value of the 'revertReason' field. - */ - public String getRevertReason() { - return revertReason; - } - - - /** - * Sets the value of the 'revertReason' field. - * @param value the value to set. - */ - public void setRevertReason(String value) { - this.revertReason = value; - } - - /** - * Gets the value of the 'status' field. - * @return The value of the 'status' field. - */ - public io.keyko.monitoring.schemas.TransactionStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value the value to set. - */ - public void setStatus(io.keyko.monitoring.schemas.TransactionStatus value) { - this.status = value; - } - - /** - * Creates a new TransactionDetails RecordBuilder. - * @return A new TransactionDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder() { - return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); - } - - /** - * Creates a new TransactionDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new TransactionDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder(io.keyko.monitoring.schemas.TransactionDetails.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.TransactionDetails.Builder(other); - } - } - - /** - * Creates a new TransactionDetails RecordBuilder by copying an existing TransactionDetails instance. - * @param other The existing instance to copy. - * @return A new TransactionDetails RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionDetails.Builder newBuilder(io.keyko.monitoring.schemas.TransactionDetails other) { - if (other == null) { - return new io.keyko.monitoring.schemas.TransactionDetails.Builder(); - } else { - return new io.keyko.monitoring.schemas.TransactionDetails.Builder(other); - } - } - - /** - * RecordBuilder for TransactionDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String hash; - private String nonce; - private String blockNumber; - private String blockHash; - private String transactionIndex; - private String from; - private String to; - private String value; - private String nodeName; - private String contractAddress; - private String input; - private String revertReason; - private io.keyko.monitoring.schemas.TransactionStatus status; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.TransactionDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.hash)) { - this.hash = data().deepCopy(fields()[0].schema(), other.hash); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.nonce)) { - this.nonce = data().deepCopy(fields()[1].schema(), other.nonce); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[2].schema(), other.blockNumber); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[3].schema(), other.blockHash); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (isValidValue(fields()[4], other.transactionIndex)) { - this.transactionIndex = data().deepCopy(fields()[4].schema(), other.transactionIndex); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - if (isValidValue(fields()[5], other.from)) { - this.from = data().deepCopy(fields()[5].schema(), other.from); - fieldSetFlags()[5] = other.fieldSetFlags()[5]; - } - if (isValidValue(fields()[6], other.to)) { - this.to = data().deepCopy(fields()[6].schema(), other.to); - fieldSetFlags()[6] = other.fieldSetFlags()[6]; - } - if (isValidValue(fields()[7], other.value)) { - this.value = data().deepCopy(fields()[7].schema(), other.value); - fieldSetFlags()[7] = other.fieldSetFlags()[7]; - } - if (isValidValue(fields()[8], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[8].schema(), other.nodeName); - fieldSetFlags()[8] = other.fieldSetFlags()[8]; - } - if (isValidValue(fields()[9], other.contractAddress)) { - this.contractAddress = data().deepCopy(fields()[9].schema(), other.contractAddress); - fieldSetFlags()[9] = other.fieldSetFlags()[9]; - } - if (isValidValue(fields()[10], other.input)) { - this.input = data().deepCopy(fields()[10].schema(), other.input); - fieldSetFlags()[10] = other.fieldSetFlags()[10]; - } - if (isValidValue(fields()[11], other.revertReason)) { - this.revertReason = data().deepCopy(fields()[11].schema(), other.revertReason); - fieldSetFlags()[11] = other.fieldSetFlags()[11]; - } - if (isValidValue(fields()[12], other.status)) { - this.status = data().deepCopy(fields()[12].schema(), other.status); - fieldSetFlags()[12] = other.fieldSetFlags()[12]; - } - } - - /** - * Creates a Builder by copying an existing TransactionDetails instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.TransactionDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.hash)) { - this.hash = data().deepCopy(fields()[0].schema(), other.hash); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.nonce)) { - this.nonce = data().deepCopy(fields()[1].schema(), other.nonce); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[2].schema(), other.blockNumber); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[3].schema(), other.blockHash); - fieldSetFlags()[3] = true; - } - if (isValidValue(fields()[4], other.transactionIndex)) { - this.transactionIndex = data().deepCopy(fields()[4].schema(), other.transactionIndex); - fieldSetFlags()[4] = true; - } - if (isValidValue(fields()[5], other.from)) { - this.from = data().deepCopy(fields()[5].schema(), other.from); - fieldSetFlags()[5] = true; - } - if (isValidValue(fields()[6], other.to)) { - this.to = data().deepCopy(fields()[6].schema(), other.to); - fieldSetFlags()[6] = true; - } - if (isValidValue(fields()[7], other.value)) { - this.value = data().deepCopy(fields()[7].schema(), other.value); - fieldSetFlags()[7] = true; - } - if (isValidValue(fields()[8], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[8].schema(), other.nodeName); - fieldSetFlags()[8] = true; - } - if (isValidValue(fields()[9], other.contractAddress)) { - this.contractAddress = data().deepCopy(fields()[9].schema(), other.contractAddress); - fieldSetFlags()[9] = true; - } - if (isValidValue(fields()[10], other.input)) { - this.input = data().deepCopy(fields()[10].schema(), other.input); - fieldSetFlags()[10] = true; - } - if (isValidValue(fields()[11], other.revertReason)) { - this.revertReason = data().deepCopy(fields()[11].schema(), other.revertReason); - fieldSetFlags()[11] = true; - } - if (isValidValue(fields()[12], other.status)) { - this.status = data().deepCopy(fields()[12].schema(), other.status); - fieldSetFlags()[12] = true; - } - } - - /** - * Gets the value of the 'hash' field. - * @return The value. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setHash(String value) { - validate(fields()[0], value); - this.hash = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ - public boolean hasHash() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearHash() { - hash = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'nonce' field. - * @return The value. - */ - public String getNonce() { - return nonce; - } - - - /** - * Sets the value of the 'nonce' field. - * @param value The value of 'nonce'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setNonce(String value) { - validate(fields()[1], value); - this.nonce = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'nonce' field has been set. - * @return True if the 'nonce' field has been set, false otherwise. - */ - public boolean hasNonce() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'nonce' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearNonce() { - nonce = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setBlockNumber(String value) { - validate(fields()[2], value); - this.blockNumber = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ - public boolean hasBlockNumber() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearBlockNumber() { - blockNumber = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setBlockHash(String value) { - validate(fields()[3], value); - this.blockHash = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ - public boolean hasBlockHash() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearBlockHash() { - blockHash = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'transactionIndex' field. - * @return The value. - */ - public String getTransactionIndex() { - return transactionIndex; - } - - - /** - * Sets the value of the 'transactionIndex' field. - * @param value The value of 'transactionIndex'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setTransactionIndex(String value) { - validate(fields()[4], value); - this.transactionIndex = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'transactionIndex' field has been set. - * @return True if the 'transactionIndex' field has been set, false otherwise. - */ - public boolean hasTransactionIndex() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'transactionIndex' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearTransactionIndex() { - transactionIndex = null; - fieldSetFlags()[4] = false; - return this; - } - - /** - * Gets the value of the 'from' field. - * @return The value. - */ - public String getFrom() { - return from; - } - - - /** - * Sets the value of the 'from' field. - * @param value The value of 'from'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setFrom(String value) { - validate(fields()[5], value); - this.from = value; - fieldSetFlags()[5] = true; - return this; - } - - /** - * Checks whether the 'from' field has been set. - * @return True if the 'from' field has been set, false otherwise. - */ - public boolean hasFrom() { - return fieldSetFlags()[5]; - } - - - /** - * Clears the value of the 'from' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearFrom() { - from = null; - fieldSetFlags()[5] = false; - return this; - } - - /** - * Gets the value of the 'to' field. - * @return The value. - */ - public String getTo() { - return to; - } - - - /** - * Sets the value of the 'to' field. - * @param value The value of 'to'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setTo(String value) { - validate(fields()[6], value); - this.to = value; - fieldSetFlags()[6] = true; - return this; - } - - /** - * Checks whether the 'to' field has been set. - * @return True if the 'to' field has been set, false otherwise. - */ - public boolean hasTo() { - return fieldSetFlags()[6]; - } - - - /** - * Clears the value of the 'to' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearTo() { - to = null; - fieldSetFlags()[6] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setValue(String value) { - validate(fields()[7], value); - this.value = value; - fieldSetFlags()[7] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[7]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearValue() { - value = null; - fieldSetFlags()[7] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setNodeName(String value) { - validate(fields()[8], value); - this.nodeName = value; - fieldSetFlags()[8] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[8]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[8] = false; - return this; - } - - /** - * Gets the value of the 'contractAddress' field. - * @return The value. - */ - public String getContractAddress() { - return contractAddress; - } - - - /** - * Sets the value of the 'contractAddress' field. - * @param value The value of 'contractAddress'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setContractAddress(String value) { - validate(fields()[9], value); - this.contractAddress = value; - fieldSetFlags()[9] = true; - return this; - } - - /** - * Checks whether the 'contractAddress' field has been set. - * @return True if the 'contractAddress' field has been set, false otherwise. - */ - public boolean hasContractAddress() { - return fieldSetFlags()[9]; - } - - - /** - * Clears the value of the 'contractAddress' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearContractAddress() { - contractAddress = null; - fieldSetFlags()[9] = false; - return this; - } - - /** - * Gets the value of the 'input' field. - * @return The value. - */ - public String getInput() { - return input; - } - - - /** - * Sets the value of the 'input' field. - * @param value The value of 'input'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setInput(String value) { - validate(fields()[10], value); - this.input = value; - fieldSetFlags()[10] = true; - return this; - } - - /** - * Checks whether the 'input' field has been set. - * @return True if the 'input' field has been set, false otherwise. - */ - public boolean hasInput() { - return fieldSetFlags()[10]; - } - - - /** - * Clears the value of the 'input' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearInput() { - input = null; - fieldSetFlags()[10] = false; - return this; - } - - /** - * Gets the value of the 'revertReason' field. - * @return The value. - */ - public String getRevertReason() { - return revertReason; - } - - - /** - * Sets the value of the 'revertReason' field. - * @param value The value of 'revertReason'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setRevertReason(String value) { - validate(fields()[11], value); - this.revertReason = value; - fieldSetFlags()[11] = true; - return this; - } - - /** - * Checks whether the 'revertReason' field has been set. - * @return True if the 'revertReason' field has been set, false otherwise. - */ - public boolean hasRevertReason() { - return fieldSetFlags()[11]; - } - - - /** - * Clears the value of the 'revertReason' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearRevertReason() { - revertReason = null; - fieldSetFlags()[11] = false; - return this; - } - - /** - * Gets the value of the 'status' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.TransactionStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder setStatus(io.keyko.monitoring.schemas.TransactionStatus value) { - validate(fields()[12], value); - this.status = value; - fieldSetFlags()[12] = true; - return this; - } - - /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ - public boolean hasStatus() { - return fieldSetFlags()[12]; - } - - - /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder clearStatus() { - status = null; - fieldSetFlags()[12] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public TransactionDetails build() { - try { - TransactionDetails record = new TransactionDetails(); - record.hash = fieldSetFlags()[0] ? this.hash : (String) defaultValue(fields()[0]); - record.nonce = fieldSetFlags()[1] ? this.nonce : (String) defaultValue(fields()[1]); - record.blockNumber = fieldSetFlags()[2] ? this.blockNumber : (String) defaultValue(fields()[2]); - record.blockHash = fieldSetFlags()[3] ? this.blockHash : (String) defaultValue(fields()[3]); - record.transactionIndex = fieldSetFlags()[4] ? this.transactionIndex : (String) defaultValue(fields()[4]); - record.from = fieldSetFlags()[5] ? this.from : (String) defaultValue(fields()[5]); - record.to = fieldSetFlags()[6] ? this.to : (String) defaultValue(fields()[6]); - record.value = fieldSetFlags()[7] ? this.value : (String) defaultValue(fields()[7]); - record.nodeName = fieldSetFlags()[8] ? this.nodeName : (String) defaultValue(fields()[8]); - record.contractAddress = fieldSetFlags()[9] ? this.contractAddress : (String) defaultValue(fields()[9]); - record.input = fieldSetFlags()[10] ? this.input : (String) defaultValue(fields()[10]); - record.revertReason = fieldSetFlags()[11] ? this.revertReason : (String) defaultValue(fields()[11]); - record.status = fieldSetFlags()[12] ? this.status : (io.keyko.monitoring.schemas.TransactionStatus) defaultValue(fields()[12]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.hash); - - out.writeString(this.nonce); - - out.writeString(this.blockNumber); - - out.writeString(this.blockHash); - - out.writeString(this.transactionIndex); - - out.writeString(this.from); - - out.writeString(this.to); - - out.writeString(this.value); - - out.writeString(this.nodeName); - - out.writeString(this.contractAddress); - - out.writeString(this.input); - - out.writeString(this.revertReason); - - out.writeEnum(this.status.ordinal()); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.hash = in.readString(); - - this.nonce = in.readString(); - - this.blockNumber = in.readString(); - - this.blockHash = in.readString(); - - this.transactionIndex = in.readString(); - - this.from = in.readString(); - - this.to = in.readString(); - - this.value = in.readString(); - - this.nodeName = in.readString(); - - this.contractAddress = in.readString(); - - this.input = in.readString(); - - this.revertReason = in.readString(); - - this.status = io.keyko.monitoring.schemas.TransactionStatus.values()[in.readEnum()]; - - } else { - for (int i = 0; i < 13; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.hash = in.readString(); - break; - - case 1: - this.nonce = in.readString(); - break; - - case 2: - this.blockNumber = in.readString(); - break; - - case 3: - this.blockHash = in.readString(); - break; - - case 4: - this.transactionIndex = in.readString(); - break; - - case 5: - this.from = in.readString(); - break; - - case 6: - this.to = in.readString(); - break; - - case 7: - this.value = in.readString(); - break; - - case 8: - this.nodeName = in.readString(); - break; - - case 9: - this.contractAddress = in.readString(); - break; - - case 10: - this.input = in.readString(); - break; - - case 11: - this.revertReason = in.readString(); - break; - - case 12: - this.status = io.keyko.monitoring.schemas.TransactionStatus.values()[in.readEnum()]; - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java b/src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java deleted file mode 100644 index e206f93..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/TransactionEvent.java +++ /dev/null @@ -1,602 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class TransactionEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 220986510352976288L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionEvent\",\"namespace\":\"io.keyko.monitoring.schemas\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"TransactionDetails\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this TransactionEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a TransactionEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a TransactionEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static TransactionEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated public String id; - @Deprecated public String type; - @Deprecated public io.keyko.monitoring.schemas.TransactionDetails details; - @Deprecated public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public TransactionEvent() {} - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public TransactionEvent(String id, String type, io.keyko.monitoring.schemas.TransactionDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public SpecificData getSpecificData() { return MODEL$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: return id; - case 1: return type; - case 2: return details; - case 3: return retries; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value="unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: id = (String)value$; break; - case 1: type = (String)value$; break; - case 2: details = (io.keyko.monitoring.schemas.TransactionDetails)value$; break; - case 3: retries = (Integer)value$; break; - default: throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public io.keyko.monitoring.schemas.TransactionDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(io.keyko.monitoring.schemas.TransactionDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new TransactionEvent RecordBuilder. - * @return A new TransactionEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder() { - return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); - } - - /** - * Creates a new TransactionEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new TransactionEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder(io.keyko.monitoring.schemas.TransactionEvent.Builder other) { - if (other == null) { - return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.TransactionEvent.Builder(other); - } - } - - /** - * Creates a new TransactionEvent RecordBuilder by copying an existing TransactionEvent instance. - * @param other The existing instance to copy. - * @return A new TransactionEvent RecordBuilder - */ - public static io.keyko.monitoring.schemas.TransactionEvent.Builder newBuilder(io.keyko.monitoring.schemas.TransactionEvent other) { - if (other == null) { - return new io.keyko.monitoring.schemas.TransactionEvent.Builder(); - } else { - return new io.keyko.monitoring.schemas.TransactionEvent.Builder(other); - } - } - - /** - * RecordBuilder for TransactionEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private io.keyko.monitoring.schemas.TransactionDetails details; - private io.keyko.monitoring.schemas.TransactionDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(io.keyko.monitoring.schemas.TransactionEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = io.keyko.monitoring.schemas.TransactionDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing TransactionEvent instance - * @param other The existing instance to copy. - */ - private Builder(io.keyko.monitoring.schemas.TransactionEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public io.keyko.monitoring.schemas.TransactionDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder setDetails(io.keyko.monitoring.schemas.TransactionDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.newBuilder(details)); - } else { - setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder setDetailsBuilder(io.keyko.monitoring.schemas.TransactionDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public io.keyko.monitoring.schemas.TransactionEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public TransactionEvent build() { - try { - TransactionEvent record = new TransactionEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (io.keyko.monitoring.schemas.TransactionDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$); - - @Override public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); - - @Override public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override protected boolean hasCustomCoders() { return true; } - - @Override public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException - { - out.writeString(this.id); - - out.writeString(this.type); - - this.details.customEncode(out); - - out.writeInt(this.retries); - - } - - @Override public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException - { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.id = in.readString(); - - this.type = in.readString(); - - if (this.details == null) { - this.details = new io.keyko.monitoring.schemas.TransactionDetails(); - } - this.details.customDecode(in); - - this.retries = in.readInt(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new io.keyko.monitoring.schemas.TransactionDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java b/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java deleted file mode 100644 index c3632af..0000000 --- a/src/main/java/io/keyko/monitoring/schemas/TransactionStatus.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Autogenerated by Avro - * - * DO NOT EDIT DIRECTLY - */ -package io.keyko.monitoring.schemas; -@org.apache.avro.specific.AvroGenerated -public enum TransactionStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED, FAILED ; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"namespace\":\"io.keyko.monitoring.schemas\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}"); - public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } - public org.apache.avro.Schema getSchema() { return SCHEMA$; } -} diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index 3657e04..b575492 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -3,14 +3,11 @@ import io.keyko.monitoring.model.AccountCreatedAggregation; import io.keyko.monitoring.schemas.*; import io.keyko.monitoring.time.EventBlockTimestampExtractor; -import io.keyko.monitoring.windows.DailyTimeWindows; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; -import org.apache.kafka.common.utils.Bytes; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.StreamsBuilder; import org.apache.kafka.streams.kstream.*; -import org.apache.kafka.streams.state.WindowStore; import java.time.Duration; import java.time.ZoneId; @@ -18,15 +15,13 @@ import java.time.format.DateTimeFormatter; import java.util.List; -import static org.apache.kafka.streams.kstream.Suppressed.BufferConfig.unbounded; - public class EventProcessor { /** * Filter the events that has been already confirmed. * * @param contractEvents KStream with the event from the topic contract-events generated by Eventeum - * @return KStream with the events that have been confirmed. + * @return KStream with the events that have been confirmed. */ public KStream filterConfirmed(KStream contractEvents) { return contractEvents @@ -50,7 +45,7 @@ public void splitTopics(KStream confirmedEvents, Serde with the result of join the event with the block corresponding. */ public KStream joinEventWithBlock(KStream eventAvroStream, KTable blockAvroStream, Serde eventAvroSerde, Serde blockAvroSerde) { @@ -77,10 +72,10 @@ public KStream joinEventWithBlock(KStream with the accounts created aggregation. */ public KStream accountDailyAggregation(List topicsToAggregate, StreamsBuilder builder, Serde eventBlockAvroSerde) { @@ -117,9 +112,9 @@ public KStream accountDailyAggregation(List with the accounts created aggregation. */ private KStream formatAccountCreatedAggregation(KTable, Long> accountsCreatedDayTable, ZoneId zone) { @@ -146,6 +141,14 @@ private KStream formatAccountCreatedAggregati } + /** + * Filter the EpochRewardsDistributedToVoters event to release an alert when the + * + * @param builder Stream builder. + * @param EpochRewardsDistributedToVoters List with the name of the topic for the aggregation. + * @param eventBlockAvroSerde EventBlock avro serde. + * @return KStream with the alert event released when the condition is satisfied. + */ public KStream alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { return builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) .filter((key, event) -> ((NumberParameter) event.getDetails().getNonIndexedParameters().get(0)).getValue().equals("0")) @@ -159,8 +162,6 @@ public KStream alertNoEpochRewardsDistributed(StreamsBuilder .setDescription("NoEpochRewardsDistributed for group: " + ((StringParameter) event.getDetails().getIndexedParameters().get(0)).getValue()) .build()) ); -// .to("w3m-alerts"); -// .foreach((x, y) -> System.out.println("NoEpochRewardsDistributed for group: " + ((StringParameter) y.getDetails().getIndexedParameters().get(0)).getValue())); } } diff --git a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java index 921f90a..b9c1513 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java +++ b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java @@ -18,6 +18,8 @@ import org.apache.kafka.streams.kstream.KStream; import org.apache.kafka.streams.kstream.KTable; import org.apache.kafka.streams.kstream.Produced; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.*; @@ -26,6 +28,7 @@ public class EventStreamManager implements EventSerdes { private StreamerConfig configuration; private static final Integer DEFAULT_THREADS = 1; private static final Integer DEFAULT_REPLICATION_FACTOR = 1; + private static final Logger LOGGER = LogManager.getLogger(EventStreamManager.class); public EventStreamManager(StreamerConfig streamerConfig) {