You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2016/03/16 04:44:53 UTC
[43/49] bookkeeper git commit: BOOKKEEPER-769: Remove the Hedwig Code
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/JmsHeader.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/JmsHeader.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/JmsHeader.java
deleted file mode 100644
index c4b5123..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/JmsHeader.java
+++ /dev/null
@@ -1,1126 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: src/main/protobuf/JmsHeader.proto
-
-package org.apache.hedwig.jms.message.header;
-
-public final class JmsHeader {
- private JmsHeader() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- }
- public enum ProtocolVersion
- implements com.google.protobuf.ProtocolMessageEnum {
- VERSION_ONE(0, 1),
- ;
-
- public static final int VERSION_ONE_VALUE = 1;
-
-
- public final int getNumber() { return value; }
-
- public static ProtocolVersion valueOf(int value) {
- switch (value) {
- case 1: return VERSION_ONE;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap<ProtocolVersion>
- internalGetValueMap() {
- return internalValueMap;
- }
- private static com.google.protobuf.Internal.EnumLiteMap<ProtocolVersion>
- internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap<ProtocolVersion>() {
- public ProtocolVersion findValueByNumber(int number) {
- return ProtocolVersion.valueOf(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- return getDescriptor().getValues().get(index);
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return org.apache.hedwig.jms.message.header.JmsHeader.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final ProtocolVersion[] VALUES = {
- VERSION_ONE,
- };
-
- public static ProtocolVersion valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int index;
- private final int value;
-
- private ProtocolVersion(int index, int value) {
- this.index = index;
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:Hedwig.Jms.Header.ProtocolVersion)
- }
-
- public interface JmsValueOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
-
- // required .Hedwig.Jms.Header.JmsValue.ValueType type = 1;
- boolean hasType();
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType getType();
-
- // optional bool booleanValue = 2;
- boolean hasBooleanValue();
- boolean getBooleanValue();
-
- // optional sint32 byteValue = 3;
- boolean hasByteValue();
- int getByteValue();
-
- // optional sint32 shortValue = 4;
- boolean hasShortValue();
- int getShortValue();
-
- // optional sint32 intValue = 5;
- boolean hasIntValue();
- int getIntValue();
-
- // optional sint64 longValue = 6;
- boolean hasLongValue();
- long getLongValue();
-
- // optional float floatValue = 7;
- boolean hasFloatValue();
- float getFloatValue();
-
- // optional double doubleValue = 8;
- boolean hasDoubleValue();
- double getDoubleValue();
-
- // optional string stringValue = 9;
- boolean hasStringValue();
- String getStringValue();
-
- // optional bytes bytesValue = 10;
- boolean hasBytesValue();
- com.google.protobuf.ByteString getBytesValue();
- }
- public static final class JmsValue extends
- com.google.protobuf.GeneratedMessage
- implements JmsValueOrBuilder {
- // Use JmsValue.newBuilder() to construct.
- private JmsValue(Builder builder) {
- super(builder);
- }
- private JmsValue(boolean noInit) {}
-
- private static final JmsValue defaultInstance;
- public static JmsValue getDefaultInstance() {
- return defaultInstance;
- }
-
- public JmsValue getDefaultInstanceForType() {
- return defaultInstance;
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.apache.hedwig.jms.message.header.JmsHeader.internal_static_Hedwig_Jms_Header_JmsValue_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.apache.hedwig.jms.message.header.JmsHeader.internal_static_Hedwig_Jms_Header_JmsValue_fieldAccessorTable;
- }
-
- public enum ValueType
- implements com.google.protobuf.ProtocolMessageEnum {
- BOOLEAN(0, 1),
- BYTE(1, 2),
- SHORT(2, 3),
- INT(3, 4),
- LONG(4, 5),
- FLOAT(5, 6),
- DOUBLE(6, 7),
- STRING(7, 8),
- BYTES(8, 9),
- ;
-
- public static final int BOOLEAN_VALUE = 1;
- public static final int BYTE_VALUE = 2;
- public static final int SHORT_VALUE = 3;
- public static final int INT_VALUE = 4;
- public static final int LONG_VALUE = 5;
- public static final int FLOAT_VALUE = 6;
- public static final int DOUBLE_VALUE = 7;
- public static final int STRING_VALUE = 8;
- public static final int BYTES_VALUE = 9;
-
-
- public final int getNumber() { return value; }
-
- public static ValueType valueOf(int value) {
- switch (value) {
- case 1: return BOOLEAN;
- case 2: return BYTE;
- case 3: return SHORT;
- case 4: return INT;
- case 5: return LONG;
- case 6: return FLOAT;
- case 7: return DOUBLE;
- case 8: return STRING;
- case 9: return BYTES;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap<ValueType>
- internalGetValueMap() {
- return internalValueMap;
- }
- private static com.google.protobuf.Internal.EnumLiteMap<ValueType>
- internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap<ValueType>() {
- public ValueType findValueByNumber(int number) {
- return ValueType.valueOf(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- return getDescriptor().getValues().get(index);
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final ValueType[] VALUES = {
- BOOLEAN, BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, STRING, BYTES,
- };
-
- public static ValueType valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int index;
- private final int value;
-
- private ValueType(int index, int value) {
- this.index = index;
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:Hedwig.Jms.Header.JmsValue.ValueType)
- }
-
- private int bitField0_;
- // required .Hedwig.Jms.Header.JmsValue.ValueType type = 1;
- public static final int TYPE_FIELD_NUMBER = 1;
- private org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType type_;
- public boolean hasType() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType getType() {
- return type_;
- }
-
- // optional bool booleanValue = 2;
- public static final int BOOLEANVALUE_FIELD_NUMBER = 2;
- private boolean booleanValue_;
- public boolean hasBooleanValue() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public boolean getBooleanValue() {
- return booleanValue_;
- }
-
- // optional sint32 byteValue = 3;
- public static final int BYTEVALUE_FIELD_NUMBER = 3;
- private int byteValue_;
- public boolean hasByteValue() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- public int getByteValue() {
- return byteValue_;
- }
-
- // optional sint32 shortValue = 4;
- public static final int SHORTVALUE_FIELD_NUMBER = 4;
- private int shortValue_;
- public boolean hasShortValue() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
- }
- public int getShortValue() {
- return shortValue_;
- }
-
- // optional sint32 intValue = 5;
- public static final int INTVALUE_FIELD_NUMBER = 5;
- private int intValue_;
- public boolean hasIntValue() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
- }
- public int getIntValue() {
- return intValue_;
- }
-
- // optional sint64 longValue = 6;
- public static final int LONGVALUE_FIELD_NUMBER = 6;
- private long longValue_;
- public boolean hasLongValue() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- public long getLongValue() {
- return longValue_;
- }
-
- // optional float floatValue = 7;
- public static final int FLOATVALUE_FIELD_NUMBER = 7;
- private float floatValue_;
- public boolean hasFloatValue() {
- return ((bitField0_ & 0x00000040) == 0x00000040);
- }
- public float getFloatValue() {
- return floatValue_;
- }
-
- // optional double doubleValue = 8;
- public static final int DOUBLEVALUE_FIELD_NUMBER = 8;
- private double doubleValue_;
- public boolean hasDoubleValue() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
- }
- public double getDoubleValue() {
- return doubleValue_;
- }
-
- // optional string stringValue = 9;
- public static final int STRINGVALUE_FIELD_NUMBER = 9;
- private java.lang.Object stringValue_;
- public boolean hasStringValue() {
- return ((bitField0_ & 0x00000100) == 0x00000100);
- }
- public String getStringValue() {
- java.lang.Object ref = stringValue_;
- if (ref instanceof String) {
- return (String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- if (com.google.protobuf.Internal.isValidUtf8(bs)) {
- stringValue_ = s;
- }
- return s;
- }
- }
- private com.google.protobuf.ByteString getStringValueBytes() {
- java.lang.Object ref = stringValue_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8((String) ref);
- stringValue_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- // optional bytes bytesValue = 10;
- public static final int BYTESVALUE_FIELD_NUMBER = 10;
- private com.google.protobuf.ByteString bytesValue_;
- public boolean hasBytesValue() {
- return ((bitField0_ & 0x00000200) == 0x00000200);
- }
- public com.google.protobuf.ByteString getBytesValue() {
- return bytesValue_;
- }
-
- private void initFields() {
- type_ = org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType.BOOLEAN;
- booleanValue_ = false;
- byteValue_ = 0;
- shortValue_ = 0;
- intValue_ = 0;
- longValue_ = 0L;
- floatValue_ = 0F;
- doubleValue_ = 0D;
- stringValue_ = "";
- bytesValue_ = com.google.protobuf.ByteString.EMPTY;
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
-
- if (!hasType()) {
- memoizedIsInitialized = 0;
- return false;
- }
- memoizedIsInitialized = 1;
- return true;
- }
-
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeEnum(1, type_.getNumber());
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeBool(2, booleanValue_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- output.writeSInt32(3, byteValue_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- output.writeSInt32(4, shortValue_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- output.writeSInt32(5, intValue_);
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- output.writeSInt64(6, longValue_);
- }
- if (((bitField0_ & 0x00000040) == 0x00000040)) {
- output.writeFloat(7, floatValue_);
- }
- if (((bitField0_ & 0x00000080) == 0x00000080)) {
- output.writeDouble(8, doubleValue_);
- }
- if (((bitField0_ & 0x00000100) == 0x00000100)) {
- output.writeBytes(9, getStringValueBytes());
- }
- if (((bitField0_ & 0x00000200) == 0x00000200)) {
- output.writeBytes(10, bytesValue_);
- }
- getUnknownFields().writeTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(1, type_.getNumber());
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBoolSize(2, booleanValue_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- size += com.google.protobuf.CodedOutputStream
- .computeSInt32Size(3, byteValue_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- size += com.google.protobuf.CodedOutputStream
- .computeSInt32Size(4, shortValue_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- size += com.google.protobuf.CodedOutputStream
- .computeSInt32Size(5, intValue_);
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- size += com.google.protobuf.CodedOutputStream
- .computeSInt64Size(6, longValue_);
- }
- if (((bitField0_ & 0x00000040) == 0x00000040)) {
- size += com.google.protobuf.CodedOutputStream
- .computeFloatSize(7, floatValue_);
- }
- if (((bitField0_ & 0x00000080) == 0x00000080)) {
- size += com.google.protobuf.CodedOutputStream
- .computeDoubleSize(8, doubleValue_);
- }
- if (((bitField0_ & 0x00000100) == 0x00000100)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(9, getStringValueBytes());
- }
- if (((bitField0_ & 0x00000200) == 0x00000200)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(10, bytesValue_);
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
-
- private static final long serialVersionUID = 0L;
- @java.lang.Override
- protected java.lang.Object writeReplace()
- throws java.io.ObjectStreamException {
- return super.writeReplace();
- }
-
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static org.apache.hedwig.jms.message.header.JmsHeader.JmsValue parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
-
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(org.apache.hedwig.jms.message.header.JmsHeader.JmsValue prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.apache.hedwig.jms.message.header.JmsHeader.JmsValueOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.apache.hedwig.jms.message.header.JmsHeader.internal_static_Hedwig_Jms_Header_JmsValue_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.apache.hedwig.jms.message.header.JmsHeader.internal_static_Hedwig_Jms_Header_JmsValue_fieldAccessorTable;
- }
-
- // Construct using org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
-
- public Builder clear() {
- super.clear();
- type_ = org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType.BOOLEAN;
- bitField0_ = (bitField0_ & ~0x00000001);
- booleanValue_ = false;
- bitField0_ = (bitField0_ & ~0x00000002);
- byteValue_ = 0;
- bitField0_ = (bitField0_ & ~0x00000004);
- shortValue_ = 0;
- bitField0_ = (bitField0_ & ~0x00000008);
- intValue_ = 0;
- bitField0_ = (bitField0_ & ~0x00000010);
- longValue_ = 0L;
- bitField0_ = (bitField0_ & ~0x00000020);
- floatValue_ = 0F;
- bitField0_ = (bitField0_ & ~0x00000040);
- doubleValue_ = 0D;
- bitField0_ = (bitField0_ & ~0x00000080);
- stringValue_ = "";
- bitField0_ = (bitField0_ & ~0x00000100);
- bytesValue_ = com.google.protobuf.ByteString.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000200);
- return this;
- }
-
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
-
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.getDescriptor();
- }
-
- public org.apache.hedwig.jms.message.header.JmsHeader.JmsValue getDefaultInstanceForType() {
- return org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.getDefaultInstance();
- }
-
- public org.apache.hedwig.jms.message.header.JmsHeader.JmsValue build() {
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- private org.apache.hedwig.jms.message.header.JmsHeader.JmsValue buildParsed()
- throws com.google.protobuf.InvalidProtocolBufferException {
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(
- result).asInvalidProtocolBufferException();
- }
- return result;
- }
-
- public org.apache.hedwig.jms.message.header.JmsHeader.JmsValue buildPartial() {
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue result = new org.apache.hedwig.jms.message.header.JmsHeader.JmsValue(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.type_ = type_;
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- result.booleanValue_ = booleanValue_;
- if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
- to_bitField0_ |= 0x00000004;
- }
- result.byteValue_ = byteValue_;
- if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
- to_bitField0_ |= 0x00000008;
- }
- result.shortValue_ = shortValue_;
- if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
- to_bitField0_ |= 0x00000010;
- }
- result.intValue_ = intValue_;
- if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
- to_bitField0_ |= 0x00000020;
- }
- result.longValue_ = longValue_;
- if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
- to_bitField0_ |= 0x00000040;
- }
- result.floatValue_ = floatValue_;
- if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
- to_bitField0_ |= 0x00000080;
- }
- result.doubleValue_ = doubleValue_;
- if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
- to_bitField0_ |= 0x00000100;
- }
- result.stringValue_ = stringValue_;
- if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
- to_bitField0_ |= 0x00000200;
- }
- result.bytesValue_ = bytesValue_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
-
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof org.apache.hedwig.jms.message.header.JmsHeader.JmsValue) {
- return mergeFrom((org.apache.hedwig.jms.message.header.JmsHeader.JmsValue)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(org.apache.hedwig.jms.message.header.JmsHeader.JmsValue other) {
- if (other == org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.getDefaultInstance()) return this;
- if (other.hasType()) {
- setType(other.getType());
- }
- if (other.hasBooleanValue()) {
- setBooleanValue(other.getBooleanValue());
- }
- if (other.hasByteValue()) {
- setByteValue(other.getByteValue());
- }
- if (other.hasShortValue()) {
- setShortValue(other.getShortValue());
- }
- if (other.hasIntValue()) {
- setIntValue(other.getIntValue());
- }
- if (other.hasLongValue()) {
- setLongValue(other.getLongValue());
- }
- if (other.hasFloatValue()) {
- setFloatValue(other.getFloatValue());
- }
- if (other.hasDoubleValue()) {
- setDoubleValue(other.getDoubleValue());
- }
- if (other.hasStringValue()) {
- setStringValue(other.getStringValue());
- }
- if (other.hasBytesValue()) {
- setBytesValue(other.getBytesValue());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
-
- public final boolean isInitialized() {
- if (!hasType()) {
-
- return false;
- }
- return true;
- }
-
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder(
- this.getUnknownFields());
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- }
- break;
- }
- case 8: {
- int rawValue = input.readEnum();
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType value = org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType.valueOf(rawValue);
- if (value == null) {
- unknownFields.mergeVarintField(1, rawValue);
- } else {
- bitField0_ |= 0x00000001;
- type_ = value;
- }
- break;
- }
- case 16: {
- bitField0_ |= 0x00000002;
- booleanValue_ = input.readBool();
- break;
- }
- case 24: {
- bitField0_ |= 0x00000004;
- byteValue_ = input.readSInt32();
- break;
- }
- case 32: {
- bitField0_ |= 0x00000008;
- shortValue_ = input.readSInt32();
- break;
- }
- case 40: {
- bitField0_ |= 0x00000010;
- intValue_ = input.readSInt32();
- break;
- }
- case 48: {
- bitField0_ |= 0x00000020;
- longValue_ = input.readSInt64();
- break;
- }
- case 61: {
- bitField0_ |= 0x00000040;
- floatValue_ = input.readFloat();
- break;
- }
- case 65: {
- bitField0_ |= 0x00000080;
- doubleValue_ = input.readDouble();
- break;
- }
- case 74: {
- bitField0_ |= 0x00000100;
- stringValue_ = input.readBytes();
- break;
- }
- case 82: {
- bitField0_ |= 0x00000200;
- bytesValue_ = input.readBytes();
- break;
- }
- }
- }
- }
-
- private int bitField0_;
-
- // required .Hedwig.Jms.Header.JmsValue.ValueType type = 1;
- private org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType type_ = org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType.BOOLEAN;
- public boolean hasType() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType getType() {
- return type_;
- }
- public Builder setType(org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- type_ = value;
- onChanged();
- return this;
- }
- public Builder clearType() {
- bitField0_ = (bitField0_ & ~0x00000001);
- type_ = org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.ValueType.BOOLEAN;
- onChanged();
- return this;
- }
-
- // optional bool booleanValue = 2;
- private boolean booleanValue_ ;
- public boolean hasBooleanValue() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public boolean getBooleanValue() {
- return booleanValue_;
- }
- public Builder setBooleanValue(boolean value) {
- bitField0_ |= 0x00000002;
- booleanValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearBooleanValue() {
- bitField0_ = (bitField0_ & ~0x00000002);
- booleanValue_ = false;
- onChanged();
- return this;
- }
-
- // optional sint32 byteValue = 3;
- private int byteValue_ ;
- public boolean hasByteValue() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- public int getByteValue() {
- return byteValue_;
- }
- public Builder setByteValue(int value) {
- bitField0_ |= 0x00000004;
- byteValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearByteValue() {
- bitField0_ = (bitField0_ & ~0x00000004);
- byteValue_ = 0;
- onChanged();
- return this;
- }
-
- // optional sint32 shortValue = 4;
- private int shortValue_ ;
- public boolean hasShortValue() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
- }
- public int getShortValue() {
- return shortValue_;
- }
- public Builder setShortValue(int value) {
- bitField0_ |= 0x00000008;
- shortValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearShortValue() {
- bitField0_ = (bitField0_ & ~0x00000008);
- shortValue_ = 0;
- onChanged();
- return this;
- }
-
- // optional sint32 intValue = 5;
- private int intValue_ ;
- public boolean hasIntValue() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
- }
- public int getIntValue() {
- return intValue_;
- }
- public Builder setIntValue(int value) {
- bitField0_ |= 0x00000010;
- intValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearIntValue() {
- bitField0_ = (bitField0_ & ~0x00000010);
- intValue_ = 0;
- onChanged();
- return this;
- }
-
- // optional sint64 longValue = 6;
- private long longValue_ ;
- public boolean hasLongValue() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- public long getLongValue() {
- return longValue_;
- }
- public Builder setLongValue(long value) {
- bitField0_ |= 0x00000020;
- longValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearLongValue() {
- bitField0_ = (bitField0_ & ~0x00000020);
- longValue_ = 0L;
- onChanged();
- return this;
- }
-
- // optional float floatValue = 7;
- private float floatValue_ ;
- public boolean hasFloatValue() {
- return ((bitField0_ & 0x00000040) == 0x00000040);
- }
- public float getFloatValue() {
- return floatValue_;
- }
- public Builder setFloatValue(float value) {
- bitField0_ |= 0x00000040;
- floatValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearFloatValue() {
- bitField0_ = (bitField0_ & ~0x00000040);
- floatValue_ = 0F;
- onChanged();
- return this;
- }
-
- // optional double doubleValue = 8;
- private double doubleValue_ ;
- public boolean hasDoubleValue() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
- }
- public double getDoubleValue() {
- return doubleValue_;
- }
- public Builder setDoubleValue(double value) {
- bitField0_ |= 0x00000080;
- doubleValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearDoubleValue() {
- bitField0_ = (bitField0_ & ~0x00000080);
- doubleValue_ = 0D;
- onChanged();
- return this;
- }
-
- // optional string stringValue = 9;
- private java.lang.Object stringValue_ = "";
- public boolean hasStringValue() {
- return ((bitField0_ & 0x00000100) == 0x00000100);
- }
- public String getStringValue() {
- java.lang.Object ref = stringValue_;
- if (!(ref instanceof String)) {
- String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
- stringValue_ = s;
- return s;
- } else {
- return (String) ref;
- }
- }
- public Builder setStringValue(String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000100;
- stringValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearStringValue() {
- bitField0_ = (bitField0_ & ~0x00000100);
- stringValue_ = getDefaultInstance().getStringValue();
- onChanged();
- return this;
- }
- void setStringValue(com.google.protobuf.ByteString value) {
- bitField0_ |= 0x00000100;
- stringValue_ = value;
- onChanged();
- }
-
- // optional bytes bytesValue = 10;
- private com.google.protobuf.ByteString bytesValue_ = com.google.protobuf.ByteString.EMPTY;
- public boolean hasBytesValue() {
- return ((bitField0_ & 0x00000200) == 0x00000200);
- }
- public com.google.protobuf.ByteString getBytesValue() {
- return bytesValue_;
- }
- public Builder setBytesValue(com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000200;
- bytesValue_ = value;
- onChanged();
- return this;
- }
- public Builder clearBytesValue() {
- bitField0_ = (bitField0_ & ~0x00000200);
- bytesValue_ = getDefaultInstance().getBytesValue();
- onChanged();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:Hedwig.Jms.Header.JmsValue)
- }
-
- static {
- defaultInstance = new JmsValue(true);
- defaultInstance.initFields();
- }
-
- // @@protoc_insertion_point(class_scope:Hedwig.Jms.Header.JmsValue)
- }
-
- private static com.google.protobuf.Descriptors.Descriptor
- internal_static_Hedwig_Jms_Header_JmsValue_descriptor;
- private static
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_Hedwig_Jms_Header_JmsValue_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n!src/main/protobuf/JmsHeader.proto\022\021Hed" +
- "wig.Jms.Header\"\343\002\n\010JmsValue\0223\n\004type\030\001 \002(" +
- "\0162%.Hedwig.Jms.Header.JmsValue.ValueType" +
- "\022\024\n\014booleanValue\030\002 \001(\010\022\021\n\tbyteValue\030\003 \001(" +
- "\021\022\022\n\nshortValue\030\004 \001(\021\022\020\n\010intValue\030\005 \001(\021\022" +
- "\021\n\tlongValue\030\006 \001(\022\022\022\n\nfloatValue\030\007 \001(\002\022\023" +
- "\n\013doubleValue\030\010 \001(\001\022\023\n\013stringValue\030\t \001(\t" +
- "\022\022\n\nbytesValue\030\n \001(\014\"n\n\tValueType\022\013\n\007BOO" +
- "LEAN\020\001\022\010\n\004BYTE\020\002\022\t\n\005SHORT\020\003\022\007\n\003INT\020\004\022\010\n\004" +
- "LONG\020\005\022\t\n\005FLOAT\020\006\022\n\n\006DOUBLE\020\007\022\n\n\006STRING\020",
- "\010\022\t\n\005BYTES\020\t*\"\n\017ProtocolVersion\022\017\n\013VERSI" +
- "ON_ONE\020\001B(\n$org.apache.hedwig.jms.messag" +
- "e.headerH\001"
- };
- com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
- new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
- public com.google.protobuf.ExtensionRegistry assignDescriptors(
- com.google.protobuf.Descriptors.FileDescriptor root) {
- descriptor = root;
- internal_static_Hedwig_Jms_Header_JmsValue_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_Hedwig_Jms_Header_JmsValue_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_Hedwig_Jms_Header_JmsValue_descriptor,
- new java.lang.String[] { "Type", "BooleanValue", "ByteValue", "ShortValue", "IntValue", "LongValue", "FloatValue", "DoubleValue", "StringValue", "BytesValue", },
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.class,
- org.apache.hedwig.jms.message.header.JmsHeader.JmsValue.Builder.class);
- return null;
- }
- };
- com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- }, assigner);
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/MetadataProcessor.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/MetadataProcessor.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/MetadataProcessor.java
deleted file mode 100644
index 38fccd9..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/header/MetadataProcessor.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hedwig.jms.message.header;
-
-import com.google.protobuf.ByteString;
-import com.google.protobuf.InvalidProtocolBufferException;
-import org.apache.hedwig.protocol.PubSubProtocol;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Decouple rest of system from handling metadata/headers in hedwig.
- * Since this part might change (and is shared across the system), changes to it should be isolated from rest of
- * jms provider as much as possible so that they can evolve independently with minimal overlap.
- */
-public class MetadataProcessor {
-
- private final static Logger logger = LoggerFactory.getLogger(MetadataProcessor.class);
-
- public static Map<String, Object> parseHeaders(PubSubProtocol.Message message){
- Map<String, Object> properties = new HashMap<String, Object>();
-
- // if not header or properties, return empty map ...
- if (! message.hasHeader() || ! message.getHeader().hasProperties()) return properties;
-
- // first, populate the map, then remove the standard headers from it.
- for (PubSubProtocol.Map.Entry entry : message.getHeader().getProperties().getEntriesList()){
- final JmsHeader.JmsValue value;
- try {
- ByteString data = entry.getValue();
- value = JmsHeader.JmsValue.parseFrom(data);
- } catch (InvalidProtocolBufferException e) {
- // incorrect type, we cant do much, ignore and continue.
- if (logger.isDebugEnabled()) logger.debug("Cant parse header " +
- entry.getKey() + " as a jms value, ignoring");
- continue;
- }
-
- switch(value.getType()){
- case BOOLEAN:
- properties.put(entry.getKey(), (boolean) value.getBooleanValue());
- break;
- case BYTE:
- properties.put(entry.getKey(), (byte) value.getByteValue());
- break;
- case SHORT:
- properties.put(entry.getKey(), (short) value.getShortValue());
- break;
- case INT:
- properties.put(entry.getKey(), (int) value.getIntValue());
- break;
- case LONG:
- properties.put(entry.getKey(), (long) value.getLongValue());
- break;
- case FLOAT:
- properties.put(entry.getKey(), (float) value.getFloatValue());
- break;
- case DOUBLE:
- properties.put(entry.getKey(), (double) value.getDoubleValue());
- break;
- case STRING:
- properties.put(entry.getKey(), (String) value.getStringValue());
- break;
- case BYTES:
- properties.put(entry.getKey(), value.getBytesValue());
- break;
- default:
- // future addition not yet supported ...
- logger.info("Unknown metadata key type " + value.getType() +
- " ... unsupported by jms provider. Ignoring");
- continue;
- }
- }
- return properties;
- }
-
- public static void addHeaders(PubSubProtocol.Message.Builder builder, Map<String, Object> properties) {
- // Too many builder.addMetadata(...) code in this method, externalize to their own methods ? maybe later ...
- // add the user properties, and then override standard properties.
-
- PubSubProtocol.Map.Builder mapBuilder = PubSubProtocol.Map.newBuilder();
-
- for (Map.Entry<String, Object> entry : properties.entrySet()){
- // ignoring, right ?
- if (null == entry.getValue()) continue;
-
- final JmsHeader.JmsValue.Builder jmsValueBuilder = JmsHeader.JmsValue.newBuilder();
-
- final String key = entry.getKey();
- final Object value = entry.getValue();
- if (value instanceof Boolean){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.BOOLEAN);
- jmsValueBuilder.setBooleanValue((Boolean) value);
- }
- else if (value instanceof Byte){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.BYTE);
- jmsValueBuilder.setByteValue((Byte) value);
- }
- else if (value instanceof Short){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.SHORT);
- jmsValueBuilder.setShortValue((Short) value);
- }
- else if (value instanceof Integer){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.INT);
- jmsValueBuilder.setIntValue((Integer) value);
- }
- else if (value instanceof Long){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.LONG);
- jmsValueBuilder.setLongValue((Long) value);
- }
- else if (value instanceof Float){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.FLOAT);
- jmsValueBuilder.setFloatValue((Float) value);
- }
- else if (value instanceof Double){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.DOUBLE);
- jmsValueBuilder.setDoubleValue((Double) value);
- }
- else if (value instanceof String){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.STRING);
- jmsValueBuilder.setStringValue((String) value);
- }
- else if (value instanceof byte[]){
- jmsValueBuilder.setType(JmsHeader.JmsValue.ValueType.BYTES);
- jmsValueBuilder.setBytesValue(ByteString.copyFrom((byte[]) value));
- }
- else {
- throw new IllegalArgumentException("Unknown property value type ? " + entry);
- }
-
-
- PubSubProtocol.Map.Entry.Builder entryBuilder = PubSubProtocol.Map.Entry.newBuilder();
- entryBuilder.setKey(key);
- entryBuilder.setValue(jmsValueBuilder.build().toByteString());
-
- mapBuilder.addEntries(entryBuilder.build());
- }
-
- PubSubProtocol.MessageHeader.Builder messageHeaderBuilder = PubSubProtocol.MessageHeader.newBuilder();
- messageHeaderBuilder.setProperties(mapBuilder.build());
-
- builder.setHeader(messageHeaderBuilder.build());
- }
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/package-info.html
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/package-info.html b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/package-info.html
deleted file mode 100644
index 0cd78cb..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/message/package-info.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-Contains implementations of various Message's supported by JMS. <br/>
-The implementations take care of these aspects : <br/>
-<ul>
- <li>Provide a JMS compliant implementation for the different messages</li>
- <li>Allows the system to accept and convert Message's NOT created via this package.</li>
- <li>Allows system to generate hedwig wire-format messages from these JMS messages. (taken with above,
- it allows us to send any JMS message over wire).</li>
- <li>Allows system to parse hedwig wire-format messages into JMS messages</li>
-</ul>
-
-Most of the implementation is hidden away and exposed via the MessagUtil - except for what is mandated
-by JMS, and some state information required by hedwig.
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/package-info.html
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/package-info.html b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/package-info.html
deleted file mode 100644
index e015068..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/package-info.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-
-<h3>Introduction</h3>
-
-Contains the basic (hedwig agnostic) aspects of the provider implementation <br/>
-This package enforces (to a large part) the constraints expected by JMS api and maintains state and
-manages the lifecycle of rest of the provider system. <br/>
-<p/>
-It depends only on message package.<br/>
-It is decoupled from actual nitty-gritties of the hedwig specific aspects via a Facade - which
-encapsulates all functionalities required off hedwig. <br/>
-It is envisioned that we will have additional implementations for the facade as time goes by :
-<ul>
- <li>Test mockup facade to test provider aspects decoupled from hedwig</li>
- <li>Facade's to experiment with add and/or modify functionality exposed to provider (support for
- Queue for example without modifying existing code).</li>
- <li>Facade's to experiment with add and/or modify functionality to hedwig itself.</li>
- <li>This space for rent :-)</li>
-</ul>
-
-
-<h3>Missing functionality</h3>
-
-Various aspects of JMS are currently unsupported - the detailed list is long, but the main caveats
-with the provider currently are :
-<ul>
-
- <li>No support for Queues : Hedwig currently does not have a notion of JMS queue's for us to leverage.</li>
-
- <li>No support for noLocal : Hedwig DOES NOT conform to JMS model of
- connection -(n)-> session -(n)-> publisher/subscriber. Each session has a hedwig connection.<br/>
-Currently I am simulating noLocal, but this IS fragile and works for the duration of connection -
- ONLY until the message id is still in a LRUCache. As mentioned before, this is a kludge, and not
- a good solution.<br/>
- </li>
-
- <li>Note that everything is durable in hedwig - so we do not support NON_PERSISTENT delivery mode.</li>
-
- <li>Calling unsubscribe on a durable subscription will fail if it was NOT created in the current session. <br/>
- In hedwig, to unsubscribe, we need the subscription id and the topic ... <br/>
- To simulate unsubscribe(), we store the subscriberId to topicName mapping when a create* api is
- invoked. <br/>
- Hence, if create* was NOT called, then we have no way to infer which topic the subscription-id
- refers to from hedwig, and so cant unsubscribe. <br/>
- The workaround is - simply create a durable subsriber just as a workaround of this limitation -
- the topicName will be known to the user/client anyway.</li>
-
- <li>Explicit session recovery is not supported.<br/>
-Reconnection of hedwig session (either explicitly or implicitly by underlying client implementation) will
-automatically trigger redelivery of un-acknowledged messages.
- </li>
-
- <li>Because of the above, setting the JMSRedelivered flag is almost impossible in a consistent way.<br/>
-Currently, we simulate it for redelivery due to provider side events : rollback of txn, exception
- in message listener (primarily). <br/>
-At best we can simulate it with a kludge - at risk of potentially running out of resources ... this
- is being investigated : but unlikely to have a clean fix. <br/>
- </li>
-
- <li>Hedwig only supports marking all messages until seq-id as received : while JMS indicates abilit
- y to acknowledge individual messages.<br/>
-This distinction is currently unsupported. Investigating if we can do something about it.
- </li>
-
- <li>JMS spec requires
- "A connection's delivery of incoming messages can be temporarily stopped <br/>
-using its stop() method. It can be restarted using its start() method. When the <br/>
-connection is stopped, delivery to all the connection’s MessageConsumers is <br/>
-inhibited: synchronous receives block, and messages are not delivered to <br/>
-MessageListeners."<br/>
- We honour this for undelivered messages from server - but if stop is called while there are
- pending messages yet to be delivered to a listner (or buffered in subscriber for receive),
- then they will be delivered irrespective of stop().</li>
-
-</ul>
-Hopefully I am not missing any of the big points ...
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryArithmeticFunction.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryArithmeticFunction.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryArithmeticFunction.java
deleted file mode 100644
index a2845be..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryArithmeticFunction.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-import org.apache.hedwig.jms.message.MessageImpl;
-
-/**
- * Binary arithematic of values ..
- */
-public abstract class BinaryArithmeticFunction extends BinaryExprFunction {
-
- protected SelectorConstant evaluateImpl(SelectorConstant left, SelectorConstant right,
- MessageImpl message) throws SelectorEvaluationException {
-
- switch (left.type) {
- case INT: {
- switch (right.type) {
- case INT:
- return new SelectorConstant(computeWithInt(left.getIntValue(), right.getIntValue()));
- case DOUBLE:
- return new SelectorConstant(computeWithInt(left.getIntValue(), right.getDoubleValue()));
- default:
- throw new SelectorEvaluationException(getClass() + " Unexpected type : " +
- right.type + ". left : " + left + ", right : " + right);
- }
- }
- case DOUBLE: {
- switch (right.type) {
- case INT:
- return new SelectorConstant(computeWithDouble(left.getDoubleValue(), right.getIntValue()));
- case DOUBLE:
- return new SelectorConstant(computeWithDouble(left.getDoubleValue(), right.getDoubleValue()));
- default:
- throw new SelectorEvaluationException(getClass() + " Unexpected type : " +
- right.type + ". left : " + left + ", right : " + right);
- }
- }
- case BOOLEAN:
- case STRING:
- default:
- throw new SelectorEvaluationException(getClass() + " Unsupported type : " + left.type +
- ". left : " + left + ", right : " + right);
- }
- }
-
-
- protected abstract Double computeWithInt(Integer left, Double right) throws SelectorEvaluationException;
-
- protected abstract Integer computeWithInt(Integer left, Integer right) throws SelectorEvaluationException;
-
- protected abstract Double computeWithDouble(Double left, Double right) throws SelectorEvaluationException;
-
- protected abstract Double computeWithDouble(Double left, Integer right) throws SelectorEvaluationException;
-
-
- public static final BinaryArithmeticFunction ADD_FUNCTION = new BinaryArithmeticFunction() {
- @Override
- protected Double computeWithInt(Integer left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return (double) left + right;
- }
-
- @Override
- protected Integer computeWithInt(Integer left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left + right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left + right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left + (double) right;
- }
- };
-
- public static final BinaryArithmeticFunction SUB_FUNCTION = new BinaryArithmeticFunction() {
- @Override
- protected Double computeWithInt(Integer left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return (double) left - right;
- }
-
- @Override
- protected Integer computeWithInt(Integer left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left - right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left - right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left - (double) right;
- }
- };
-
- public static final BinaryArithmeticFunction MULTIPLY_FUNCTION = new BinaryArithmeticFunction() {
- @Override
- protected Double computeWithInt(Integer left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return (double) left * right;
- }
-
- @Override
- protected Integer computeWithInt(Integer left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left * right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left * right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- return left * (double) right;
- }
- };
-
- public static final BinaryArithmeticFunction DIVIDE_FUNCTION = new BinaryArithmeticFunction() {
- @Override
- protected Double computeWithInt(Integer left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- if ((double) 0 == right) throw new SelectorEvaluationException(getClass() + " denominator == 0");
- return (double) left / right;
- }
-
- @Override
- protected Integer computeWithInt(Integer left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- if ((int) 0 == right) throw new SelectorEvaluationException(getClass() + " denominator == 0");
- return left / right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Double right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- if ((double) 0 == right) throw new SelectorEvaluationException(getClass() + " denominator == 0");
- return left / right;
- }
-
- @Override
- protected Double computeWithDouble(Double left, Integer right) throws SelectorEvaluationException {
- if (null == left || null == right) return null;
- if (0 == right) throw new SelectorEvaluationException(getClass() + " denominator == 0");
- return left / (double) right;
- }
- };
-
-
- @Override
- public String toString(){
- return getClass().getName();
- }
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryExprFunction.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryExprFunction.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryExprFunction.java
deleted file mode 100644
index 6c41b6d..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/BinaryExprFunction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-import org.apache.hedwig.jms.message.MessageImpl;
-
-/**
- * Evaluate binary expressions - where there is a left and right expression to be evaluated.
- */
-public abstract class BinaryExprFunction implements ExprFunction {
-
- public void evaluate(SelectorEvalState state) throws SelectorEvaluationException {
- if (state.getStack().size() < 2)
- throw new SelectorEvaluationException(getClass() + " stack corruption ? " + state.getStack());
-
- SelectorConstant right = state.getStack().pop();
- SelectorConstant left = state.getStack().pop();
-
- SelectorConstant result = evaluateImpl(left, right, state.getMessage());
-
- if (MyNode.logger.isTraceEnabled()) MyNode.logger.trace(getClass() + ": left " + left +
- ", right " + right + " -> " + result);
-
- if (null != result) state.getStack().push(result);
- else throw new SelectorEvaluationException(getClass() +
- " Unexpected to return a null response in binary function evaluation");
- }
-
- protected abstract SelectorConstant evaluateImpl(SelectorConstant left, SelectorConstant right,
- MessageImpl message) throws SelectorEvaluationException;
-
- @Override
- public String toString(){
- return getClass().getName();
- }
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/ExprFunction.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/ExprFunction.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/ExprFunction.java
deleted file mode 100644
index da708e3..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/ExprFunction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-/**
- * All function's referenced in the ast implement this interface to evaluate it result.
- */
-public interface ExprFunction {
- public void evaluate(SelectorEvalState state) throws SelectorEvaluationException;
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/InterpretSelectorParserVisitor.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/InterpretSelectorParserVisitor.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/InterpretSelectorParserVisitor.java
deleted file mode 100644
index 143269f..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/InterpretSelectorParserVisitor.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-/**
- * Visits the AST to evaluate the message (in the SelectorEvalState) against this ast parse tree to see if the
- * message evaluates to true or false (whether to allow message to be submitted or not to consumers).
- */
-public class InterpretSelectorParserVisitor implements SelectorParserVisitor {
- @Override
- public Object visit(SimpleNode node, SelectorEvalState data) throws SelectorEvaluationException {
- throw new SelectorEvaluationException(getClass() + " Should not result in this method being called !");
- }
-
- @Override
- public Object visit(ASTOrExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTAndExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTNotExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTGreaterThan node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTLessThan node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTLessThanEqualTo node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTGreaterThanEqualTo node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTEqualTo node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTNotEqualTo node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTIsNullExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTBetweenExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTInExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTLikeExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTLookupExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTAddExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTSubExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTDivideExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTMultiplyExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTNegateExpr node, SelectorEvalState data) throws SelectorEvaluationException {
- node.childrenAccept(this, data);
- node.getExprFunction().evaluate(data);
- return null;
- }
-
- @Override
- public Object visit(ASTConstant node, SelectorEvalState data) throws SelectorEvaluationException {
- // node.childrenAccept(this, data);
- if (0 != node.jjtGetNumChildren()) throw new SelectorEvaluationException(getClass() +
- " parse error ? " + node);
- data.getStack().push(node.getConstantValue());
- return null;
- }
-
- @Override
- public Object visit(ASTStringVarargParams node, SelectorEvalState data) throws SelectorEvaluationException {
- // node.childrenAccept(this, data);
- if (0 != node.jjtGetNumChildren()) throw new SelectorEvaluationException(getClass() +
- " parse error ? " + node);
- data.getStack().push(node.getConstantValue());
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/LogicalComparisonFunction.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/LogicalComparisonFunction.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/LogicalComparisonFunction.java
deleted file mode 100644
index 4db66f7..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/LogicalComparisonFunction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-import org.apache.hedwig.jms.message.MessageImpl;
-
-/**
- * Logical comparison between two booleans.
- */
-public abstract class LogicalComparisonFunction extends BinaryExprFunction {
- public static final LogicalComparisonFunction AND_FUNCTION = new LogicalComparisonFunction() {
- @Override
- protected Boolean doComparison(Boolean left, Boolean right) {
- if (null == left || null == right) {
- return (Boolean.FALSE.equals(left) || Boolean.FALSE.equals(right)) ? false : null;
- }
- return left && right;
- }
- };
-
- public static final LogicalComparisonFunction OR_FUNCTION = new LogicalComparisonFunction() {
- @Override
- protected Boolean doComparison(Boolean left, Boolean right) {
- if (null == left || null == right) {
- return (Boolean.TRUE.equals(left) || Boolean.TRUE.equals(right)) ? true : null;
- }
-
- return left || right;
- }
- };
-
-
- protected abstract Boolean doComparison(Boolean left, Boolean right);
-
- protected SelectorConstant evaluateImpl(SelectorConstant left, SelectorConstant right,
- MessageImpl message) throws SelectorEvaluationException {
- if (SelectorConstant.SelectorDataType.BOOLEAN != left.type ||
- SelectorConstant.SelectorDataType.BOOLEAN != right.type) {
- throw new SelectorEvaluationException(getClass() + " Invalid value type ? " + left + ", " + right);
- }
-
- return new SelectorConstant(doComparison(left.getBoolValue(), right.getBoolValue()));
- }
-
- @Override
- public String toString(){
- return getClass().getName();
- }
-}
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9a8d62b1/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/MyNode.java
----------------------------------------------------------------------
diff --git a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/MyNode.java b/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/MyNode.java
deleted file mode 100644
index b23b3e1..0000000
--- a/hedwig-client-jms/src/main/java/org/apache/hedwig/jms/selector/MyNode.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hedwig.jms.selector;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Root of all nodes in the AST generated.
- * Encapsulates state for evaluation of the ast by an interpreter.
- */
-public class MyNode {
-
- final static Logger logger = LoggerFactory.getLogger(MyNode.class);
-
- // This is se for case of constant value literals.
- private SelectorConstant selectorConstant;
-
- // This is the actual expression to evaluate.
- private ExprFunction exprFunction;
-
- // Called while interpreting ..
- public SelectorConstant getConstantValue() throws SelectorEvaluationException {
- if (null == selectorConstant)
- throw new SelectorEvaluationException(getClass() +
- " Unexpected not to have evalData populated for " + this);
- return selectorConstant;
- }
-
- public void addToStringSet(String str) throws ParseException {
- if (null == selectorConstant) throw new ParseException(getClass() +
- " Unexpected not to have evalData populated for " + this);
- selectorConstant.addToStringSet(str);
- }
-
- // Called while parsing ..
- public void setConstantValue(SelectorConstant selectorData) throws ParseException {
- if (null != this.selectorConstant)
- throw new ParseException(getClass() + " Value already set ? prev : " +
- this.selectorConstant + ", new : " + selectorData);
-
- if (MyNode.logger.isTraceEnabled()) MyNode.logger.trace("Setting constant value " +
- selectorData + " for " + this);
-
- this.selectorConstant = selectorData;
- }
-
-
- // Called while interpreting ..
- public ExprFunction getExprFunction() throws SelectorEvaluationException {
- if (null == exprFunction)
- throw new SelectorEvaluationException(getClass() +
- " Unexpected not to have exprFunction populated for " + this);
- return exprFunction;
- }
-
- // Called while parsing ..
- public void setExprFunction(ExprFunction exprFunction) throws ParseException {
- if (null != this.exprFunction)
- throw new ParseException(getClass() + " exprFunction already set ? prev : " +
- this.exprFunction + ", new : " + exprFunction);
-
- if (MyNode.logger.isTraceEnabled()) MyNode.logger.trace("Setting function expr " +
- exprFunction + " for " + this);
-
- this.exprFunction = exprFunction;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("MyNode");
- sb.append("{selectorConstant=").append(selectorConstant);
- sb.append(", exprFunction=").append(exprFunction);
- sb.append('}');
- return sb.toString();
- }
-
-
-
-
- // Internal to the parser - DO NOT use outside !
- SelectorConstant getConstantValueInternal() { return selectorConstant; }
- ExprFunction getExprFunctionInternal() { return exprFunction; }
-}