Package com.tibco.tibjms.admin
Class ConsumerInfo
- java.lang.Object
-
- com.tibco.tibjms.admin.ConsumerInfo
-
public class ConsumerInfo extends java.lang.Object
Represents message consumer in EMS server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConsumerInfo.Details
Provides additional information about consumer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ConsumerInfo
from(javax.management.openmbean.CompositeData cd)
For Internal use only, may be removed or deprecated in future.long
getConnectionID()
Return the consumer's connection ID or 0.long
getCreateTime()
Returns consumer's creation time in milliseconds.java.lang.String
getDestinationName()
Returns consumer's destination name.int
getDestinationType()
Returns consumer's destination type.DetailedDestStat[]
getDetailedStatistics()
Returns detailed statistics for a wildcarded consumer.ConsumerInfo.Details
getDetails()
Returns additional details about this consumer ornull
.java.lang.String
getDurableName()
Returns the name of the consumer's durable subscription ornull
.long
getID()
Returns consumer ID.long
getPendingMessageCount()
Returns number of pending messages for a topic consumer.long
getPendingMessageSize()
Returns combined size of pending messages for a topic consumer.java.lang.String
getSelector()
Returns consumer's selector ornull
.long
getSessionID()
Returns consumer's session ID or 0.java.lang.String
getSharedSubscriptionName()
Returns the name of the shared subscription.StatData
getStatistics()
Returns consumer's total statistics ornull
.java.lang.String
getUsername()
Returns consumer's user name ornull
.boolean
hasSelector()
Returnstrue
if this consumer has selector.boolean
isConnected()
Returnstrue
if this consumer is connected to the server.boolean
isConnectionConsumer()
Returnstrue
if this is connection consumer.boolean
isMulticast()
Deprecated.As of release 8.3boolean
isNolocal()
Returnstrue
if this is a nolocal topic consumer.boolean
isShared()
Returnstrue
if this is a shared topic consumer.java.lang.String
toString()
Returns string representation of this object.
-
-
-
Method Detail
-
getID
public long getID()
Returns consumer ID. All consumers have unique positive ID.- Returns:
- consumer ID.
-
getConnectionID
public long getConnectionID()
Return the consumer's connection ID or 0. If this is a durable topic subscriber which is currently not connected, this method returns 0, which is never a valid connection ID.- Returns:
- consumer's connection ID or 0 if this is a disconnected durable topic subscriber.
-
getSessionID
public long getSessionID()
Returns consumer's session ID or 0. If this is a durable topic subscriber which is currently not connected, this method returns 0, which is never a valid session ID- Returns:
- consumer's session ID or 0.
-
getCreateTime
public long getCreateTime()
Returns consumer's creation time in milliseconds.- Returns:
- consumer's creation time in milliseconds.
-
getUsername
public java.lang.String getUsername()
Returns consumer's user name ornull
. This method returnsnull
for disconnected durable topic subscribers.- Returns:
- consumer's user name or
null
.
-
getDurableName
public java.lang.String getDurableName()
Returns the name of the consumer's durable subscription ornull
. Only durable topic consumers have durable name. This method returnsnull
for non-durable topic subscribers and queue receivers.- Returns:
- consumer's durable name or
null
if the consumer is not a durable topic consumer.
-
getDestinationType
public int getDestinationType()
Returns consumer's destination type. Returned value is one ofDestinationInfo.TOPIC_TYPE
orDestinationInfo.QUEUE_TYPE
.- Returns:
- consumer's destination type.
-
getDestinationName
public java.lang.String getDestinationName()
Returns consumer's destination name.- Returns:
- consumer's destination name.
-
getPendingMessageCount
public long getPendingMessageCount()
Returns number of pending messages for a topic consumer. Notice that only topic consumers have pending messages. For queue consumers the number of pending messages in the corresponding queue must be obtained via the queue itself.- Returns:
- number of pending messages, possibly 0. Always returns 0 if this is a queue consumer.
- Since:
- EMS 4.4
- See Also:
getPendingMessageSize()
,ConsumerInfo.Details.getCurrentMsgCountSentByServer()
-
getPendingMessageSize
public long getPendingMessageSize()
Returns combined size of pending messages for a topic consumer.- Returns:
- cumulative size of pending messages, possibly 0. Always returns 0 if this is a queue consumer.
- Since:
- EMS 4.4
- See Also:
getPendingMessageCount()
,ConsumerInfo.Details.getCurrentMsgSizeSentByServer()
-
getSelector
public java.lang.String getSelector()
Returns consumer's selector ornull
. Notice thatConsumerInfo
may or may not have the consumer's selector information depending on the way it was obtained, however methodhasSelector
can be called in all cases to determine if consumer has a selector. MethodTibjmsAdmin.getConsumer(long)
always includes the selector text, if present, into returned consumer object. Methods returning multiple consumers include or do not include selector text depending on the flagTibjmsAdmin.GET_SELECTOR
.- Returns:
- consumer's selector or
null
if this consumer has no selector. - Since:
- EMS 4.4
- See Also:
TibjmsAdmin.GET_SELECTOR
-
hasSelector
public boolean hasSelector()
Returnstrue
if this consumer has selector. Notice the selector itself may or may not be contained in the consumer object, depending on the way consumer information was obtained. However this method can be used in all cases to determine if a consumer has selector. MethodTibjmsAdmin.getConsumer(long)
always includes the selector text, if present, into returned consumer object. Methods returning multiple consumers include or do not include selector text depending on the flagTibjmsAdmin.GET_SELECTOR
.- Returns:
true
if this consumer has selector,false
otherwise.- Since:
- EMS 4.4
- See Also:
getSelector()
,TibjmsAdmin.GET_SELECTOR
-
isNolocal
public boolean isNolocal()
Returnstrue
if this is a nolocal topic consumer.- Returns:
true
if this is a nolocal topic consumer. Always returnsfalse
if this is a queue consumer.- Since:
- EMS 4.4
-
isMulticast
@Deprecated public boolean isMulticast()
Deprecated.As of release 8.3Returnstrue
if this topic consumer is receiving multicast messages.- Returns:
true
if this topic consumer is receiving multicast messages. Always returnsfalse
if this is a queue consumer.- Since:
- EMS 5.0
-
getStatistics
public StatData getStatistics()
Returns consumer's total statistics ornull
.This method may return
null
designating that no statistical information is available for this consumer. This can happen for any of the following reasons:- if statistics are disabled in the server;
- if statistics was not included into this consumer information object by the method ofTibjmsAdmin
class used to obtain this object.- Returns:
- consumer's total statistics or
null
if statistics is not available.
-
getDetailedStatistics
public DetailedDestStat[] getDetailedStatistics()
Returns detailed statistics for a wildcarded consumer. Detailed statistics gives a break down of the consumer's aggregate statistics across the different destinations that it has received messages on.This method may return
null
designating that no detailed statistics are available for this consumer. This can happen for any of the following reasons:- if consumer is not a wildcarded consumer;
- if detailed statistics are disabled in the server;
- if detailed statistics were not included into this consumer information object by the method ofTibjmsAdmin
class used to obtain this object.- Returns:
- consumer's detailed statistics or
null
if detailed statistics are not available.
-
getDetails
public ConsumerInfo.Details getDetails()
Returns additional details about this consumer ornull
. This method returnsnull
if this object has been obtained viaTibjmsAdmin.getConsumersStatistics()
method. If this consumer was obtained via methodsTibjmsAdmin.getConsumers()
orTibjmsAdmin.getConsumer(long)
, this method returns non-null
value containing detailed information about consumer.- Returns:
- detailed information object or
null
- Since:
- EMS 4.4
-
isConnected
public boolean isConnected()
Returnstrue
if this consumer is connected to the server. Only durable topic subscribers may be in disconnected state. This method always returnstrue
for queue receivers and non-durable topic consumers.- Returns:
true
if this consumer connected to server,false
otherwise.- Since:
- EMS 4.4
-
isConnectionConsumer
public boolean isConnectionConsumer()
Returnstrue
if this is connection consumer. Notice that for disconnected durable topic subscribers this method returnsfalse
even if the durable has been originally created as connection consumer.- Returns:
true
if this is a connection consumer,false
otherwise.- Since:
- EMS 4.4
-
isShared
public boolean isShared()
Returnstrue
if this is a shared topic consumer. The shared subscription name is returned bygetSharedSubscriptionName()
.- Returns:
true
if this topic consumer is on a shared subscription. Always returnsfalse
for queue consumers.- Since:
- EMS 8.0
-
getSharedSubscriptionName
public java.lang.String getSharedSubscriptionName()
Returns the name of the shared subscription. For shared durable consumers, this is equivalent to the durable name.- Returns:
- the name of the shared subscription, or
null
if the consumer is not a shared consumer or is a queue consumer. - Since:
- EMS 8.0
-
toString
public java.lang.String toString()
Returns string representation of this object.- Overrides:
toString
in classjava.lang.Object
-
from
public static ConsumerInfo from(javax.management.openmbean.CompositeData cd) throws java.lang.Exception
For Internal use only, may be removed or deprecated in future.- Returns:
- a ConsumerInfo object from CompositeData
- Throws:
java.lang.IllegalArgumentException
- if CompositeType does not match or if a null CompositeData is passed.java.lang.Exception
-
-