// // 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.activeblaze.wire; option java_multiple_files = true; option optimize_for = SPEED; // We make use of the wonky comment style bellow because the following options // are not valid for protoc, but they are valid for the ActiveMQ proto compiler. // In the ActiveMQ proto compiler, comments terminate with the pipe character: | enum MessageType{ //| option java_create_message="true"; BLAZE_DATA = 0; MEMBER_DATA = 1; ELECTION_MESSAGE = 2; ACK_DATA = 3; NACK_DATA = 4; STATE_DATA = 5; CONTROL_DATA = 6; } message PacketData { optional bool responseRequired = 1; optional bool reliable = 2; optional bool response = 3; optional bool replayed = 4; optional MessageType messageType =5; optional bytes producerId = 6; optional int32 sessionId = 7; optional int64 messageSequence = 8; optional int32 numberOfParts= 9; optional int32 partNumber= 10; optional bytes payload= 11; optional bytes messageId =12; optional bytes correlationId = 13; optional int32 payloadType = 14; } message BlazeData { optional bool persistent = 1; optional int32 priority = 2; optional int32 redeliveryCounter = 3; optional int64 timestamp = 4; optional int64 expiration = 5; optional bytes messageType = 6; optional DestinationData destinationData = 7; optional DestinationData replyToData = 8; optional MapData mapData = 9; optional bytes payload = 10; optional bytes correlationId = 11; } message AckData { optional int64 id =1; optional int64 startSequence =2; optional int64 endSequence =3; optional int64 sessionId = 4; } message NackData { optional int64 id =1; optional int64 startSequence =2; optional int64 endSequence =3; optional int64 sessionId = 4; } message ControlData { optional int64 lastId =1; //last ack or nack id } message DestinationData { optional bytes name =1; optional bool topic =2; optional bool temporary=3; } message SubscriptionData { optional bool durable = 1; optional bool noLocal = 2; optional int32 weight = 3; optional string channelName = 4; optional string subscriberName = 5; optional string selector = 6; optional DestinationData destinationData = 7; } message MemberData { optional string id = 1; optional string name = 2; optional int64 startTime = 3; optional int64 timeStamp = 4; optional bytes inetAddress = 5; optional int32 port = 6; // a higher weight means this will be the master optional int64 masterWeight = 7; // if both weights are the same - the refined weight can be used optional int64 refinedWeight = 8; optional bool subscriptionsChanged = 9; optional bool observer = 10; optional bool lockedMaster = 11; repeated bytes groups = 12; repeated SubscriptionData subscriptionData = 13; } message StateKeyData { optional MemberData member =1; optional string key = 2; optional bool locked = 3; optional bool removeOnExit = 4; optional bool releaseLockOnExit = 5; optional int64 expiration = 6; optional int64 lockExpiration = 7; } enum StateType { INSERT = 1; DELETE = 2; SYNC = 3; } message StateData { optional StateKeyData keyData = 1; optional bytes value =2; optional bytes oldvalue =3; optional bool mapUpdate = 4; optional bool mapWrite = 5; optional bool expired = 6; optional bool lockExpired = 7; optional bool lockUpdate = 8; optional bool lockWrite = 9; optional bool error = 10; optional StateType stateType = 11; } enum ElectionType { ELECTION = 0; ANSWER = 1; MASTER = 2; } message ElectionMessage { optional MemberData member = 1; optional ElectionType electionType = 2; } /////////////////////////////////////////////////////////////////////// // Properties / MapData /////////////////////////////////////////////////////////////////////// message StringType { optional string name = 1; optional string value = 2; } message BoolType { optional string name = 1; optional bool value = 2; } message ByteType { optional string name = 1; optional int32 value = 2; } message ShortType { optional string name = 1; optional int32 value = 2; } message IntType { optional string name = 1; optional int32 value = 2; } message LongType { optional string name = 1; optional int64 value = 2; } message FloatType { optional string name = 1; optional float value = 2; } message DoubleType { optional string name = 1; optional double value = 2; } message CharType { optional string name = 1; optional string value = 2; } message BytesType { optional string name = 1; optional bytes value = 2; } message BufferType { optional string name = 1; optional bytes value = 2; } message MapData { optional string name=1[default = "DEFAULT"]; repeated StringType stringType = 2; repeated IntType intType = 3; repeated BoolType boolType = 4; repeated LongType longType = 5; repeated DoubleType doubleType = 6; repeated FloatType floatType = 7; repeated ShortType shortType = 8; repeated ByteType byteType = 9; repeated CharType charType = 10; repeated BytesType bytesType = 11; repeated MapData mapType = 12; repeated BufferType bufferType = 13; }