public class ProtonSessionIntegrationCallback extends Object implements AMQPSessionCallback, SessionCallback
Modifier and Type | Field and Description |
---|---|
protected IDGenerator |
consumerIDGenerator |
Constructor and Description |
---|
ProtonSessionIntegrationCallback(ActiveMQProtonConnectionCallback protonSPI,
ProtonProtocolManager manager,
AMQPConnectionContext connection,
Connection transportConnection,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
ack(Object brokerConsumer,
Object message) |
void |
afterDelivery()
This can be used to complete certain operations outside of the lock,
like acks or other operations.
|
boolean |
bindingQuery(String address) |
void |
browserFinished(ServerConsumer consumer)
Some protocols (Openwire) needs a special message with the browser is finished.
|
void |
cancel(Object brokerConsumer,
Object message,
boolean updateCounts) |
void |
close() |
void |
closed() |
void |
closeSender(Object brokerConsumer) |
void |
commitCurrentTX() |
void |
createDurableQueue(String address,
String queueName) |
Object |
createSender(ProtonPlugSender protonSender,
String queue,
String filter,
boolean browserOnly) |
void |
createTemporaryQueue(String queueName) |
void |
createTemporaryQueue(String address,
String queueName) |
void |
deleteQueue(String address) |
void |
disconnect(ServerConsumer consumer,
String queueName) |
org.apache.qpid.proton.message.ProtonJMessage |
encodeMessage(Object message,
int deliveryCount) |
org.apache.qpid.proton.amqp.Binary |
getCurrentTXID() |
String |
getPubSubPrefix() |
boolean |
hasCredits(ServerConsumer consumer)
This one gives a chance for Proton to have its own flow control.
|
void |
init(AMQPSessionContext protonSession,
SASLResult saslResult) |
boolean |
isWritable(ReadyListener callback) |
void |
offerProducerCredit(String address,
int credits,
int threshold,
org.apache.qpid.proton.engine.Receiver receiver) |
void |
onFlowConsumer(Object consumer,
int credits,
boolean drain) |
boolean |
queueQuery(String queueName) |
void |
resumeDelivery(Object consumer) |
void |
rollbackCurrentTX(boolean lastMessageDelivered) |
int |
sendLargeMessage(MessageReference ref,
ServerMessage message,
ServerConsumer consumer,
long bodySize,
int deliveryCount) |
int |
sendLargeMessageContinuation(ServerConsumer consumer,
byte[] body,
boolean continues,
boolean requiresResponse) |
int |
sendMessage(MessageReference ref,
ServerMessage message,
ServerConsumer consumer,
int deliveryCount) |
void |
sendProducerCreditsFailMessage(int credits,
SimpleString address) |
void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
void |
serverSend(org.apache.qpid.proton.engine.Receiver receiver,
org.apache.qpid.proton.engine.Delivery delivery,
String address,
int messageFormat,
io.netty.buffer.ByteBuf messageEncoded) |
void |
start() |
void |
startSender(Object brokerConsumer) |
String |
tempQueueName() |
boolean |
updateDeliveryCountAfterCancel(ServerConsumer consumer,
MessageReference ref,
boolean failed)
Use this to updates specifics on the message after a redelivery happened.
|
protected final IDGenerator consumerIDGenerator
public ProtonSessionIntegrationCallback(ActiveMQProtonConnectionCallback protonSPI, ProtonProtocolManager manager, AMQPConnectionContext connection, Connection transportConnection, Executor executor)
public boolean isWritable(ReadyListener callback)
isWritable
in interface SessionCallback
public void onFlowConsumer(Object consumer, int credits, boolean drain)
onFlowConsumer
in interface AMQPSessionCallback
public void browserFinished(ServerConsumer consumer)
SessionCallback
browserFinished
in interface SessionCallback
public void init(AMQPSessionContext protonSession, SASLResult saslResult) throws Exception
init
in interface AMQPSessionCallback
Exception
public void afterDelivery() throws Exception
SessionCallback
afterDelivery
in interface SessionCallback
Exception
public void start()
start
in interface AMQPSessionCallback
public Object createSender(ProtonPlugSender protonSender, String queue, String filter, boolean browserOnly) throws Exception
createSender
in interface AMQPSessionCallback
Exception
public void startSender(Object brokerConsumer) throws Exception
startSender
in interface AMQPSessionCallback
Exception
public void createTemporaryQueue(String queueName) throws Exception
createTemporaryQueue
in interface AMQPSessionCallback
Exception
public void createTemporaryQueue(String address, String queueName) throws Exception
createTemporaryQueue
in interface AMQPSessionCallback
Exception
public void createDurableQueue(String address, String queueName) throws Exception
createDurableQueue
in interface AMQPSessionCallback
Exception
public boolean queueQuery(String queueName) throws Exception
queueQuery
in interface AMQPSessionCallback
Exception
public boolean bindingQuery(String address) throws Exception
bindingQuery
in interface AMQPSessionCallback
Exception
public void closeSender(Object brokerConsumer) throws Exception
closeSender
in interface AMQPSessionCallback
Exception
public org.apache.qpid.proton.message.ProtonJMessage encodeMessage(Object message, int deliveryCount) throws Exception
encodeMessage
in interface AMQPSessionCallback
Exception
public org.apache.qpid.proton.amqp.Binary getCurrentTXID()
getCurrentTXID
in interface AMQPSessionCallback
public String tempQueueName()
tempQueueName
in interface AMQPSessionCallback
public void commitCurrentTX() throws Exception
commitCurrentTX
in interface AMQPSessionCallback
Exception
public void rollbackCurrentTX(boolean lastMessageDelivered) throws Exception
rollbackCurrentTX
in interface AMQPSessionCallback
Exception
public void close() throws Exception
close
in interface AMQPSessionCallback
Exception
public void ack(Object brokerConsumer, Object message) throws Exception
ack
in interface AMQPSessionCallback
Exception
public void cancel(Object brokerConsumer, Object message, boolean updateCounts) throws Exception
cancel
in interface AMQPSessionCallback
updateCounts
- this identified if the cancel was because of a failure or just cleaning up the
client's cache.
in some implementations you could call this failedException
public void resumeDelivery(Object consumer)
resumeDelivery
in interface AMQPSessionCallback
public void serverSend(org.apache.qpid.proton.engine.Receiver receiver, org.apache.qpid.proton.engine.Delivery delivery, String address, int messageFormat, io.netty.buffer.ByteBuf messageEncoded) throws Exception
serverSend
in interface AMQPSessionCallback
messageEncoded
- a Heap Buffer ByteBuffer (safe to convert into byte[])Exception
public String getPubSubPrefix()
getPubSubPrefix
in interface AMQPSessionCallback
public void offerProducerCredit(String address, int credits, int threshold, org.apache.qpid.proton.engine.Receiver receiver)
offerProducerCredit
in interface AMQPSessionCallback
public void deleteQueue(String address) throws Exception
deleteQueue
in interface AMQPSessionCallback
Exception
public void sendProducerCreditsMessage(int credits, SimpleString address)
sendProducerCreditsMessage
in interface SessionCallback
public boolean updateDeliveryCountAfterCancel(ServerConsumer consumer, MessageReference ref, boolean failed)
SessionCallback
updateDeliveryCountAfterCancel
in interface SessionCallback
public void sendProducerCreditsFailMessage(int credits, SimpleString address)
sendProducerCreditsFailMessage
in interface SessionCallback
public int sendMessage(MessageReference ref, ServerMessage message, ServerConsumer consumer, int deliveryCount)
sendMessage
in interface SessionCallback
public int sendLargeMessage(MessageReference ref, ServerMessage message, ServerConsumer consumer, long bodySize, int deliveryCount)
sendLargeMessage
in interface SessionCallback
public int sendLargeMessageContinuation(ServerConsumer consumer, byte[] body, boolean continues, boolean requiresResponse)
sendLargeMessageContinuation
in interface SessionCallback
public void closed()
closed
in interface SessionCallback
public void disconnect(ServerConsumer consumer, String queueName)
disconnect
in interface SessionCallback
public boolean hasCredits(ServerConsumer consumer)
SessionCallback
hasCredits
in interface SessionCallback
Copyright © 2016 The Apache Software Foundation. All rights reserved.