Package dk.netarkivet.common.distribute
Class ChannelID
- java.lang.Object
-
- dk.netarkivet.common.distribute.ChannelID
-
- All Implemented Interfaces:
Serializable
public class ChannelID extends Object implements Serializable
A class for representing the names of JMS queues.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMON
Constants to make the semantics of parameters to our name constructors more explicit.static boolean
INCLUDE_APPLINST_ID
static boolean
INCLUDE_IP
static boolean
NO_APPLINST_ID
static boolean
NO_IP
static boolean
QUEUE
static boolean
TOPIC
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Implements equality check for ChannelIDs.String
getName()
Getter for the channel name.int
hashCode()
Computes a hash code based on the channel name and whether it is a topic.String
toString()
Pretty-printer.
-
-
-
Field Detail
-
COMMON
public static final String COMMON
Constants to make the semantics of parameters to our name constructors more explicit.- See Also:
- Constant Field Values
-
INCLUDE_IP
public static final boolean INCLUDE_IP
- See Also:
- Constant Field Values
-
NO_IP
public static final boolean NO_IP
- See Also:
- Constant Field Values
-
INCLUDE_APPLINST_ID
public static final boolean INCLUDE_APPLINST_ID
- See Also:
- Constant Field Values
-
NO_APPLINST_ID
public static final boolean NO_APPLINST_ID
- See Also:
- Constant Field Values
-
TOPIC
public static final boolean TOPIC
- See Also:
- Constant Field Values
-
QUEUE
public static final boolean QUEUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChannelID
public ChannelID(String appPref, String replicaId, boolean useNodeId, boolean useAppInstId, boolean isTopic)
Constructor of channel names. The constructor is package private because we should never use any channels except the ones constructed by our friend Channels.java- Parameters:
appPref
- The prefix used for the applications listening to the channel.replicaId
- Name of the replica, or ChannelID.COMMON if channel shared by all replicas.useNodeId
- Whether that IP address of the local node should be included in the channel name.useAppInstId
- Whether application instance id from settings should be included in the channel name.isTopic
- Whether the Channel is a Topic or a Queue.- Throws:
UnknownID
- if looking up the local IP number failed.
-
-
Method Detail
-
getName
public String getName()
Getter for the channel name.- Returns:
- The name of the channel referred to by this object.
-
toString
public String toString()
Pretty-printer.
-
equals
public boolean equals(Object o)
Implements equality check for ChannelIDs. Useful when these are used as indexes in Java collections, for instance.
-
-