View Javadoc

    1   /***
    2    *
    3    * Copyright 2004 Protique Ltd
    4    *
    5    * Licensed under the Apache License, Version 2.0 (the "License");
    6    * you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    *
    9    * http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   *
    17   **/
    18  package org.codehaus.activemq.service;
    19
    20  import java.io.Externalizable;
    21  import java.io.IOException;
    22  import java.io.ObjectInput;
    23  import java.io.ObjectOutput;
    24
    25  /***
    26   * Represents a durable subscribers subscription entry which contains
    27   * details of the subscription and the subscriber's unique ID
    28   *
    29   * @version $Revision: 1.1 $
    30   */
    31  public class SubscriberEntry implements Externalizable {
    32      private static final long serialVersionUID = -5754338187296859149L;
    33
    34      private int subscriberID;
    35      private String clientID;
    36      private String consumerName;
    37      private String destination;
    38      private String selector;
    39
    40      public SubscriberEntry() {
    41      }
    42
    43      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    44          subscriberID = in.readInt();
    45          clientID = in.readUTF();
    46          consumerName = in.readUTF();
    47          destination = in.readUTF();
    48          selector = in.readUTF();
    49      }
    50
    51      public void writeExternal(ObjectOutput out) throws IOException {
    52          out.writeInt(subscriberID);
    53          out.writeUTF(clientID);
    54          out.writeUTF(consumerName);
    55          out.writeUTF(destination);
    56          out.writeUTF(selector);
    57      }
    58
    59      // Properties
    60      //-------------------------------------------------------------------------
    61      public String getClientID() {
    62          return clientID;
    63      }
    64
    65      public void setClientID(String clientID) {
    66          this.clientID = clientID;
    67      }
    68
    69      public String getConsumerName() {
    70          return consumerName;
    71      }
    72
    73      public void setConsumerName(String consumerName) {
    74          this.consumerName = consumerName;
    75      }
    76
    77      public String getDestination() {
    78          return destination;
    79      }
    80
    81      public void setDestination(String destination) {
    82          this.destination = destination;
    83      }
    84
    85      public String getSelector() {
    86          return selector;
    87      }
    88
    89      public void setSelector(String selector) {
    90          this.selector = selector;
    91      }
    92
    93      public int getSubscriberID() {
    94          return subscriberID;
    95      }
    96
    97      public void setSubscriberID(int subscriberID) {
    98          this.subscriberID = subscriberID;
    99      }
    100 }