Class ProtocolConverter
java.lang.Object
org.apache.activemq.transport.stomp.ProtocolConverter
- Author:
- chirino
-
Constructor Summary
ConstructorsConstructorDescriptionProtocolConverter(StompTransport stompTransport, BrokerContext brokerContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidconfigureInactivityMonitor(String heartBeatConfig) convertMessage(org.apache.activemq.command.ActiveMQMessage message, boolean ignoreTransformation) org.apache.activemq.command.ActiveMQMessageconvertMessage(StompFrame command) protected org.apache.activemq.transport.stomp.ResponseHandlercreateResponseHandler(StompFrame command) org.apache.activemq.command.ActiveMQDestinationcreateTempDestination(String name, boolean topic) protected FrameTranslatorfindTranslator(String header) protected FrameTranslatorfindTranslator(String header, org.apache.activemq.command.ActiveMQDestination destination, boolean advisory) protected intgetCreatedTempDestinationName(org.apache.activemq.command.ActiveMQDestination destination) floatprotected voidhandleException(Throwable exception, StompFrame command) voidonActiveMQCommand(org.apache.activemq.command.Command command) Dispatch a ActiveMQ commandprotected voidonStompAbort(StompFrame command) protected voidonStompAck(StompFrame command) protected voidonStompBegin(StompFrame command) voidonStompCommand(StompFrame command) Convert a STOMP commandprotected voidonStompCommit(StompFrame command) protected voidonStompConnect(StompFrame command) protected voidonStompDisconnect(StompFrame command) protected voidonStompNack(StompFrame command) protected voidonStompSend(StompFrame command) protected voidonStompSubscribe(StompFrame command) protected voidonStompUnsubscribe(StompFrame command) protected ObjectsafeGetAction(StompFrame command) Retrieve the STOMP action value from a frame if the value is valid, otherwise return an unknown string to allow for safe log output.protected voidsendReceipt(StompFrame command) protected voidsendToActiveMQ(org.apache.activemq.command.Command command, org.apache.activemq.transport.stomp.ResponseHandler handler) protected voidsendToStomp(StompFrame command) voidsetDefaultHeartBeat(String defaultHeartBeat) voidsetHbGracePeriodMultiplier(float hbGracePeriodMultiplier)
-
Constructor Details
-
ProtocolConverter
-
-
Method Details
-
generateCommandId
protected int generateCommandId() -
createResponseHandler
protected org.apache.activemq.transport.stomp.ResponseHandler createResponseHandler(StompFrame command) -
sendToActiveMQ
protected void sendToActiveMQ(org.apache.activemq.command.Command command, org.apache.activemq.transport.stomp.ResponseHandler handler) -
sendToStomp
- Throws:
IOException
-
findTranslator
-
findTranslator
protected FrameTranslator findTranslator(String header, org.apache.activemq.command.ActiveMQDestination destination, boolean advisory) -
onStompCommand
Convert a STOMP command- Parameters:
command-- Throws:
IOExceptionjakarta.jms.JMSException
-
handleException
- Throws:
IOException
-
onStompSend
- Throws:
IOExceptionjakarta.jms.JMSException
-
onStompNack
- Throws:
ProtocolException
-
onStompAck
- Throws:
ProtocolException
-
onStompBegin
- Throws:
ProtocolException
-
onStompCommit
- Throws:
ProtocolException
-
onStompAbort
- Throws:
ProtocolException
-
onStompSubscribe
- Throws:
ProtocolException
-
onStompUnsubscribe
- Throws:
ProtocolException
-
onStompConnect
- Throws:
ProtocolException
-
onStompDisconnect
- Throws:
ProtocolException
-
checkConnected
- Throws:
ProtocolException
-
onActiveMQCommand
public void onActiveMQCommand(org.apache.activemq.command.Command command) throws IOException, jakarta.jms.JMSException Dispatch a ActiveMQ command- Parameters:
command-- Throws:
IOExceptionjakarta.jms.JMSException
-
convertMessage
public org.apache.activemq.command.ActiveMQMessage convertMessage(StompFrame command) throws IOException, jakarta.jms.JMSException - Throws:
IOExceptionjakarta.jms.JMSException
-
convertMessage
public StompFrame convertMessage(org.apache.activemq.command.ActiveMQMessage message, boolean ignoreTransformation) throws IOException, jakarta.jms.JMSException - Throws:
IOExceptionjakarta.jms.JMSException
-
getStompTransport
-
createTempDestination
public org.apache.activemq.command.ActiveMQDestination createTempDestination(String name, boolean topic) -
getCreatedTempDestinationName
public String getCreatedTempDestinationName(org.apache.activemq.command.ActiveMQDestination destination) -
getDefaultHeartBeat
-
setDefaultHeartBeat
-
getHbGracePeriodMultiplier
public float getHbGracePeriodMultiplier()- Returns:
- the hbGracePeriodMultiplier
-
setHbGracePeriodMultiplier
public void setHbGracePeriodMultiplier(float hbGracePeriodMultiplier) - Parameters:
hbGracePeriodMultiplier- the hbGracePeriodMultiplier to set
-
configureInactivityMonitor
- Throws:
ProtocolException
-
sendReceipt
-
safeGetAction
Retrieve the STOMP action value from a frame if the value is valid, otherwise return an unknown string to allow for safe log output.- Parameters:
command- The STOMP command to fetch an action from.- Returns:
- the command action or a safe string to use in logging.
-