Class ProtocolConverter
- java.lang.Object
-
- org.apache.activemq.transport.stomp.ProtocolConverter
-
-
Constructor Summary
Constructors Constructor Description ProtocolConverter(StompTransport stompTransport, BrokerContext brokerContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckConnected()protected voidconfigureInactivityMonitor(String heartBeatConfig)StompFrameconvertMessage(ActiveMQMessage message, boolean ignoreTransformation)ActiveMQMessageconvertMessage(StompFrame command)protected org.apache.activemq.transport.stomp.ResponseHandlercreateResponseHandler(StompFrame command)ActiveMQDestinationcreateTempDestination(String name, boolean topic)protected FrameTranslatorfindTranslator(String header)protected FrameTranslatorfindTranslator(String header, ActiveMQDestination destination, boolean advisory)protected intgenerateCommandId()StringgetCreatedTempDestinationName(ActiveMQDestination destination)StringgetDefaultHeartBeat()floatgetHbGracePeriodMultiplier()StompTransportgetStompTransport()protected voidhandleException(Throwable exception, StompFrame command)voidonActiveMQCommand(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(Command command, org.apache.activemq.transport.stomp.ResponseHandler handler)protected voidsendToStomp(StompFrame command)voidsetDefaultHeartBeat(String defaultHeartBeat)voidsetHbGracePeriodMultiplier(float hbGracePeriodMultiplier)
-
-
-
Constructor Detail
-
ProtocolConverter
public ProtocolConverter(StompTransport stompTransport, BrokerContext brokerContext)
-
-
Method Detail
-
generateCommandId
protected int generateCommandId()
-
createResponseHandler
protected org.apache.activemq.transport.stomp.ResponseHandler createResponseHandler(StompFrame command)
-
sendToActiveMQ
protected void sendToActiveMQ(Command command, org.apache.activemq.transport.stomp.ResponseHandler handler)
-
sendToStomp
protected void sendToStomp(StompFrame command) throws IOException
- Throws:
IOException
-
findTranslator
protected FrameTranslator findTranslator(String header)
-
findTranslator
protected FrameTranslator findTranslator(String header, ActiveMQDestination destination, boolean advisory)
-
onStompCommand
public void onStompCommand(StompFrame command) throws IOException, JMSException
Convert a STOMP command- Parameters:
command-- Throws:
IOExceptionJMSException
-
handleException
protected void handleException(Throwable exception, StompFrame command) throws IOException
- Throws:
IOException
-
onStompSend
protected void onStompSend(StompFrame command) throws IOException, JMSException
- Throws:
IOExceptionJMSException
-
onStompNack
protected void onStompNack(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompAck
protected void onStompAck(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompBegin
protected void onStompBegin(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompCommit
protected void onStompCommit(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompAbort
protected void onStompAbort(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompSubscribe
protected void onStompSubscribe(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompUnsubscribe
protected void onStompUnsubscribe(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompConnect
protected void onStompConnect(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
onStompDisconnect
protected void onStompDisconnect(StompFrame command) throws ProtocolException
- Throws:
ProtocolException
-
checkConnected
protected void checkConnected() throws ProtocolException- Throws:
ProtocolException
-
onActiveMQCommand
public void onActiveMQCommand(Command command) throws IOException, JMSException
Dispatch a ActiveMQ command- Parameters:
command-- Throws:
IOExceptionJMSException
-
convertMessage
public ActiveMQMessage convertMessage(StompFrame command) throws IOException, JMSException
- Throws:
IOExceptionJMSException
-
convertMessage
public StompFrame convertMessage(ActiveMQMessage message, boolean ignoreTransformation) throws IOException, JMSException
- Throws:
IOExceptionJMSException
-
getStompTransport
public StompTransport getStompTransport()
-
createTempDestination
public ActiveMQDestination createTempDestination(String name, boolean topic)
-
getCreatedTempDestinationName
public String getCreatedTempDestinationName(ActiveMQDestination destination)
-
getDefaultHeartBeat
public String getDefaultHeartBeat()
-
setDefaultHeartBeat
public void setDefaultHeartBeat(String defaultHeartBeat)
-
getHbGracePeriodMultiplier
public float getHbGracePeriodMultiplier()
- Returns:
- the hbGracePeriodMultiplier
-
setHbGracePeriodMultiplier
public void setHbGracePeriodMultiplier(float hbGracePeriodMultiplier)
- Parameters:
hbGracePeriodMultiplier- the hbGracePeriodMultiplier to set
-
configureInactivityMonitor
protected void configureInactivityMonitor(String heartBeatConfig) throws ProtocolException
- Throws:
ProtocolException
-
sendReceipt
protected void sendReceipt(StompFrame command)
-
safeGetAction
protected Object safeGetAction(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.- Parameters:
command- The STOMP command to fetch an action from.- Returns:
- the command action or a safe string to use in logging.
-
-