org.apache.qpid.server.subscription
Class SubscriptionImpl
java.lang.Object
org.apache.qpid.server.subscription.SubscriptionImpl
- All Implemented Interfaces:
- ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>, SubscriptionConfig, FlowCreditManager.FlowCreditManagerListener, Subscription
- Direct Known Subclasses:
- SubscriptionImpl.AckSubscription, SubscriptionImpl.BrowserSubscription, SubscriptionImpl.NoAckSubscription
public abstract class SubscriptionImpl
- extends Object
- implements Subscription, FlowCreditManager.FlowCreditManagerListener, SubscriptionConfig
Encapsulation of a supscription to a queue.
Ties together the protocol session of a subscriber, the consumer tag
that was given out by the broker and the channel id.
SubscriptionImpl
public SubscriptionImpl(AMQChannel channel,
AMQProtocolSession protocolSession,
org.apache.qpid.framing.AMQShortString consumerTag,
org.apache.qpid.framing.FieldTable arguments,
boolean noLocal,
FlowCreditManager creditManager,
ClientDeliveryMethod deliveryMethod,
RecordDeliveryMethod recordMethod)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
getConfigStore
public ConfigStore getConfigStore()
getDelivered
public Long getDelivered()
- Specified by:
getDelivered
in interface SubscriptionConfig
setQueue
public void setQueue(AMQQueue queue,
boolean exclusive)
- Specified by:
setQueue
in interface Subscription
toString
public String toString()
- Overrides:
toString
in class Object
send
public abstract void send(QueueEntry msg)
throws org.apache.qpid.AMQException
- This method can be called by each of the publisher threads. As a result all changes to the channel object must be
thread safe.
- Specified by:
send
in interface Subscription
- Parameters:
msg
- The message to send
- Throws:
org.apache.qpid.AMQException
isSuspended
public boolean isSuspended()
- Specified by:
isSuspended
in interface Subscription
queueDeleted
public void queueDeleted(AMQQueue queue)
- Callback indicating that a queue has been deleted.
- Specified by:
queueDeleted
in interface Subscription
- Parameters:
queue
- The queue to delete
filtersMessages
public boolean filtersMessages()
hasInterest
public boolean hasInterest(QueueEntry entry)
- Specified by:
hasInterest
in interface Subscription
isAutoClose
public boolean isAutoClose()
- Specified by:
isAutoClose
in interface Subscription
getCreditManager
public FlowCreditManager getCreditManager()
close
public void close()
- Specified by:
close
in interface Subscription
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interface Subscription
wouldSuspend
public boolean wouldSuspend(QueueEntry msg)
- Specified by:
wouldSuspend
in interface Subscription
getSendLock
public void getSendLock()
- Specified by:
getSendLock
in interface Subscription
releaseSendLock
public void releaseSendLock()
- Specified by:
releaseSendLock
in interface Subscription
getChannel
public AMQChannel getChannel()
getConsumerTag
public org.apache.qpid.framing.AMQShortString getConsumerTag()
- Specified by:
getConsumerTag
in interface Subscription
getSubscriptionID
public long getSubscriptionID()
- Specified by:
getSubscriptionID
in interface Subscription
getProtocolSession
public AMQProtocolSession getProtocolSession()
getLogActor
public LogActor getLogActor()
- Specified by:
getLogActor
in interface Subscription
getQueue
public AMQQueue getQueue()
- Specified by:
getQueue
in interface SubscriptionConfig
- Specified by:
getQueue
in interface Subscription
onDequeue
public void onDequeue(QueueEntry queueEntry)
- Specified by:
onDequeue
in interface Subscription
restoreCredit
public void restoreCredit(QueueEntry queueEntry)
- Specified by:
restoreCredit
in interface Subscription
creditStateChanged
public void creditStateChanged(boolean hasCredit)
- Specified by:
creditStateChanged
in interface FlowCreditManager.FlowCreditManagerListener
getState
public Subscription.State getState()
- Specified by:
getState
in interface Subscription
setStateListener
public void setStateListener(Subscription.StateListener listener)
- Specified by:
setStateListener
in interface Subscription
getQueueContext
public AMQQueue.Context getQueueContext()
- Specified by:
getQueueContext
in interface Subscription
setQueueContext
public void setQueueContext(AMQQueue.Context context)
- Specified by:
setQueueContext
in interface Subscription
sendToClient
protected void sendToClient(QueueEntry entry,
long deliveryTag)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
recordMessageDelivery
protected void recordMessageDelivery(QueueEntry entry,
long deliveryTag)
isActive
public boolean isActive()
- Specified by:
isActive
in interface Subscription
getOwningState
public QueueEntry.SubscriptionAcquiredState getOwningState()
- Specified by:
getOwningState
in interface Subscription
getAssignedState
public QueueEntry.SubscriptionAssignedState getAssignedState()
- Specified by:
getAssignedState
in interface Subscription
confirmAutoClose
public void confirmAutoClose()
- Specified by:
confirmAutoClose
in interface Subscription
acquires
public boolean acquires()
- Specified by:
acquires
in interface Subscription
seesRequeues
public boolean seesRequeues()
- Specified by:
seesRequeues
in interface Subscription
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interface Subscription
set
public void set(String key,
Object value)
- Specified by:
set
in interface Subscription
get
public Object get(String key)
- Specified by:
get
in interface Subscription
setNoLocal
public void setNoLocal(boolean noLocal)
- Specified by:
setNoLocal
in interface Subscription
isBrowser
abstract boolean isBrowser()
getCreditMode
public String getCreditMode()
- Specified by:
getCreditMode
in interface SubscriptionConfig
getSessionConfig
public SessionConfig getSessionConfig()
- Specified by:
getSessionConfig
in interface SubscriptionConfig
isBrowsing
public boolean isBrowsing()
- Specified by:
isBrowsing
in interface SubscriptionConfig
isExplicitAcknowledge
public boolean isExplicitAcknowledge()
- Specified by:
isExplicitAcknowledge
in interface SubscriptionConfig
getId
public UUID getId()
- Specified by:
getId
in interface ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>
isDurable
public boolean isDurable()
- Specified by:
isDurable
in interface ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>
getConfigType
public SubscriptionConfigType getConfigType()
- Specified by:
getConfigType
in interface ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>
isExclusive
public boolean isExclusive()
- Specified by:
isExclusive
in interface SubscriptionConfig
getParent
public ConfiguredObject getParent()
- Specified by:
getParent
in interface ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>
getName
public String getName()
- Specified by:
getName
in interface SubscriptionConfig
getArguments
public Map<String,Object> getArguments()
- Specified by:
getArguments
in interface SubscriptionConfig
isSessionTransactional
public boolean isSessionTransactional()
- Specified by:
isSessionTransactional
in interface Subscription
getCreateTime
public long getCreateTime()
- Specified by:
getCreateTime
in interface ConfiguredObject<SubscriptionConfigType,SubscriptionConfig>
Licensed to the Apache Software Foundation