Author: jmesnil
Date: 2010-01-21 09:39:29 -0500 (Thu, 21 Jan 2010)
New Revision: 8824
Added:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java
Removed:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Channel.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ChannelHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Packet.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/PacketDecoder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/CorePacketDecoder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateReplicationSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/HornetQExceptionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/MessagePacket.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/NullResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketsConfirmedMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/Ping.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCompareDataMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageBeingMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargemessageEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageEventMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/RollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionAcknowledgeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerFlowCreditMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCreateConsumerMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionDeleteQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionExpiredMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionForceConsumerDelivery.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionRequestProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXACommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAForgetMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAJoinMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResumeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXARollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAStartMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/XidCodecSupport.java
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* sync with the trunk: svn merge -r 8806:8821
https://svn.jboss.org/repos/hornetq/trunk
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Channel.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Channel.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Channel.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,179 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.hornetq.core.remoting;
-
-import java.util.concurrent.locks.Lock;
-
-import org.hornetq.api.core.HornetQException;
-
-/**
- * A channel is a way of interleaving data meant for different endpoints over the same
{@link org.hornetq.core.remoting.RemotingConnection}.
- * <p/>
- * Any packet sent will have its channel id set to the specific channel sending so it can
be routed to its correct channel
- * when received by the {@link org.hornetq.core.remoting.RemotingConnection}. see {@link
org.hornetq.core.remoting.Packet#setChannelID(long)}.
- * <p/>
- * Each Channel should will forward any packets received to its {@link
org.hornetq.core.remoting.ChannelHandler}.
- * <p/>
- * A Channel *does not* support concurrent access by more than one thread!
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface Channel
-{
- /**
- * returns the id of this channel.
- *
- * @return the id
- */
- long getID();
-
- /**
- * sends a packet on this channel.
- *
- * @param packet the packet to send
- */
- void send(Packet packet);
-
- /**
- * sends a packet on this channel and then blocks until it has been written to the
connection.
- *
- * @param packet the packet to send
- */
- void sendAndFlush(Packet packet);
-
- /**
- * sends a packet on this channel and then blocks until a response is received or a
timeout occurs.
- *
- * @param packet the packet to send
- * @return the response
- * @throws HornetQException if an error occurs during the send
- */
- Packet sendBlocking(Packet packet) throws HornetQException;
-
- /**
- * sets the {@link org.hornetq.core.remoting.ChannelHandler} that this channel should
forward received packets to.
- *
- * @param handler the handler
- */
- void setHandler(ChannelHandler handler);
-
- /**
- * closes this channel.
- * <p/>
- * once closed no packets can be sent.
- */
- void close();
-
- /**
- * transfers the connection used by this channel to the one specified.
- * <p/>
- * All new packets will be sent via this connection.
- *
- * @param newConnection the new connection
- */
- void transferConnection(RemotingConnection newConnection);
-
- /**
- * resends any packets that have not received confirmations yet.
- * <p/>
- * Typically called after a connection has been transferred.
- *
- * @param lastConfirmedCommandID the last confirmed packet
- * @param newID the new id to use
- */
- void replayCommands(int lastConfirmedCommandID, final long newID);
-
- /**
- * returns the last confirmed packet command id
- *
- * @return the id
- */
- int getLastConfirmedCommandID();
-
- /**
- * locks the channel.
- * <p/>
- * While locked no packets can be sent or received
- */
- void lock();
-
- /**
- * unlocks the channel.
- */
- void unlock();
-
- /**
- * forces any {@link org.hornetq.core.remoting.Channel#sendBlocking(Packet)} request
to return with an exception.
- */
- void returnBlocking();
-
- /**
- * returns the channel lock
- *
- * @return the lock
- */
- Lock getLock();
-
- /**
- * returns the Remoting Connection being used by the channel
- */
- RemotingConnection getConnection();
-
- /**
- * sends a confirmation of a packet being received.
- *
- * @param packet the packet to confirm
- */
- void confirm(Packet packet);
-
- /**
- * sets the handler to use when a confirmation is received.
- *
- * @param handler the handler to call
- */
- void setCommandConfirmationHandler(CommandConfirmationHandler handler);
-
- /**
- * flushes any confirmations on to the connection.
- */
- void flushConfirmations();
-
- /**
- * Called by {@link org.hornetq.core.remoting.RemotingConnection} when a packet is
received.
- * <p/>
- * This method should then call its {@link org.hornetq.core.remoting.ChannelHandler}
after appropriate processing of
- * the packet
- *
- * @param packet the packet to process.
- */
- void handlePacket(Packet packet);
-
- /**
- * clears any commands from the cache that are yet to be confirmed.
- */
- void clearCommands();
-
- /**
- * returns the confirmation window size this channel is using.
- *
- * @return the window size
- */
- int getConfirmationWindowSize();
-
- /**
- * notifies the channel if it is transferring its connection. When true it is illegal
to send messages.
- *
- * @param transferring whether the channel is transferring
- */
- void setTransferring(boolean transferring);
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ChannelHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ChannelHandler.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ChannelHandler.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,29 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.hornetq.core.remoting;
-
-/**
- * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will
call its handler to deal with the
- * packet.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface ChannelHandler
-{
- /**
- * called by the channel when a packet is received..
- *
- * @param packet the packet received
- */
- void handlePacket(Packet packet);
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting;
-
-/**
- * A CommandConfirmationHandler is used by the channel to confirm confirmations of
packets.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * <p/>
- * Created 9 Feb 2009 12:39:11
- */
-public interface CommandConfirmationHandler
-{
- /**
- * called by channel after a confirmation has been received.
- *
- * @param packet the packet confirmed
- */
- void commandConfirmed(Packet packet);
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Packet.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Packet.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/Packet.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,85 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A Packet represents a pcaket of data transmitted over a connection.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface Packet
-{
- /**
- * This sets the channel id that should be used once the packet has been successfully
decoded it is sent to the correct channel.
- *
- * @param channelID the id of the channel to handle the packet
- */
- void setChannelID(long channelID);
-
- /**
- * returns the channel id of the channel that should handle this pcaket
- *
- * @return the id of the channel
- */
- long getChannelID();
-
- /**
- * returns true if this packet is being sent in response to a previously received
packet
- *
- * @return true if a response
- */
- boolean isResponse();
-
- /**
- * returns the type of the packet.
- * <p/>
- * This is needed when decoding the packet
- *
- * @return the packet type
- */
- byte getType();
-
- /**
- * Encodes the packet and returns a {@link org.hornetq.api.core.HornetQBuffer}
containing the data
- *
- * @param connection the connection
- * @return the buffer to encode to
- */
- HornetQBuffer encode(RemotingConnection connection);
-
- /**
- * decodes the buffer into this packet
- *
- * @param buffer the buffer to decode from
- */
- void decode(HornetQBuffer buffer);
-
- /**
- * returns the size needed to encode this packet.
- *
- * @return The size of the entire packet including headers, and extra data
- */
- int getPacketSize();
-
- /**
- * returns true if a confirmation should be sent on receipt of this packet.
- *
- * @return true if confirmation is required
- */
- boolean isRequiresConfirmations();
-
- boolean isAsyncExec();
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/PacketDecoder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/PacketDecoder.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/PacketDecoder.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,30 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A PacketDecoder
- *
- * @author jmesnil
- *
- *
- */
-public interface PacketDecoder
-{
-
- public abstract Packet decode(final HornetQBuffer in);
-
-}
\ No newline at end of file
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java
(from rev 8819, trunk/src/main/org/hornetq/core/remoting/ProtocolType.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.remoting;
+
+/**
+ * A ProtocolType
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public enum ProtocolType
+{
+ CORE, STOMP, AMQP;
+}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -23,7 +23,7 @@
/**
* A RemotingConnection is a connection between a client and a server.
* <p/>
- * It allows multiple {@link org.hornetq.core.remoting.Channel}'s to be created and
data multiplexed over them. It uses
+ * It allows multiple {@link org.hornetq.core.protocol.core.Channel}'s to be created
and data multiplexed over them. It uses
* and a {@link Connection} implementation and takes care of failures etc.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -46,40 +46,6 @@
String getRemoteAddress();
/**
- * return the channel with the channel id specified.
- * <p/>
- * If it does not exist create it with the confirmation window size.
- *
- * @param channelID the channel id
- * @param confWindowSize the confirmation window size
- * @return the channel
- */
- Channel getChannel(long channelID, int confWindowSize);
-
- /**
- * add the channel with the specified channel id
- *
- * @param channelID the channel id
- * @param channel the channel
- */
- void putChannel(long channelID, Channel channel);
-
- /**
- * remove the channel with the specified channel id
- *
- * @param channelID the channel id
- * @return true if removed
- */
- boolean removeChannel(long channelID);
-
- /**
- * generate a unique (within this connection) channel id
- *
- * @return the id
- */
- long generateChannelID();
-
- /**
* add a failure listener.
* <p/>
* The listener will be called in the event of connection failure.
@@ -150,20 +116,6 @@
void destroy();
/**
- * resets the id generator used to when generating id's
- *
- * @param id the first id to set it to
- */
- void syncIDGeneratorSequence(long id);
-
- /**
- * return the next id that will be chosen.
- *
- * @return the id
- */
- long getIDGeneratorSequence();
-
- /**
* return the underlying Connection.
*
* @return the connection
@@ -182,36 +134,23 @@
*
* @return true if destroyed, otherwise false
*/
- boolean isDestroyed();
-
+ boolean isDestroyed();
+
/**
- * return the current tomeout for blocking calls
- *
- * @return the timeout in milliseconds
+ * Disconnect the connection, closing all channels
*/
- long getBlockingCallTimeout();
-
+ void disconnect();
+
/**
- * return the transfer lock used when transferring connections.
- *
- * @return the lock
- */
- Object getTransferLock();
-
- /**
* returns true if any data has been received since the last time this method was
called.
*
* @return true if data has been received.
*/
boolean checkDataReceived();
-
+
/**
- * remove all channels from the remoting connection
+ * flush all outstanding data from the connection.
*/
- void removeAllChannels();
+ void flush();
- /**
- * flush all outstanding confirmations onto the connection.
- */
- void flushConfirmations();
}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,515 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.ChannelHandler;
-import org.hornetq.core.remoting.CommandConfirmationHandler;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.remoting.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
-import org.hornetq.core.remoting.impl.wireformat.PacketsConfirmedMessage;
-
-/**
- * A ChannelImpl
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class ChannelImpl implements Channel
-{
- private static final Logger log = Logger.getLogger(ChannelImpl.class);
-
- private volatile long id;
-
- private ChannelHandler handler;
-
- private Packet response;
-
- private final java.util.Queue<Packet> resendCache;
-
- private volatile int firstStoredCommandID;
-
- private volatile int lastConfirmedCommandID = -1;
-
- private volatile RemotingConnection connection;
-
- private volatile boolean closed;
-
- private final Lock lock = new ReentrantLock();
-
- private final Condition sendCondition = lock.newCondition();
-
- private final Condition failoverCondition = lock.newCondition();
-
- private final Object sendLock = new Object();
-
- private final Object sendBlockingLock = new Object();
-
- private boolean failingOver;
-
- private final int confWindowSize;
-
- private int receivedBytes;
-
- private CommandConfirmationHandler commandConfirmationHandler;
-
- private volatile boolean transferring;
-
- public ChannelImpl(final RemotingConnection connection, final long id, final int
confWindowSize)
- {
- this.connection = connection;
-
- this.id = id;
-
- this.confWindowSize = confWindowSize;
-
- if (confWindowSize != -1)
- {
- resendCache = new ConcurrentLinkedQueue<Packet>();
- }
- else
- {
- resendCache = null;
- }
- }
-
- public long getID()
- {
- return id;
- }
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- public Lock getLock()
- {
- return lock;
- }
-
- public int getConfirmationWindowSize()
- {
- return confWindowSize;
- }
-
- public void returnBlocking()
- {
- lock.lock();
-
- try
- {
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.UNBLOCKED,
- "Connection
failure detected. Unblocking a blocking call that will never get a response"
-
- ));
-
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public void sendAndFlush(final Packet packet)
- {
- send(packet, true);
- }
-
- public void send(final Packet packet)
- {
- send(packet, false);
- }
-
- public void setTransferring(boolean transferring)
- {
- this.transferring = transferring;
- }
-
- // This must never called by more than one thread concurrently
- public void send(final Packet packet, final boolean flush)
- {
- synchronized (sendLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- //Sanity check
- if (transferring)
- {
- throw new IllegalStateException("Cannot send a packet while channel
is doing failover");
- }
-
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer, flush);
- }
- finally
- {
- lock.unlock();
- }
- }
- }
-
- public Packet sendBlocking(final Packet packet) throws HornetQException
- {
- if (closed)
- {
- throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is
destroyed");
- }
-
- if (connection.getBlockingCallTimeout() == -1)
- {
- throw new IllegalStateException("Cannot do a blocking call timeout on a
server side connection");
- }
-
- // Synchronized since can't be called concurrently by more than one thread and
this can occur
- // E.g. blocking acknowledge() from inside a message handler at some time as other
operation on main thread
- synchronized (sendBlockingLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- response = null;
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer);
-
- long toWait = connection.getBlockingCallTimeout();
-
- long start = System.currentTimeMillis();
-
- while (response == null && toWait > 0)
- {
- try
- {
- sendCondition.await(toWait, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
-
- if (closed)
- {
- break;
- }
-
- final long now = System.currentTimeMillis();
-
- toWait -= now - start;
-
- start = now;
- }
-
- if (response == null)
- {
- throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT,
- "Timed out waiting for response when
sending packet " + packet.getType());
- }
-
- if (response.getType() == PacketImpl.EXCEPTION)
- {
- final HornetQExceptionMessage mem = (HornetQExceptionMessage)response;
-
- HornetQException e = mem.getException();
-
- e.fillInStackTrace();
-
- throw e;
- }
- }
- finally
- {
- lock.unlock();
- }
-
- return response;
- }
- }
-
- public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
- {
- commandConfirmationHandler = handler;
- }
-
- public void setHandler(final ChannelHandler handler)
- {
- this.handler = handler;
- }
-
- public void close()
- {
- if (closed)
- {
- return;
- }
-
- if (!connection.isDestroyed() && !connection.removeChannel(id))
- {
- throw new IllegalArgumentException("Cannot find channel with id " + id
+ " to close");
- }
-
- closed = true;
- }
-
- public void transferConnection(final RemotingConnection newConnection)
- {
- // Needs to synchronize on the connection to make sure no packets from
- // the old connection get processed after transfer has occurred
- synchronized (connection.getTransferLock())
- {
- connection.removeChannel(id);
-
- // And switch it
-
- final RemotingConnectionImpl rnewConnection =
(RemotingConnectionImpl)newConnection;
-
- rnewConnection.putChannel(id, this);
-
- connection = rnewConnection;
-
- transferring = true;
- }
- }
-
- public void replayCommands(final int otherLastConfirmedCommandID, final long
newChannelID)
- {
- if (resendCache != null)
- {
- clearUpTo(otherLastConfirmedCommandID);
-
- for (final Packet packet : resendCache)
- {
- packet.setChannelID(newChannelID);
-
- doWrite(packet);
- }
- }
- }
-
- public void lock()
- {
- lock.lock();
-
- failingOver = true;
-
- lock.unlock();
- }
-
- public void unlock()
- {
- lock.lock();
-
- failingOver = false;
-
- failoverCondition.signalAll();
-
- lock.unlock();
- }
-
- public RemotingConnection getConnection()
- {
- return connection;
- }
-
- //Needs to be synchronized since can be called by remoting service timer thread too
for timeout flush
- public synchronized void flushConfirmations()
- {
- if (resendCache != null && receivedBytes != 0)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
-
- public void confirm(final Packet packet)
- {
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- lastConfirmedCommandID++;
-
- receivedBytes += packet.getPacketSize();
-
- if (receivedBytes >= confWindowSize)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new
PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
- }
-
- public void clearCommands()
- {
- if (resendCache != null)
- {
- lastConfirmedCommandID = -1;
-
- firstStoredCommandID = 0;
-
- resendCache.clear();
- }
- }
-
- public void handlePacket(final Packet packet)
- {
- if (packet.getType() == PacketImpl.PACKETS_CONFIRMED)
- {
- if (resendCache != null)
- {
- final PacketsConfirmedMessage msg = (PacketsConfirmedMessage)packet;
-
- clearUpTo(msg.getCommandID());
- }
-
- if (!connection.isClient())
- {
- handler.handlePacket(packet);
- }
-
- return;
- }
- else
- {
- if (packet.isResponse())
- {
- confirm(packet);
-
- lock.lock();
-
- response = packet;
-
- try
- {
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
- else if (handler != null)
- {
- handler.handlePacket(packet);
- }
- }
- }
-
- private void doWrite(final Packet packet)
- {
- final HornetQBuffer buffer = packet.encode(connection);
-
- connection.getTransportConnection().write(buffer);
- }
-
- private void clearUpTo(final int lastReceivedCommandID)
- {
- final int numberToClear = 1 + lastReceivedCommandID - firstStoredCommandID;
-
- if (numberToClear == -1)
- {
- throw new IllegalArgumentException("Invalid lastReceivedCommandID: " +
lastReceivedCommandID);
- }
-
- int sizeToFree = 0;
-
- for (int i = 0; i < numberToClear; i++)
- {
- final Packet packet = resendCache.poll();
-
- if (packet == null)
- {
- ChannelImpl.log.warn("Can't find packet to clear: " + "
last received command id " +
- lastReceivedCommandID +
- " first stored command id " +
- firstStoredCommandID);
- return;
- }
-
- if (packet.getType() != PacketImpl.PACKETS_CONFIRMED)
- {
- sizeToFree += packet.getPacketSize();
- }
-
- if (commandConfirmationHandler != null)
- {
- commandConfirmationHandler.commandConfirmed(packet);
- }
- }
-
- firstStoredCommandID += numberToClear;
- }
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/CorePacketDecoder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/CorePacketDecoder.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/CorePacketDecoder.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,495 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl;
-
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.CREATESESSION;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.CREATESESSION_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.CREATE_REPLICATION;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.DELETE_QUEUE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.DISCONNECT;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.EXCEPTION;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.NULL_RESPONSE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.PACKETS_CONFIRMED;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.PING;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.REATTACH_SESSION;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REATTACH_SESSION_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_APPEND;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_APPEND_TX;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_COMMIT_ROLLBACK;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_COMPARE_DATA;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_DELETE;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_DELETE_TX;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_LARGE_MESSAGE_END;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_PAGE_EVENT;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_PAGE_WRITE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_PREPARE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.REPLICATION_RESPONSE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_ACKNOWLEDGE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_BINDINGQUERY;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_BINDINGQUERY_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_CLOSE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_COMMIT;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_CONSUMER_CLOSE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_CREATECONSUMER;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_EXPIRED;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_FLOWTOKEN;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_PRODUCER_CREDITS;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_PRODUCER_REQUEST_CREDITS;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_QUEUEQUERY;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_QUEUEQUERY_RESP;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_CONTINUATION;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_LARGE_MSG;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_MSG;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_ROLLBACK;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_SEND;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_SEND_CONTINUATION;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_SEND_LARGE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_START;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_STOP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_COMMIT;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_END;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_FORGET;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_GET_TIMEOUT;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_GET_TIMEOUT_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_INDOUBT_XIDS;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_INDOUBT_XIDS_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_JOIN;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_PREPARE;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_RESUME;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_ROLLBACK;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_SET_TIMEOUT;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_SET_TIMEOUT_RESP;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_START;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_XA_SUSPEND;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.PacketDecoder;
-import org.hornetq.core.remoting.impl.wireformat.CreateQueueMessage;
-import org.hornetq.core.remoting.impl.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.CreateSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.remoting.impl.wireformat.NullResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
-import org.hornetq.core.remoting.impl.wireformat.PacketsConfirmedMessage;
-import org.hornetq.core.remoting.impl.wireformat.Ping;
-import org.hornetq.core.remoting.impl.wireformat.ReattachSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationAddMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationAddTXMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationCommitMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationCompareDataMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationDeleteMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationDeleteTXMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationLargeMessageBeingMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationLargeMessageWriteMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationLargemessageEndMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationPageEventMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationPageWriteMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationPrepareMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReplicationResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.RollbackMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionAcknowledgeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionBindingQueryMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionBindingQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionCloseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionCommitMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionConsumerCloseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionCreateConsumerMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionDeleteQueueMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionExpiredMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionForceConsumerDelivery;
-import org.hornetq.core.remoting.impl.wireformat.SessionProducerCreditsMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionRequestProducerCreditsMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXACommitMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAEndMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAForgetMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAJoinMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAPrepareMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAResumeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXARollbackMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXASetTimeoutMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXASetTimeoutResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAStartMessage;
-
-/**
- * A CorePacketDecoder
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- *
- */
-public class CorePacketDecoder implements PacketDecoder
-{
- private static final Logger log = Logger.getLogger(CorePacketDecoder.class);
-
- public Packet decode(final HornetQBuffer in)
- {
- final byte packetType = in.readByte();
-
- Packet packet;
-
- switch (packetType)
- {
- case PING:
- {
- packet = new Ping();
- break;
- }
- case DISCONNECT:
- {
- packet = new PacketImpl(PacketImpl.DISCONNECT);
- break;
- }
- case EXCEPTION:
- {
- packet = new HornetQExceptionMessage();
- break;
- }
- case PACKETS_CONFIRMED:
- {
- packet = new PacketsConfirmedMessage();
- break;
- }
- case CREATESESSION:
- {
- packet = new CreateSessionMessage();
- break;
- }
- case CREATESESSION_RESP:
- {
- packet = new CreateSessionResponseMessage();
- break;
- }
- case REATTACH_SESSION:
- {
- packet = new ReattachSessionMessage();
- break;
- }
- case REATTACH_SESSION_RESP:
- {
- packet = new ReattachSessionResponseMessage();
- break;
- }
- case SESS_CLOSE:
- {
- packet = new SessionCloseMessage();
- break;
- }
- case SESS_CREATECONSUMER:
- {
- packet = new SessionCreateConsumerMessage();
- break;
- }
- case SESS_ACKNOWLEDGE:
- {
- packet = new SessionAcknowledgeMessage();
- break;
- }
- case SESS_EXPIRED:
- {
- packet = new SessionExpiredMessage();
- break;
- }
- case SESS_COMMIT:
- {
- packet = new SessionCommitMessage();
- break;
- }
- case SESS_ROLLBACK:
- {
- packet = new RollbackMessage();
- break;
- }
- case SESS_QUEUEQUERY:
- {
- packet = new SessionQueueQueryMessage();
- break;
- }
- case SESS_QUEUEQUERY_RESP:
- {
- packet = new SessionQueueQueryResponseMessage();
- break;
- }
- case CREATE_QUEUE:
- {
- packet = new CreateQueueMessage();
- break;
- }
- case DELETE_QUEUE:
- {
- packet = new SessionDeleteQueueMessage();
- break;
- }
- case SESS_BINDINGQUERY:
- {
- packet = new SessionBindingQueryMessage();
- break;
- }
- case SESS_BINDINGQUERY_RESP:
- {
- packet = new SessionBindingQueryResponseMessage();
- break;
- }
- case SESS_XA_START:
- {
- packet = new SessionXAStartMessage();
- break;
- }
- case SESS_XA_END:
- {
- packet = new SessionXAEndMessage();
- break;
- }
- case SESS_XA_COMMIT:
- {
- packet = new SessionXACommitMessage();
- break;
- }
- case SESS_XA_PREPARE:
- {
- packet = new SessionXAPrepareMessage();
- break;
- }
- case SESS_XA_RESP:
- {
- packet = new SessionXAResponseMessage();
- break;
- }
- case SESS_XA_ROLLBACK:
- {
- packet = new SessionXARollbackMessage();
- break;
- }
- case SESS_XA_JOIN:
- {
- packet = new SessionXAJoinMessage();
- break;
- }
- case SESS_XA_SUSPEND:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
- break;
- }
- case SESS_XA_RESUME:
- {
- packet = new SessionXAResumeMessage();
- break;
- }
- case SESS_XA_FORGET:
- {
- packet = new SessionXAForgetMessage();
- break;
- }
- case SESS_XA_INDOUBT_XIDS:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS);
- break;
- }
- case SESS_XA_INDOUBT_XIDS_RESP:
- {
- packet = new SessionXAGetInDoubtXidsResponseMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT:
- {
- packet = new SessionXASetTimeoutMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT_RESP:
- {
- packet = new SessionXASetTimeoutResponseMessage();
- break;
- }
- case SESS_XA_GET_TIMEOUT:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT);
- break;
- }
- case SESS_XA_GET_TIMEOUT_RESP:
- {
- packet = new SessionXAGetTimeoutResponseMessage();
- break;
- }
- case SESS_START:
- {
- packet = new PacketImpl(PacketImpl.SESS_START);
- break;
- }
- case SESS_STOP:
- {
- packet = new PacketImpl(PacketImpl.SESS_STOP);
- break;
- }
- case SESS_FLOWTOKEN:
- {
- packet = new SessionConsumerFlowCreditMessage();
- break;
- }
- case SESS_SEND:
- {
- packet = new SessionSendMessage();
- break;
- }
- case SESS_SEND_LARGE:
- {
- packet = new SessionSendLargeMessage();
- break;
- }
- case SESS_RECEIVE_MSG:
- {
- packet = new SessionReceiveMessage();
- break;
- }
- case SESS_RECEIVE_LARGE_MSG:
- {
- packet = new SessionReceiveLargeMessage();
- break;
- }
- case SESS_CONSUMER_CLOSE:
- {
- packet = new SessionConsumerCloseMessage();
- break;
- }
- case NULL_RESPONSE:
- {
- packet = new NullResponseMessage();
- break;
- }
- case SESS_RECEIVE_CONTINUATION:
- {
- packet = new SessionReceiveContinuationMessage();
- break;
- }
- case SESS_SEND_CONTINUATION:
- {
- packet = new SessionSendContinuationMessage();
- break;
- }
- case SESS_PRODUCER_REQUEST_CREDITS:
- {
- packet = new SessionRequestProducerCreditsMessage();
- break;
- }
- case SESS_PRODUCER_CREDITS:
- {
- packet = new SessionProducerCreditsMessage();
- break;
- }
- case CREATE_REPLICATION:
- {
- packet = new CreateReplicationSessionMessage();
- break;
- }
- case REPLICATION_APPEND:
- {
- packet = new ReplicationAddMessage();
- break;
- }
- case REPLICATION_APPEND_TX:
- {
- packet = new ReplicationAddTXMessage();
- break;
- }
- case REPLICATION_DELETE:
- {
- packet = new ReplicationDeleteMessage();
- break;
- }
- case REPLICATION_DELETE_TX:
- {
- packet = new ReplicationDeleteTXMessage();
- break;
- }
- case REPLICATION_PREPARE:
- {
- packet = new ReplicationPrepareMessage();
- break;
- }
- case REPLICATION_COMMIT_ROLLBACK:
- {
- packet = new ReplicationCommitMessage();
- break;
- }
- case REPLICATION_RESPONSE:
- {
- packet = new ReplicationResponseMessage();
- break;
- }
- case REPLICATION_PAGE_WRITE:
- {
- packet = new ReplicationPageWriteMessage();
- break;
- }
- case REPLICATION_PAGE_EVENT:
- {
- packet = new ReplicationPageEventMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_BEGIN:
- {
- packet = new ReplicationLargeMessageBeingMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_END:
- {
- packet = new ReplicationLargemessageEndMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_WRITE:
- {
- packet = new ReplicationLargeMessageWriteMessage();
- break;
- }
- case REPLICATION_COMPARE_DATA:
- {
- packet = new ReplicationCompareDataMessage();
- break;
- }
- case SESS_FORCE_CONSUMER_DELIVERY:
- {
- packet = new SessionForceConsumerDelivery();
- break;
- }
- default:
- {
- throw new IllegalArgumentException("Invalid type: " + packetType);
- }
- }
-
- packet.decode(in);
-
- return packet;
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,525 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executor;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.PacketDecoder;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.spi.core.remoting.Connection;
-import org.hornetq.utils.SimpleIDGenerator;
-
-/**
- * @author <a href="tim.fox(a)jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @version <tt>$Revision$</tt> $Id$
- */
-public class RemotingConnectionImpl implements RemotingConnection, BufferHandler
-{
- // Constants
- //
------------------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(RemotingConnectionImpl.class);
-
- // Static
- //
---------------------------------------------------------------------------------------
-
- // Attributes
- //
-----------------------------------------------------------------------------------
-
- private final Connection transportConnection;
-
- private final Map<Long, Channel> channels = new ConcurrentHashMap<Long,
Channel>();
-
- private final List<FailureListener> failureListeners = new
CopyOnWriteArrayList<FailureListener>();
-
- private final List<CloseListener> closeListeners = new
CopyOnWriteArrayList<CloseListener>();
-
- private final long blockingCallTimeout;
-
- private final List<Interceptor> interceptors;
-
- private volatile boolean destroyed;
-
- private final boolean client;
-
- // Channels 0-9 are reserved for the system
- // 0 is for pinging
- // 1 is for session creation and attachment
- // 2 is for replication
- private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(10);
-
- private boolean idGeneratorSynced = false;
-
- private final Object transferLock = new Object();
-
- private final Object failLock = new Object();
-
- private volatile boolean dataReceived;
-
- private final Executor executor;
-
- // Constructors
- // ---------------------------------------------------------------------------------
-
- /*
- * Create a client side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors)
- {
- this(transportConnection, blockingCallTimeout, interceptors, true, null);
- }
-
- /*
- * Create a server side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final List<Interceptor> interceptors,
- final Executor executor)
-
- {
- this(transportConnection, -1, interceptors, false, executor);
- }
-
- private RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors,
- final boolean client,
- final Executor executor)
-
- {
- this.transportConnection = transportConnection;
-
- this.blockingCallTimeout = blockingCallTimeout;
-
- this.interceptors = interceptors;
-
- this.client = client;
-
- this.executor = executor;
- }
-
- // RemotingConnection implementation
- // ------------------------------------------------------------
-
- public Connection getTransportConnection()
- {
- return transportConnection;
- }
-
- public List<FailureListener> getFailureListeners()
- {
- return new ArrayList<FailureListener>(failureListeners);
- }
-
- public void setFailureListeners(final List<FailureListener> listeners)
- {
- failureListeners.clear();
-
- failureListeners.addAll(listeners);
- }
-
- public Object getID()
- {
- return transportConnection.getID();
- }
-
- public String getRemoteAddress()
- {
- return transportConnection.getRemoteAddress();
- }
-
- public synchronized Channel getChannel(final long channelID, final int
confWindowSize)
- {
- Channel channel = channels.get(channelID);
-
- if (channel == null)
- {
- channel = new ChannelImpl(this, channelID, confWindowSize);
-
- channels.put(channelID, channel);
- }
-
- return channel;
- }
-
- public synchronized boolean removeChannel(final long channelID)
- {
- return channels.remove(channelID) != null;
- }
-
- public synchronized void putChannel(final long channelID, final Channel channel)
- {
- channels.put(channelID, channel);
- }
-
- public void addFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- failureListeners.add(listener);
- }
-
- public boolean removeFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- return failureListeners.remove(listener);
- }
-
- public void addCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- closeListeners.add(listener);
- }
-
- public boolean removeCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- return closeListeners.remove(listener);
- }
-
- public HornetQBuffer createBuffer(final int size)
- {
- return transportConnection.createBuffer(size);
- }
-
- /*
- * This can be called concurrently by more than one thread so needs to be locked
- */
- public void fail(final HornetQException me)
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- RemotingConnectionImpl.log.warn("Connection failure has been detected: "
+ me.getMessage() +
- " [code=" +
- me.getCode() +
- "]");
-
- // Then call the listeners
- callFailureListeners(me);
-
- callClosingListeners();
-
- internalClose();
-
- for (Channel channel : channels.values())
- {
- channel.returnBlocking();
- }
- }
-
- public void destroy()
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- internalClose();
-
- callClosingListeners();
- }
-
- public long generateChannelID()
- {
- return idGenerator.generateID();
- }
-
- public synchronized void syncIDGeneratorSequence(final long id)
- {
- if (!idGeneratorSynced)
- {
- idGenerator = new SimpleIDGenerator(id);
-
- idGeneratorSynced = true;
- }
- }
-
- public long getIDGeneratorSequence()
- {
- return idGenerator.getCurrentID();
- }
-
- public Object getTransferLock()
- {
- return transferLock;
- }
-
- public boolean isClient()
- {
- return client;
- }
-
- public boolean isDestroyed()
- {
- return destroyed;
- }
-
- public long getBlockingCallTimeout()
- {
- return blockingCallTimeout;
- }
-
- public boolean checkDataReceived()
- {
- boolean res = dataReceived;
-
- dataReceived = false;
-
- return res;
- }
-
- public void removeAllChannels()
- {
- // We get the transfer lock first - this ensures no packets are being processed
AND
- // it's guaranteed no more packets will be processed once this method is
complete
- synchronized (transferLock)
- {
- channels.clear();
- }
- }
-
- public void flushConfirmations()
- {
- synchronized (transferLock)
- {
- for (Channel channel : channels.values())
- {
- channel.flushConfirmations();
- }
- }
- }
-
- // Buffer Handler implementation
- // ----------------------------------------------------
-
- private volatile boolean executing;
-
- public void bufferReceived(final Object connectionID, final HornetQBuffer buffer,
final PacketDecoder decoder)
- {
- final Packet packet = decoder.decode(buffer);
-
- if (packet.isAsyncExec() && executor != null)
- {
- executing = true;
-
- executor.execute(new Runnable()
- {
- public void run()
- {
- try
- {
- doBufferReceived(packet);
- }
- catch (Throwable t)
- {
- RemotingConnectionImpl.log.error("Unexpected error", t);
- }
-
- executing = false;
- }
- });
- }
- else
- {
- //To prevent out of order execution if interleaving sync and async operations on
same connection
- while (executing)
- {
- Thread.yield();
- }
-
- // Pings must always be handled out of band so we can send pings back to the
client quickly
- // otherwise they would get in the queue with everything else which might give
an intolerable delay
- doBufferReceived(packet);
- }
-
- dataReceived = true;
- }
-
- public void packetReceived(final Object connectionID, final Packet packet)
- {
- if (packet.isAsyncExec() && executor != null)
- {
- executing = true;
-
- executor.execute(new Runnable()
- {
- public void run()
- {
- try
- {
- doBufferReceived(packet);
- }
- catch (Throwable t)
- {
- RemotingConnectionImpl.log.error("Unexpected error", t);
- }
-
- executing = false;
- }
- });
- }
- else
- {
- //To prevent out of order execution if interleaving sync and async operations on
same connection
- while (executing)
- {
- Thread.yield();
- }
-
- // Pings must always be handled out of band so we can send pings back to the
client quickly
- // otherwise they would get in the queue with everything else which might give
an intolerable delay
- doBufferReceived(packet);
- }
-
- dataReceived = true;
- }
-
- private void doBufferReceived(final Packet packet)
- {
- if (interceptors != null)
- {
- for (final Interceptor interceptor : interceptors)
- {
- try
- {
- boolean callNext = interceptor.intercept(packet, this);
-
- if (!callNext)
- {
- return;
- }
- }
- catch (final Throwable e)
- {
- RemotingConnectionImpl.log.warn("Failure in calling interceptor:
" + interceptor, e);
- }
- }
- }
-
- synchronized (transferLock)
- {
- final Channel channel = channels.get(packet.getChannelID());
-
- if (channel != null)
- {
- channel.handlePacket(packet);
- }
- }
- }
-
- // Package protected
- // ----------------------------------------------------------------------------
-
- // Protected
- //
------------------------------------------------------------------------------------
-
- // Private
- //
--------------------------------------------------------------------------------------
-
- private void callFailureListeners(final HornetQException me)
- {
- final List<FailureListener> listenersClone = new
ArrayList<FailureListener>(failureListeners);
-
- for (final FailureListener listener : listenersClone)
- {
- try
- {
- listener.connectionFailed(me);
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void callClosingListeners()
- {
- final List<CloseListener> listenersClone = new
ArrayList<CloseListener>(closeListeners);
-
- for (final CloseListener listener : listenersClone)
- {
- try
- {
- listener.connectionClosed();
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void internalClose()
- {
- // We close the underlying transport connection
- transportConnection.close();
-
- for (Channel channel : channels.values())
- {
- channel.close();
- }
- }
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
import org.hornetq.integration.transports.netty.ServerHolder;
@@ -217,14 +218,14 @@
this.connector = connector;
}
- public void connectionCreated(final Connection connection)
+ public void connectionCreated(final Connection connection, final ProtocolType
protocol)
{
if (connections.putIfAbsent((String)connection.getID(), connection) != null)
{
throw new IllegalArgumentException("Connection already exists with id
" + connection.getID());
}
- listener.connectionCreated(connection);
+ listener.connectionCreated(connection, protocol);
}
public void connectionDestroyed(final Object connectionID)
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -17,10 +17,9 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
-import org.hornetq.api.core.HornetQException;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.PacketDecoder;
-import org.hornetq.core.remoting.impl.CorePacketDecoder;
+import org.hornetq.core.protocol.core.PacketDecoder;
+import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
@@ -38,7 +37,7 @@
private final BufferHandler handler;
- private final PacketDecoder decoder = new CorePacketDecoder();
+ private final PacketDecoder decoder = new PacketDecoder();
private final ConnectionLifeCycleListener listener;
@@ -74,7 +73,7 @@
this.executor = executor;
- listener.connectionCreated(this);
+ listener.connectionCreated(this, ProtocolType.CORE);
}
private volatile boolean closing;
@@ -132,7 +131,7 @@
{
copied.readInt(); // read and discard
- handler.bufferReceived(id, copied, decoder);
+ handler.bufferReceived(id, copied);
}
}
catch (Exception e)
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -19,6 +19,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
@@ -174,14 +175,14 @@
private class Listener implements ConnectionLifeCycleListener
{
- public void connectionCreated(final Connection connection)
+ public void connectionCreated(final Connection connection, final ProtocolType
protocol)
{
if (connections.putIfAbsent((String)connection.getID(), connection) != null)
{
throw new IllegalArgumentException("Connection already exists with id
" + connection.getID());
}
- listener.connectionCreated(connection);
+ listener.connectionCreated(connection, protocol);
}
public void connectionDestroyed(final Object connectionID)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateQueueMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateQueueMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateQueueMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,162 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.logging.Logger;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
-
- * @version <tt>$Revision$</tt>
- */
-public class CreateQueueMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(CreateQueueMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private SimpleString address;
-
- private SimpleString queueName;
-
- private SimpleString filterString;
-
- private boolean durable;
-
- private boolean temporary;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateQueueMessage(final SimpleString address,
- final SimpleString queueName,
- final SimpleString filterString,
- final boolean durable,
- final boolean temporary,
- final boolean requiresResponse)
- {
- super(PacketImpl.CREATE_QUEUE);
-
- this.address = address;
- this.queueName = queueName;
- this.filterString = filterString;
- this.durable = durable;
- this.temporary = temporary;
- this.requiresResponse = requiresResponse;
- }
-
- public CreateQueueMessage()
- {
- super(PacketImpl.CREATE_QUEUE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", address=" + address);
- buff.append(", queueName=" + queueName);
- buff.append(", filterString=" + filterString);
- buff.append(", durable=" + durable);
- buff.append(", temporary=" + temporary);
- buff.append("]");
- return buff.toString();
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public boolean isTemporary()
- {
- return temporary;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(address);
- buffer.writeSimpleString(queueName);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeBoolean(durable);
- buffer.writeBoolean(temporary);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- address = buffer.readSimpleString();
- queueName = buffer.readSimpleString();
- filterString = buffer.readNullableSimpleString();
- durable = buffer.readBoolean();
- temporary = buffer.readBoolean();
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateQueueMessage == false)
- {
- return false;
- }
-
- CreateQueueMessage r = (CreateQueueMessage)other;
-
- return super.equals(other) && r.address.equals(address) &&
- r.queueName.equals(queueName) &&
- (r.filterString == null ? filterString == null :
r.filterString.equals(filterString)) &&
- r.durable == durable &&
- r.temporary == temporary;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateReplicationSessionMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateReplicationSessionMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateReplicationSessionMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,74 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
- */
-public class CreateReplicationSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long sessionChannelID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateReplicationSessionMessage(final long sessionChannelID)
- {
- super(PacketImpl.CREATE_REPLICATION);
-
- this.sessionChannelID = sessionChannelID;
- }
-
- public CreateReplicationSessionMessage()
- {
- super(PacketImpl.CREATE_REPLICATION);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(sessionChannelID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- sessionChannelID = buffer.readLong();
- }
-
- /**
- * @return the sessionChannelID
- */
- public long getSessionChannelID()
- {
- return sessionChannelID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,222 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class CreateSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private String name;
-
- private long sessionChannelID;
-
- private int version;
-
- private String username;
-
- private String password;
-
- private int minLargeMessageSize;
-
- private boolean xa;
-
- private boolean autoCommitSends;
-
- private boolean autoCommitAcks;
-
- private boolean preAcknowledge;
-
- private int windowSize;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateSessionMessage(final String name,
- final long sessionChannelID,
- final int version,
- final String username,
- final String password,
- final int minLargeMessageSize,
- final boolean xa,
- final boolean autoCommitSends,
- final boolean autoCommitAcks,
- final boolean preAcknowledge,
- final int windowSize)
- {
- super(PacketImpl.CREATESESSION);
-
- this.name = name;
-
- this.sessionChannelID = sessionChannelID;
-
- this.version = version;
-
- this.username = username;
-
- this.password = password;
-
- this.minLargeMessageSize = minLargeMessageSize;
-
- this.xa = xa;
-
- this.autoCommitSends = autoCommitSends;
-
- this.autoCommitAcks = autoCommitAcks;
-
- this.windowSize = windowSize;
-
- this.preAcknowledge = preAcknowledge;
- }
-
- public CreateSessionMessage()
- {
- super(PacketImpl.CREATESESSION);
- }
-
- // Public --------------------------------------------------------
-
- public String getName()
- {
- return name;
- }
-
- public long getSessionChannelID()
- {
- return sessionChannelID;
- }
-
- public int getVersion()
- {
- return version;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public boolean isXA()
- {
- return xa;
- }
-
- public boolean isAutoCommitSends()
- {
- return autoCommitSends;
- }
-
- public boolean isAutoCommitAcks()
- {
- return autoCommitAcks;
- }
-
- public boolean isPreAcknowledge()
- {
- return preAcknowledge;
- }
-
- public int getWindowSize()
- {
- return windowSize;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeString(name);
- buffer.writeLong(sessionChannelID);
- buffer.writeInt(version);
- buffer.writeNullableString(username);
- buffer.writeNullableString(password);
- buffer.writeInt(minLargeMessageSize);
- buffer.writeBoolean(xa);
- buffer.writeBoolean(autoCommitSends);
- buffer.writeBoolean(autoCommitAcks);
- buffer.writeInt(windowSize);
- buffer.writeBoolean(preAcknowledge);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- name = buffer.readString();
- sessionChannelID = buffer.readLong();
- version = buffer.readInt();
- username = buffer.readNullableString();
- password = buffer.readNullableString();
- minLargeMessageSize = buffer.readInt();
- xa = buffer.readBoolean();
- autoCommitSends = buffer.readBoolean();
- autoCommitAcks = buffer.readBoolean();
- windowSize = buffer.readInt();
- preAcknowledge = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateSessionMessage == false)
- {
- return false;
- }
-
- CreateSessionMessage r = (CreateSessionMessage)other;
-
- boolean matches = super.equals(other) && name.equals(r.name) &&
- sessionChannelID == r.sessionChannelID &&
- version == r.version &&
- xa == r.xa &&
- autoCommitSends == r.autoCommitSends &&
- autoCommitAcks == r.autoCommitAcks &&
- (username == null ? r.username == null :
username.equals(r.username)) &&
- (password == null ? r.password == null :
password.equals(r.password));
-
- return matches;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- public int getMinLargeMessageSize()
- {
- return minLargeMessageSize;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/CreateSessionResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class CreateSessionResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int serverVersion;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateSessionResponseMessage(final int serverVersion)
- {
- super(PacketImpl.CREATESESSION_RESP);
-
- this.serverVersion = serverVersion;
- }
-
- public CreateSessionResponseMessage()
- {
- super(PacketImpl.CREATESESSION_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public int getServerVersion()
- {
- return serverVersion;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(serverVersion);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- serverVersion = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateSessionResponseMessage == false)
- {
- return false;
- }
-
- CreateSessionResponseMessage r = (CreateSessionResponseMessage)other;
-
- boolean matches = super.equals(other) && serverVersion == r.serverVersion;
-
- return matches;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/HornetQExceptionMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/HornetQExceptionMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/HornetQExceptionMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,108 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class HornetQExceptionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(HornetQExceptionMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private HornetQException exception;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public HornetQExceptionMessage(final HornetQException exception)
- {
- super(PacketImpl.EXCEPTION);
-
- this.exception = exception;
- }
-
- public HornetQExceptionMessage()
- {
- super(PacketImpl.EXCEPTION);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public HornetQException getException()
- {
- return exception;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(exception.getCode());
- buffer.writeNullableString(exception.getMessage());
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int code = buffer.readInt();
- String msg = buffer.readNullableString();
-
- exception = new HornetQException(code, msg);
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", exception= " + exception + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof HornetQExceptionMessage == false)
- {
- return false;
- }
-
- HornetQExceptionMessage r = (HornetQExceptionMessage)other;
-
- return super.equals(other) && exception.equals(r.exception);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/MessagePacket.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/MessagePacket.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/MessagePacket.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,45 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.Message;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-
-/**
- * A MessagePacket
- *
- * @author Tim Fox
- *
- *
- */
-public abstract class MessagePacket extends PacketImpl
-{
- private static final Logger log = Logger.getLogger(MessagePacket.class);
-
- protected MessageInternal message;
-
- public MessagePacket(final byte type, final MessageInternal message)
- {
- super(type);
-
- this.message = message;
- }
-
- public Message getMessage()
- {
- return message;
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/NullResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/NullResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/NullResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,50 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class NullResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public NullResponseMessage()
- {
- super(PacketImpl.NULL_RESPONSE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketImpl.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketImpl.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,311 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class PacketImpl implements Packet
-{
- // Constants
-------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(PacketImpl.class);
-
- // The minimal size for all the packets, Common data for all the packets (look at
PacketImpl.encode)
- public static final int PACKET_HEADERS_SIZE = DataConstants.SIZE_INT +
DataConstants.SIZE_BYTE +
- DataConstants.SIZE_LONG;
-
- private static final int INITIAL_PACKET_SIZE = 1500;
-
- protected long channelID;
-
- protected final byte type;
-
- protected int size = -1;
-
- // The packet types
- //
-----------------------------------------------------------------------------------
-
- public static final byte PING = 10;
-
- public static final byte DISCONNECT = 11;
-
- // Miscellaneous
- public static final byte EXCEPTION = 20;
-
- public static final byte NULL_RESPONSE = 21;
-
- public static final byte PACKETS_CONFIRMED = 22;
-
- // Server
- public static final byte CREATESESSION = 30;
-
- public static final byte CREATESESSION_RESP = 31;
-
- public static final byte REATTACH_SESSION = 32;
-
- public static final byte REATTACH_SESSION_RESP = 33;
-
- public static final byte CREATE_QUEUE = 34;
-
- public static final byte DELETE_QUEUE = 35;
-
- public static final byte CREATE_REPLICATION = 36;
-
- // Session
- public static final byte SESS_CREATECONSUMER = 40;
-
- public static final byte SESS_ACKNOWLEDGE = 41;
-
- public static final byte SESS_EXPIRED = 42;
-
- public static final byte SESS_COMMIT = 43;
-
- public static final byte SESS_ROLLBACK = 44;
-
- public static final byte SESS_QUEUEQUERY = 45;
-
- public static final byte SESS_QUEUEQUERY_RESP = 46;
-
- public static final byte SESS_BINDINGQUERY = 49;
-
- public static final byte SESS_BINDINGQUERY_RESP = 50;
-
- public static final byte SESS_XA_START = 51;
-
- public static final byte SESS_XA_END = 52;
-
- public static final byte SESS_XA_COMMIT = 53;
-
- public static final byte SESS_XA_PREPARE = 54;
-
- public static final byte SESS_XA_RESP = 55;
-
- public static final byte SESS_XA_ROLLBACK = 56;
-
- public static final byte SESS_XA_JOIN = 57;
-
- public static final byte SESS_XA_SUSPEND = 58;
-
- public static final byte SESS_XA_RESUME = 59;
-
- public static final byte SESS_XA_FORGET = 60;
-
- public static final byte SESS_XA_INDOUBT_XIDS = 61;
-
- public static final byte SESS_XA_INDOUBT_XIDS_RESP = 62;
-
- public static final byte SESS_XA_SET_TIMEOUT = 63;
-
- public static final byte SESS_XA_SET_TIMEOUT_RESP = 64;
-
- public static final byte SESS_XA_GET_TIMEOUT = 65;
-
- public static final byte SESS_XA_GET_TIMEOUT_RESP = 66;
-
- public static final byte SESS_START = 67;
-
- public static final byte SESS_STOP = 68;
-
- public static final byte SESS_CLOSE = 69;
-
- public static final byte SESS_FLOWTOKEN = 70;
-
- public static final byte SESS_SEND = 71;
-
- public static final byte SESS_SEND_LARGE = 72;
-
- public static final byte SESS_SEND_CONTINUATION = 73;
-
- public static final byte SESS_CONSUMER_CLOSE = 74;
-
- public static final byte SESS_RECEIVE_MSG = 75;
-
- public static final byte SESS_RECEIVE_LARGE_MSG = 76;
-
- public static final byte SESS_RECEIVE_CONTINUATION = 77;
-
- public static final byte SESS_FORCE_CONSUMER_DELIVERY = 78;
-
- public static final byte SESS_PRODUCER_REQUEST_CREDITS = 79;
-
- public static final byte SESS_PRODUCER_CREDITS = 80;
-
- // Replication
-
- public static final byte REPLICATION_RESPONSE = 90;
-
- public static final byte REPLICATION_APPEND = 91;
-
- public static final byte REPLICATION_APPEND_TX = 92;
-
- public static final byte REPLICATION_DELETE = 93;
-
- public static final byte REPLICATION_DELETE_TX = 94;
-
- public static final byte REPLICATION_PREPARE = 95;
-
- public static final byte REPLICATION_COMMIT_ROLLBACK = 96;
-
- public static final byte REPLICATION_PAGE_WRITE = 97;
-
- public static final byte REPLICATION_PAGE_EVENT = 98;
-
- public static final byte REPLICATION_LARGE_MESSAGE_BEGIN = 99;
-
- public static final byte REPLICATION_LARGE_MESSAGE_END = 100;
-
- public static final byte REPLICATION_LARGE_MESSAGE_WRITE = 101;
-
- public static final byte REPLICATION_COMPARE_DATA = 102;
-
- public static final byte REPLICATION_SYNC = 103;
-
- // Static --------------------------------------------------------
-
- public PacketImpl(final byte type)
- {
- this.type = type;
- }
-
- // Public --------------------------------------------------------
-
- public byte getType()
- {
- return type;
- }
-
- public long getChannelID()
- {
- return channelID;
- }
-
- public void setChannelID(final long channelID)
- {
- this.channelID = channelID;
- }
-
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
-
- // The standard header fields
-
- buffer.writeInt(0); // The length gets filled in at the end
- buffer.writeByte(type);
- buffer.writeLong(channelID);
-
- encodeRest(buffer);
-
- size = buffer.writerIndex();
-
- // The length doesn't include the actual length byte
- int len = size - DataConstants.SIZE_INT;
-
- buffer.setInt(0, len);
-
- return buffer;
- }
-
- public void decode(final HornetQBuffer buffer)
- {
- channelID = buffer.readLong();
-
- decodeRest(buffer);
-
- size = buffer.readerIndex();
- }
-
- public int getPacketSize()
- {
- if (size == -1)
- {
- throw new IllegalStateException("Packet hasn't been encoded/decoded
yet");
- }
-
- return size;
- }
-
- public boolean isResponse()
- {
- return false;
- }
-
- public void encodeRest(final HornetQBuffer buffer)
- {
- }
-
- public void decodeRest(final HornetQBuffer buffer)
- {
- }
-
- public boolean isRequiresConfirmations()
- {
- return true;
- }
-
- public boolean isAsyncExec()
- {
- return false;
- }
-
- @Override
- public String toString()
- {
- return getParentString() + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof PacketImpl == false)
- {
- return false;
- }
-
- PacketImpl r = (PacketImpl)other;
-
- return r.type == type && r.channelID == channelID;
- }
-
- // Package protected ---------------------------------------------
-
- protected String getParentString()
- {
- return "PACKET[type=" + type + ", channelID=" + channelID +
"]";
- }
-
- // Protected -----------------------------------------------------
-
- protected int stringEncodeSize(final String str)
- {
- return DataConstants.SIZE_INT + str.length() * 2;
- }
-
- protected int nullableStringEncodeSize(final String str)
- {
- return DataConstants.SIZE_BOOLEAN + (str != null ? stringEncodeSize(str) : 0);
- }
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketsConfirmedMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketsConfirmedMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/PacketsConfirmedMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- *
- * A PacketsConfirmedMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class PacketsConfirmedMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int commandID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public PacketsConfirmedMessage(final int commandID)
- {
- super(PacketImpl.PACKETS_CONFIRMED);
-
- this.commandID = commandID;
- }
-
- public PacketsConfirmedMessage()
- {
- super(PacketImpl.PACKETS_CONFIRMED);
- }
-
- // Public --------------------------------------------------------
-
- public int getCommandID()
- {
- return commandID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(commandID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- commandID = buffer.readInt();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", commandID=" + commandID + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof PacketsConfirmedMessage == false)
- {
- return false;
- }
-
- PacketsConfirmedMessage r = (PacketsConfirmedMessage)other;
-
- return super.equals(other) && commandID == r.commandID;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/Ping.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/Ping.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/Ping.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,103 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- *
- * A Ping
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class Ping extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long connectionTTL;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public Ping(final long connectionTTL)
- {
- super(PacketImpl.PING);
-
- this.connectionTTL = connectionTTL;
- }
-
- public Ping()
- {
- super(PacketImpl.PING);
- }
-
- // Public --------------------------------------------------------
-
- public long getConnectionTTL()
- {
- return connectionTTL;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(connectionTTL);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- connectionTTL = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getParentString());
- buf.append(", connectionTTL=" + connectionTTL);
- buf.append("]");
- return buf.toString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof Ping == false)
- {
- return false;
- }
-
- Ping r = (Ping)other;
-
- return super.equals(other) && connectionTTL == r.connectionTTL;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,105 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- *
- * A ReattachSessionMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class ReattachSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private String name;
-
- private int lastConfirmedCommandID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReattachSessionMessage(final String name, final int lastConfirmedCommandID)
- {
- super(PacketImpl.REATTACH_SESSION);
-
- this.name = name;
-
- this.lastConfirmedCommandID = lastConfirmedCommandID;
- }
-
- public ReattachSessionMessage()
- {
- super(PacketImpl.REATTACH_SESSION);
- }
-
- // Public --------------------------------------------------------
-
- public String getName()
- {
- return name;
- }
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeString(name);
- buffer.writeInt(lastConfirmedCommandID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- name = buffer.readString();
- lastConfirmedCommandID = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof ReattachSessionMessage == false)
- {
- return false;
- }
-
- ReattachSessionMessage r = (ReattachSessionMessage)other;
-
- return super.equals(other) && name.equals(r.name);
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReattachSessionResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,111 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- *
- * A ReattachSessionResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class ReattachSessionResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int lastConfirmedCommandID;
-
- private boolean reattached;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReattachSessionResponseMessage(final int lastConfirmedCommandID, final boolean
reattached)
- {
- super(PacketImpl.REATTACH_SESSION_RESP);
-
- this.lastConfirmedCommandID = lastConfirmedCommandID;
-
- this.reattached = reattached;
- }
-
- public ReattachSessionResponseMessage()
- {
- super(PacketImpl.REATTACH_SESSION_RESP);
- }
-
- // Public --------------------------------------------------------
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- public boolean isReattached()
- {
- return reattached;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(lastConfirmedCommandID);
- buffer.writeBoolean(reattached);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- lastConfirmedCommandID = buffer.readInt();
- reattached = buffer.readBoolean();
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof ReattachSessionResponseMessage == false)
- {
- return false;
- }
-
- ReattachSessionResponseMessage r = (ReattachSessionResponseMessage)other;
-
- return super.equals(other) && lastConfirmedCommandID ==
r.lastConfirmedCommandID;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,142 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.logging.Logger;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationAddMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ReplicationAddMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean isUpdate;
-
- private byte recordType;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationAddMessage()
- {
- super(PacketImpl.REPLICATION_APPEND);
- }
-
- public ReplicationAddMessage(final byte journalID,
- final boolean isUpdate,
- final long id,
- final byte recordType,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.isUpdate = isUpdate;
- this.id = id;
- this.recordType = recordType;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(isUpdate);
- buffer.writeLong(id);
- buffer.writeByte(recordType);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- isUpdate = buffer.readBoolean();
- id = buffer.readLong();
- recordType = buffer.readByte();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- public boolean isUpdate()
- {
- return isUpdate;
- }
-
- /**
- * @return the recordType
- */
- public byte getRecordType()
- {
- return recordType;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddTXMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddTXMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationAddTXMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,150 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationAddTXMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean isUpdate;
-
- private byte recordType;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationAddTXMessage()
- {
- super(PacketImpl.REPLICATION_APPEND_TX);
- }
-
- public ReplicationAddTXMessage(final byte journalID,
- final boolean isUpdate,
- final long txId,
- final long id,
- final byte recordType,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.isUpdate = isUpdate;
- this.txId = txId;
- this.id = id;
- this.recordType = recordType;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(isUpdate);
- buffer.writeLong(txId);
- buffer.writeLong(id);
- buffer.writeByte(recordType);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- isUpdate = buffer.readBoolean();
- txId = buffer.readLong();
- id = buffer.readLong();
- recordType = buffer.readByte();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- public boolean isUpdate()
- {
- return isUpdate;
- }
-
- /**
- * @return the recordType
- */
- public byte getRecordType()
- {
- return recordType;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCommitMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCommitMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCommitMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationCommitMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean rollback;
-
- private long txId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationCommitMessage()
- {
- super(PacketImpl.REPLICATION_COMMIT_ROLLBACK);
- }
-
- public ReplicationCommitMessage(final byte journalID, final boolean rollback, final
long txId)
- {
- this();
- this.journalID = journalID;
- this.rollback = rollback;
- this.txId = txId;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(rollback);
- buffer.writeLong(txId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- rollback = buffer.readBoolean();
- txId = buffer.readLong();
- }
-
- public boolean isRollback()
- {
- return rollback;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCompareDataMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCompareDataMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationCompareDataMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,92 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.JournalLoadInformation;
-
-/**
- * Message used to compare if the Journals between the live and
- * backup nodes are equivalent and can be used over replication.
- * The backup journal needs to be an exact copy of the live node before it starts.
- * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
- */
-public class ReplicationCompareDataMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private JournalLoadInformation[] journalInformation;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationCompareDataMessage(final JournalLoadInformation[]
journalInformation)
- {
- super(PacketImpl.REPLICATION_COMPARE_DATA);
-
- this.journalInformation = journalInformation;
- }
-
- public ReplicationCompareDataMessage()
- {
- super(PacketImpl.REPLICATION_COMPARE_DATA);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(journalInformation.length);
- for (JournalLoadInformation info : journalInformation)
- {
- buffer.writeInt(info.getNumberOfRecords());
- buffer.writeLong(info.getMaxID());
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int numberOfJournals = buffer.readInt();
-
- journalInformation = new JournalLoadInformation[numberOfJournals];
-
- for (int i = 0; i < numberOfJournals; i++)
- {
- journalInformation[i] = new JournalLoadInformation();
- journalInformation[i].setNumberOfRecords(buffer.readInt());
- journalInformation[i].setMaxID(buffer.readLong());
- }
- }
-
- /**
- * @return the journalInformation
- */
- public JournalLoadInformation[] getJournalInformation()
- {
- return journalInformation;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationDeleteMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationDeleteMessage()
- {
- super(PacketImpl.REPLICATION_DELETE);
- }
-
- public ReplicationDeleteMessage(final byte journalID, final long id)
- {
- this();
- this.journalID = journalID;
- this.id = id;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(id);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- id = buffer.readLong();
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteTXMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,125 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationDeleteTXMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationDeleteTXMessage()
- {
- super(PacketImpl.REPLICATION_DELETE_TX);
- }
-
- public ReplicationDeleteTXMessage(final byte journalID,
- final long txId,
- final long id,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.txId = txId;
- this.id = id;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(txId);
- buffer.writeLong(id);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- txId = buffer.readLong();
- id = buffer.readLong();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageBeingMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,79 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A ReplicationLargeMessageBeingMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargeMessageBeingMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- long messageId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationLargeMessageBeingMessage(final long messageId)
- {
- this();
- this.messageId = messageId;
- }
-
- public ReplicationLargeMessageBeingMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageWriteMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,99 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A ReplicationLargeMessageWriteMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargeMessageWriteMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long messageId;
-
- private byte body[];
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
- public ReplicationLargeMessageWriteMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE);
- }
-
- /**
- * @param messageId
- * @param body
- */
- public ReplicationLargeMessageWriteMessage(final long messageId, final byte[] body)
- {
- this();
-
- this.messageId = messageId;
- this.body = body;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- buffer.writeInt(body.length);
- buffer.writeBytes(body);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- int size = buffer.readInt();
- body = new byte[size];
- buffer.readBytes(body);
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- /**
- * @return the body
- */
- public byte[] getBody()
- {
- return body;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargemessageEndMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,78 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A ReplicationLargemessageEndMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargemessageEndMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- long messageId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationLargemessageEndMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_END);
- }
-
- public ReplicationLargemessageEndMessage(final long messageId)
- {
- this();
- this.messageId = messageId;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageEventMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageEventMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageEventMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- * A ReplicationPageWrite
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPageEventMessage extends PacketImpl
-{
-
- private int pageNumber;
-
- private SimpleString storeName;
-
- /**
- * True = delete page, False = close page
- */
- private boolean isDelete;
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPageEventMessage()
- {
- super(PacketImpl.REPLICATION_PAGE_EVENT);
- }
-
- public ReplicationPageEventMessage(final SimpleString storeName, final int pageNumber,
final boolean isDelete)
- {
- this();
- this.pageNumber = pageNumber;
- this.isDelete = isDelete;
- this.storeName = storeName;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(storeName);
- buffer.writeInt(pageNumber);
- buffer.writeBoolean(isDelete);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- storeName = buffer.readSimpleString();
- pageNumber = buffer.readInt();
- isDelete = buffer.readBoolean();
- }
-
- /**
- * @return the pageNumber
- */
- public int getPageNumber()
- {
- return pageNumber;
- }
-
- /**
- * @return the storeName
- */
- public SimpleString getStoreName()
- {
- return storeName;
- }
-
- /**
- * @return the isDelete
- */
- public boolean isDelete()
- {
- return isDelete;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageWriteMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageWriteMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPageWriteMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.paging.PagedMessage;
-import org.hornetq.core.paging.impl.PagedMessageImpl;
-
-/**
- * A ReplicationPageWrite
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPageWriteMessage extends PacketImpl
-{
-
- int pageNumber;
-
- PagedMessage pagedMessage;
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPageWriteMessage()
- {
- super(PacketImpl.REPLICATION_PAGE_WRITE);
- }
-
- public ReplicationPageWriteMessage(final PagedMessage pagedMessage, final int
pageNumber)
- {
- this();
- this.pageNumber = pageNumber;
- this.pagedMessage = pagedMessage;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(pageNumber);
- pagedMessage.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- pageNumber = buffer.readInt();
- pagedMessage = new PagedMessageImpl();
- pagedMessage.decode(buffer);
- }
-
- /**
- * @return the pageNumber
- */
- public int getPageNumber()
- {
- return pageNumber;
- }
-
- /**
- * @return the pagedMessage
- */
- public PagedMessage getPagedMessage()
- {
- return pagedMessage;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPrepareMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPrepareMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationPrepareMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPrepareMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPrepareMessage()
- {
- super(PacketImpl.REPLICATION_PREPARE);
- }
-
- public ReplicationPrepareMessage(final byte journalID, final long txId, final
EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.txId = txId;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(txId);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- txId = buffer.readLong();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/ReplicationResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,44 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class ReplicationResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationResponseMessage()
- {
- super(PacketImpl.REPLICATION_RESPONSE);
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/RollbackMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/RollbackMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/RollbackMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A RollbackMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Feb 18, 2009 2:11:17 PM
- *
- *
- */
-public class RollbackMessage extends PacketImpl
-{
-
- public RollbackMessage()
- {
- super(PacketImpl.SESS_ROLLBACK);
- }
-
- public RollbackMessage(final boolean considerLastMessageAsDelivered)
- {
- super(PacketImpl.SESS_ROLLBACK);
-
- this.considerLastMessageAsDelivered = considerLastMessageAsDelivered;
- }
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean considerLastMessageAsDelivered;
-
- /**
- * @return the considerLastMessageAsDelivered
- */
- public boolean isConsiderLastMessageAsDelivered()
- {
- return considerLastMessageAsDelivered;
- }
-
- /**
- * @param isLastMessageAsDelivered the considerLastMessageAsDelivered to set
- */
- public void setConsiderLastMessageAsDelivered(final boolean isLastMessageAsDelivered)
- {
- considerLastMessageAsDelivered = isLastMessageAsDelivered;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(considerLastMessageAsDelivered);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- considerLastMessageAsDelivered = buffer.readBoolean();
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionAcknowledgeMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionAcknowledgeMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionAcknowledgeMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,112 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionAcknowledgeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long messageID;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionAcknowledgeMessage(final long consumerID, final long messageID, final
boolean requiresResponse)
- {
- super(PacketImpl.SESS_ACKNOWLEDGE);
-
- this.consumerID = consumerID;
-
- this.messageID = messageID;
-
- this.requiresResponse = requiresResponse;
- }
-
- public SessionAcknowledgeMessage()
- {
- super(PacketImpl.SESS_ACKNOWLEDGE);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getMessageID()
- {
- return messageID;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
-
- buffer.writeLong(messageID);
-
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
-
- messageID = buffer.readLong();
-
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionAcknowledgeMessage == false)
- {
- return false;
- }
-
- SessionAcknowledgeMessage r = (SessionAcknowledgeMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
- messageID == r.messageID &&
- requiresResponse == r.requiresResponse;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,72 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- *
- * A SessionQueueQueryMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionBindingQueryMessage extends PacketImpl
-{
- private SimpleString address;
-
- public SessionBindingQueryMessage(final SimpleString address)
- {
- super(PacketImpl.SESS_BINDINGQUERY);
-
- this.address = address;
- }
-
- public SessionBindingQueryMessage()
- {
- super(PacketImpl.SESS_BINDINGQUERY);
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(address);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- address = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionBindingQueryMessage == false)
- {
- return false;
- }
-
- SessionBindingQueryMessage r = (SessionBindingQueryMessage)other;
-
- return super.equals(other) && address.equals(r.address);
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,123 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- *
- * A SessionBindingQueryResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionBindingQueryResponseMessage extends PacketImpl
-{
- private boolean exists;
-
- private List<SimpleString> queueNames;
-
- public SessionBindingQueryResponseMessage(final boolean exists, final
List<SimpleString> queueNames)
- {
- super(PacketImpl.SESS_BINDINGQUERY_RESP);
-
- this.exists = exists;
-
- this.queueNames = queueNames;
- }
-
- public SessionBindingQueryResponseMessage()
- {
- super(PacketImpl.SESS_BINDINGQUERY_RESP);
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isExists()
- {
- return exists;
- }
-
- public List<SimpleString> getQueueNames()
- {
- return queueNames;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(exists);
- buffer.writeInt(queueNames.size());
- for (SimpleString queueName : queueNames)
- {
- buffer.writeSimpleString(queueName);
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- exists = buffer.readBoolean();
- int numQueues = buffer.readInt();
- queueNames = new ArrayList<SimpleString>(numQueues);
- for (int i = 0; i < numQueues; i++)
- {
- queueNames.add(buffer.readSimpleString());
- }
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionBindingQueryResponseMessage == false)
- {
- return false;
- }
-
- SessionBindingQueryResponseMessage r = (SessionBindingQueryResponseMessage)other;
-
- if (super.equals(other) && exists == r.exists)
- {
- if (queueNames.size() == r.queueNames.size())
- {
- for (int i = 0; i < queueNames.size(); i++)
- {
- if (!queueNames.get(i).equals(r.queueNames.get(i)))
- {
- return false;
- }
- }
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
-
- return true;
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCloseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCloseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCloseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,61 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionCloseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionCloseMessage()
- {
- super(PacketImpl.SESS_CLOSE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionCloseMessage == false)
- {
- return false;
- }
-
- return super.equals(other);
- }
-
- @Override
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,57 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-/**
- * A SessionCommitMessage
- *
- * @author tim
- *
- *
- */
-public class SessionCommitMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- /**
- * @param type
- */
- public SessionCommitMessage()
- {
- super(PacketImpl.SESS_COMMIT);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerCloseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerCloseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerCloseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,91 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionConsumerCloseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionConsumerCloseMessage(final long objectID)
- {
- super(PacketImpl.SESS_CONSUMER_CLOSE);
-
- consumerID = objectID;
- }
-
- public SessionConsumerCloseMessage()
- {
- super(PacketImpl.SESS_CONSUMER_CLOSE);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", consumerID=" + consumerID + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionConsumerCloseMessage == false)
- {
- return false;
- }
-
- SessionConsumerCloseMessage r = (SessionConsumerCloseMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerFlowCreditMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,103 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionConsumerFlowCreditMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private int credits;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionConsumerFlowCreditMessage(final long consumerID, final int credits)
- {
- super(PacketImpl.SESS_FLOWTOKEN);
-
- this.consumerID = consumerID;
-
- this.credits = credits;
- }
-
- public SessionConsumerFlowCreditMessage()
- {
- super(PacketImpl.SESS_FLOWTOKEN);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getCredits()
- {
- return credits;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeInt(credits);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- credits = buffer.readInt();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", consumerID=" + consumerID + ",
credits=" + credits + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionConsumerFlowCreditMessage == false)
- {
- return false;
- }
-
- SessionConsumerFlowCreditMessage r = (SessionConsumerFlowCreditMessage)other;
-
- return super.equals(other) && credits == r.credits && consumerID ==
r.consumerID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionContinuationMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionContinuationMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionContinuationMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.utils.DataConstants;
-
-/**
- * A SessionContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 5, 2008 10:08:40 AM
- *
- *
- */
-public abstract class SessionContinuationMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- public static final int SESSION_CONTINUATION_BASE_SIZE =
PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT +
- DataConstants.SIZE_BOOLEAN;
-
- // Attributes ----------------------------------------------------
-
- protected byte[] body;
-
- protected boolean continues;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionContinuationMessage(final byte type, final byte[] body, final boolean
continues)
- {
- super(type);
- this.body = body;
- this.continues = continues;
- }
-
- public SessionContinuationMessage(final byte type)
- {
- super(type);
- }
-
- // Public --------------------------------------------------------
-
- /**
- * @return the body
- */
- public byte[] getBody()
- {
- return body;
- }
-
- /**
- * @return the continues
- */
- public boolean isContinues()
- {
- return continues;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(body.length);
- buffer.writeBytes(body);
- buffer.writeBoolean(continues);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int size = buffer.readInt();
- body = new byte[size];
- buffer.readBytes(body);
- continues = buffer.readBoolean();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCreateConsumerMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCreateConsumerMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCreateConsumerMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,142 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionCreateConsumerMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- private SimpleString queueName;
-
- private SimpleString filterString;
-
- private boolean browseOnly;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionCreateConsumerMessage(final long id,
- final SimpleString queueName,
- final SimpleString filterString,
- final boolean browseOnly,
- final boolean requiresResponse)
- {
- super(PacketImpl.SESS_CREATECONSUMER);
-
- this.id = id;
- this.queueName = queueName;
- this.filterString = filterString;
- this.browseOnly = browseOnly;
- this.requiresResponse = requiresResponse;
- }
-
- public SessionCreateConsumerMessage()
- {
- super(PacketImpl.SESS_CREATECONSUMER);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", queueName=" + queueName);
- buff.append(", filterString=" + filterString);
- buff.append("]");
- return buff.toString();
- }
-
- public long getID()
- {
- return id;
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public boolean isBrowseOnly()
- {
- return browseOnly;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(id);
- buffer.writeSimpleString(queueName);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeBoolean(browseOnly);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- id = buffer.readLong();
- queueName = buffer.readSimpleString();
- filterString = buffer.readNullableSimpleString();
- browseOnly = buffer.readBoolean();
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionCreateConsumerMessage == false)
- {
- return false;
- }
-
- SessionCreateConsumerMessage r = (SessionCreateConsumerMessage)other;
-
- return super.equals(other) && queueName.equals(r.queueName) &&
filterString == null ? r.filterString == null
-
: filterString.equals(r.filterString);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionDeleteQueueMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionDeleteQueueMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionDeleteQueueMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
-
- * @version <tt>$Revision$</tt>
- */
-public class SessionDeleteQueueMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private SimpleString queueName;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionDeleteQueueMessage(final SimpleString queueName)
- {
- super(PacketImpl.DELETE_QUEUE);
-
- this.queueName = queueName;
- }
-
- public SessionDeleteQueueMessage()
- {
- super(PacketImpl.DELETE_QUEUE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", queueName=" + queueName);
- buff.append("]");
- return buff.toString();
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(queueName);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- queueName = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionDeleteQueueMessage == false)
- {
- return false;
- }
-
- SessionDeleteQueueMessage r = (SessionDeleteQueueMessage)other;
-
- return super.equals(other) && r.queueName.equals(queueName);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionExpiredMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionExpiredMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionExpiredMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,97 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionExpiredMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long messageID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionExpiredMessage(final long consumerID, final long messageID)
- {
- super(PacketImpl.SESS_EXPIRED);
-
- this.consumerID = consumerID;
-
- this.messageID = messageID;
- }
-
- public SessionExpiredMessage()
- {
- super(PacketImpl.SESS_EXPIRED);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getMessageID()
- {
- return messageID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
-
- buffer.writeLong(messageID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
-
- messageID = buffer.readLong();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionExpiredMessage == false)
- {
- return false;
- }
-
- SessionExpiredMessage r = (SessionExpiredMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
messageID == r.messageID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionForceConsumerDelivery.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionForceConsumerDelivery.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionForceConsumerDelivery.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,108 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- *
- * A SessionConsumerForceDelivery
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- */
-public class SessionForceConsumerDelivery extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long sequence;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionForceConsumerDelivery(final long consumerID, final long sequence)
- {
- super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
-
- this.consumerID = consumerID;
- this.sequence = sequence;
- }
-
- public SessionForceConsumerDelivery()
- {
- super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getSequence()
- {
- return sequence;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeLong(sequence);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- sequence = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getParentString());
- buf.append(", consumerID=" + consumerID);
- buf.append(", sequence=" + sequence);
- buf.append("]");
- return buf.toString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionForceConsumerDelivery == false)
- {
- return false;
- }
-
- SessionForceConsumerDelivery r = (SessionForceConsumerDelivery)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
sequence == r.sequence;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionProducerCreditsMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionProducerCreditsMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionProducerCreditsMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionProducerCreditsMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int credits;
-
- private SimpleString address;
-
- private int offset;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionProducerCreditsMessage(final int credits, final SimpleString address,
final int offset)
- {
- super(PacketImpl.SESS_PRODUCER_CREDITS);
-
- this.credits = credits;
-
- this.address = address;
-
- this.offset = offset;
- }
-
- public SessionProducerCreditsMessage()
- {
- super(PacketImpl.SESS_PRODUCER_CREDITS);
- }
-
- // Public --------------------------------------------------------
-
- public int getCredits()
- {
- return credits;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(credits);
- buffer.writeSimpleString(address);
- buffer.writeInt(offset);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- credits = buffer.readInt();
- address = buffer.readSimpleString();
- offset = buffer.readInt();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,72 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- *
- * A SessionQueueQueryMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionQueueQueryMessage extends PacketImpl
-{
- private SimpleString queueName;
-
- public SessionQueueQueryMessage(final SimpleString queueName)
- {
- super(PacketImpl.SESS_QUEUEQUERY);
-
- this.queueName = queueName;
- }
-
- public SessionQueueQueryMessage()
- {
- super(PacketImpl.SESS_QUEUEQUERY);
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(queueName);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- queueName = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionQueueQueryMessage == false)
- {
- return false;
- }
-
- SessionQueueQueryMessage r = (SessionQueueQueryMessage)other;
-
- return super.equals(other) && r.queueName.equals(queueName);
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,179 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- *
- * A SessionQueueQueryResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionQueueQueryResponseMessage extends PacketImpl
-{
- private SimpleString name;
-
- private boolean exists;
-
- private boolean durable;
-
- private int consumerCount;
-
- private int messageCount;
-
- private SimpleString filterString;
-
- private SimpleString address;
-
- private boolean temporary;
-
- public SessionQueueQueryResponseMessage(final SimpleString name,
- final SimpleString address,
- final boolean durable,
- final boolean temporary,
- final SimpleString filterString,
- final int consumerCount,
- final int messageCount)
- {
- this(name, address, durable, temporary, filterString, consumerCount, messageCount,
true);
- }
-
- public SessionQueueQueryResponseMessage()
- {
- this(null, null, false, false, null, 0, 0, false);
- }
-
- private SessionQueueQueryResponseMessage(final SimpleString name,
- final SimpleString address,
- final boolean durable,
- final boolean temporary,
- final SimpleString filterString,
- final int consumerCount,
- final int messageCount,
- final boolean exists)
- {
- super(PacketImpl.SESS_QUEUEQUERY_RESP);
-
- this.durable = durable;
-
- this.temporary = temporary;
-
- this.consumerCount = consumerCount;
-
- this.messageCount = messageCount;
-
- this.filterString = filterString;
-
- this.address = address;
-
- this.name = name;
-
- this.exists = exists;
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isExists()
- {
- return exists;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public int getConsumerCount()
- {
- return consumerCount;
- }
-
- public int getMessageCount()
- {
- return messageCount;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public SimpleString getName()
- {
- return name;
- }
-
- public boolean isTemporary()
- {
- return temporary;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(exists);
- buffer.writeBoolean(durable);
- buffer.writeBoolean(temporary);
- buffer.writeInt(consumerCount);
- buffer.writeInt(messageCount);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeNullableSimpleString(address);
- buffer.writeNullableSimpleString(name);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- exists = buffer.readBoolean();
- durable = buffer.readBoolean();
- temporary = buffer.readBoolean();
- consumerCount = buffer.readInt();
- messageCount = buffer.readInt();
- filterString = buffer.readNullableSimpleString();
- address = buffer.readNullableSimpleString();
- name = buffer.readNullableSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionQueueQueryResponseMessage == false)
- {
- return false;
- }
-
- SessionQueueQueryResponseMessage r = (SessionQueueQueryResponseMessage)other;
-
- return super.equals(other) && exists == r.exists &&
- durable == r.durable &&
- consumerCount == r.consumerCount &&
- messageCount == r.messageCount &&
- filterString == null ? r.filterString == null
- : filterString.equals(r.filterString) && address
== null ? r.address == null
-
: address.equals(r.address);
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveContinuationMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.utils.DataConstants;
-
-/**
- * A SessionSendContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 4, 2008 12:25:14 PM
- *
- *
- */
-public class SessionReceiveContinuationMessage extends SessionContinuationMessage
-{
-
- // Constants -----------------------------------------------------
-
- public static final int SESSION_RECEIVE_CONTINUATION_BASE_SIZE =
SessionContinuationMessage.SESSION_CONTINUATION_BASE_SIZE + DataConstants.SIZE_LONG;
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionReceiveContinuationMessage()
- {
- super(PacketImpl.SESS_RECEIVE_CONTINUATION);
- }
-
- /**
- * @param consumerID
- * @param body
- * @param continues
- * @param requiresResponse
- */
- public SessionReceiveContinuationMessage(final long consumerID,
- final byte[] body,
- final boolean continues,
- final boolean requiresResponse)
- {
- super(PacketImpl.SESS_RECEIVE_CONTINUATION, body, continues);
- this.consumerID = consumerID;
- }
-
- /**
- * @return the consumerID
- */
- public long getConsumerID()
- {
- return consumerID;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- super.encodeRest(buffer);
- buffer.writeLong(consumerID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- super.decodeRest(buffer);
- consumerID = buffer.readLong();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveLargeMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveLargeMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveLargeMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A SessionReceiveLargeMessage
- *
- * @author Clebert Suconic
- *
- *
- */
-public class SessionReceiveLargeMessage extends PacketImpl
-{
- private byte[] largeMessageHeader;
-
- /** Since we receive the message before the entire message was received, */
- private long largeMessageSize;
-
- private long consumerID;
-
- private int deliveryCount;
-
- public SessionReceiveLargeMessage()
- {
- super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
- }
-
- public SessionReceiveLargeMessage(final long consumerID,
- final byte[] largeMessageHeader,
- final long largeMessageSize,
- final int deliveryCount)
- {
- super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
-
- this.consumerID = consumerID;
-
- this.largeMessageHeader = largeMessageHeader;
-
- this.deliveryCount = deliveryCount;
-
- this.largeMessageSize = largeMessageSize;
- }
-
- public byte[] getLargeMessageHeader()
- {
- return largeMessageHeader;
- }
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getDeliveryCount()
- {
- return deliveryCount;
- }
-
- /**
- * @return the largeMessageSize
- */
- public long getLargeMessageSize()
- {
- return largeMessageSize;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeInt(deliveryCount);
- buffer.writeLong(largeMessageSize);
- buffer.writeInt(largeMessageHeader.length);
- buffer.writeBytes(largeMessageHeader);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- deliveryCount = buffer.readInt();
- largeMessageSize = buffer.readLong();
- int size = buffer.readInt();
- largeMessageHeader = new byte[size];
- buffer.readBytes(largeMessageHeader);
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionReceiveMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,119 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.client.impl.ClientMessageImpl;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionReceiveMessage extends MessagePacket
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(SessionReceiveMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private int deliveryCount;
-
- public SessionReceiveMessage(final long consumerID, final MessageInternal message,
final int deliveryCount)
- {
- super(PacketImpl.SESS_RECEIVE_MSG, message);
-
- this.consumerID = consumerID;
-
- this.deliveryCount = deliveryCount;
- }
-
- public SessionReceiveMessage()
- {
- super(PacketImpl.SESS_RECEIVE_MSG, new ClientMessageImpl());
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getDeliveryCount()
- {
- return deliveryCount;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- @Override
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = message.getEncodedBuffer();
-
- // Sanity check
- if (buffer.writerIndex() != message.getEndOfMessagePosition())
- {
- throw new IllegalStateException("Wrong encode position");
- }
-
- buffer.writeLong(consumerID);
- buffer.writeInt(deliveryCount);
-
- size = buffer.writerIndex();
-
- // Write standard headers
-
- int len = size - DataConstants.SIZE_INT;
- buffer.setInt(0, len);
- buffer.setByte(DataConstants.SIZE_INT, type);
- buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
-
- // Position reader for reading by Netty
- buffer.setIndex(0, size);
-
- return buffer;
- }
-
- @Override
- public void decode(final HornetQBuffer buffer)
- {
- channelID = buffer.readLong();
-
- message.decodeFromBuffer(buffer);
-
- consumerID = buffer.readLong();
-
- deliveryCount = buffer.readInt();
-
- size = buffer.readerIndex();
-
- // Need to position buffer for reading
-
- buffer.setIndex(PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT,
message.getEndOfBodyPosition());
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionRequestProducerCreditsMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionRequestProducerCreditsMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int credits;
-
- private SimpleString address;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionRequestProducerCreditsMessage(final int credits, final SimpleString
address)
- {
- super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
-
- this.credits = credits;
-
- this.address = address;
- }
-
- public SessionRequestProducerCreditsMessage()
- {
- super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
- }
-
- // Public --------------------------------------------------------
-
- public int getCredits()
- {
- return credits;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- // public boolean isRequiresConfirmations()
- // {
- // return false;
- // }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(credits);
- buffer.writeSimpleString(address);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- credits = buffer.readInt();
- address = buffer.readSimpleString();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendContinuationMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendContinuationMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendContinuationMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * A SessionSendContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 4, 2008 12:25:14 PM
- *
- *
- */
-public class SessionSendContinuationMessage extends SessionContinuationMessage
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendContinuationMessage()
- {
- super(PacketImpl.SESS_SEND_CONTINUATION);
- }
-
- /**
- * @param body
- * @param continues
- * @param requiresResponse
- */
- public SessionSendContinuationMessage(final byte[] body, final boolean continues,
final boolean requiresResponse)
- {
- super(PacketImpl.SESS_SEND_CONTINUATION, body, continues);
- this.requiresResponse = requiresResponse;
- }
-
- // Public --------------------------------------------------------
-
- /**
- * @return the requiresResponse
- */
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- super.encodeRest(buffer);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- super.decodeRest(buffer);
- requiresResponse = buffer.readBoolean();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendLargeMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendLargeMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendLargeMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,81 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:csuconic@redhat.com">Clebert
Suconic</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionSendLargeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- /** Used only if largeMessage */
- private byte[] largeMessageHeader;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendLargeMessage(final byte[] largeMessageHeader)
- {
- super(PacketImpl.SESS_SEND_LARGE);
-
- this.largeMessageHeader = largeMessageHeader;
- }
-
- public SessionSendLargeMessage()
- {
- super(PacketImpl.SESS_SEND_LARGE);
- }
-
- // Public --------------------------------------------------------
-
- public byte[] getLargeMessageHeader()
- {
- return largeMessageHeader;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(largeMessageHeader.length);
- buffer.writeBytes(largeMessageHeader);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int largeMessageLength = buffer.readInt();
-
- largeMessageHeader = new byte[largeMessageLength];
-
- buffer.readBytes(largeMessageHeader);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionSendMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,114 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.Message;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.server.impl.ServerMessageImpl;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionSendMessage extends MessagePacket
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(SessionSendMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendMessage(final MessageInternal message, final boolean
requiresResponse)
- {
- super(PacketImpl.SESS_SEND, message);
-
- this.requiresResponse = requiresResponse;
- }
-
- public SessionSendMessage()
- {
- super(PacketImpl.SESS_SEND, new ServerMessageImpl());
- }
-
- // Public --------------------------------------------------------
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- @Override
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = message.getEncodedBuffer();
-
- // Sanity check
- if (buffer.writerIndex() != message.getEndOfMessagePosition())
- {
- throw new IllegalStateException("Wrong encode position");
- }
-
- buffer.writeBoolean(requiresResponse);
-
- size = buffer.writerIndex();
-
- // Write standard headers
-
- int len = size - DataConstants.SIZE_INT;
- buffer.setInt(0, len);
- buffer.setByte(DataConstants.SIZE_INT, type);
- buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
-
- // Position reader for reading by Netty
- buffer.readerIndex(0);
-
- message.resetCopied();
-
- return buffer;
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- // Buffer comes in after having read standard headers and positioned at Beginning
of body part
-
- message.decodeFromBuffer(buffer);
-
- int ri = buffer.readerIndex();
-
- requiresResponse = buffer.readBoolean();
-
- buffer.readerIndex(ri);
-
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXACommitMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXACommitMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXACommitMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,110 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXACommitMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean onePhase;
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXACommitMessage(final Xid xid, final boolean onePhase)
- {
- super(PacketImpl.SESS_XA_COMMIT);
-
- this.xid = xid;
- this.onePhase = onePhase;
- }
-
- public SessionXACommitMessage()
- {
- super(PacketImpl.SESS_XA_COMMIT);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- public boolean isOnePhase()
- {
- return onePhase;
- }
-
- @Override
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- buffer.writeBoolean(onePhase);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- onePhase = buffer.readBoolean();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", xid=" + xid + ", onePhase=" +
onePhase + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXACommitMessage == false)
- {
- return false;
- }
-
- SessionXACommitMessage r = (SessionXACommitMessage)other;
-
- return super.equals(other) && xid.equals(r.xid) && onePhase ==
r.onePhase;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAEndMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAEndMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAEndMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,105 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAEndMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- private boolean failed;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAEndMessage(final Xid xid, final boolean failed)
- {
- super(PacketImpl.SESS_XA_END);
-
- this.xid = xid;
-
- this.failed = failed;
- }
-
- public SessionXAEndMessage()
- {
- super(PacketImpl.SESS_XA_END);
- }
-
- // Public --------------------------------------------------------
-
- public boolean isFailed()
- {
- return failed;
- }
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- buffer.writeBoolean(failed);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- failed = buffer.readBoolean();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", xid=" + xid + ", failed=" +
failed + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAEndMessage == false)
- {
- return false;
- }
-
- SessionXAEndMessage r = (SessionXAEndMessage)other;
-
- return super.equals(other) && xid.equals(r.xid) && failed ==
r.failed;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAForgetMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAForgetMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAForgetMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAForgetMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAForgetMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_FORGET);
-
- this.xid = xid;
- }
-
- public SessionXAForgetMessage()
- {
- super(PacketImpl.SESS_XA_FORGET);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAForgetMessage == false)
- {
- return false;
- }
-
- SessionXAForgetMessage r = (SessionXAForgetMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,126 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAGetInDoubtXidsResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private List<Xid> xids;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAGetInDoubtXidsResponseMessage(final List<Xid> xids)
- {
- super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
-
- this.xids = xids;
- }
-
- public SessionXAGetInDoubtXidsResponseMessage()
- {
- super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public List<Xid> getXids()
- {
- return xids;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(xids.size());
-
- for (Xid xid : xids)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int len = buffer.readInt();
- xids = new ArrayList<Xid>(len);
- for (int i = 0; i < len; i++)
- {
- Xid xid = XidCodecSupport.decodeXid(buffer);
-
- xids.add(xid);
- }
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAGetInDoubtXidsResponseMessage == false)
- {
- return false;
- }
-
- SessionXAGetInDoubtXidsResponseMessage r =
(SessionXAGetInDoubtXidsResponseMessage)other;
-
- if (super.equals(other))
- {
- if (xids.size() == r.xids.size())
- {
- for (int i = 0; i < xids.size(); i++)
- {
- if (!xids.get(i).equals(r.xids.get(i)))
- {
- return false;
- }
- }
- }
- }
- else
- {
- return false;
- }
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,92 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAGetTimeoutResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int timeoutSeconds;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAGetTimeoutResponseMessage(final int timeoutSeconds)
- {
- super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
-
- this.timeoutSeconds = timeoutSeconds;
- }
-
- public SessionXAGetTimeoutResponseMessage()
- {
- super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public int getTimeoutSeconds()
- {
- return timeoutSeconds;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(timeoutSeconds);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- timeoutSeconds = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAGetTimeoutResponseMessage == false)
- {
- return false;
- }
-
- SessionXAGetTimeoutResponseMessage r = (SessionXAGetTimeoutResponseMessage)other;
-
- return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAJoinMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAJoinMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAJoinMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAJoinMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAJoinMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_JOIN);
-
- this.xid = xid;
- }
-
- public SessionXAJoinMessage()
- {
- super(PacketImpl.SESS_XA_JOIN);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAJoinMessage == false)
- {
- return false;
- }
-
- SessionXAJoinMessage r = (SessionXAJoinMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAPrepareMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAPrepareMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAPrepareMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAPrepareMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAPrepareMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_PREPARE);
-
- this.xid = xid;
- }
-
- public SessionXAPrepareMessage()
- {
- super(PacketImpl.SESS_XA_PREPARE);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAPrepareMessage == false)
- {
- return false;
- }
-
- SessionXAPrepareMessage r = (SessionXAPrepareMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,114 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean error;
-
- private int responseCode;
-
- private String message;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAResponseMessage(final boolean isError, final int responseCode, final
String message)
- {
- super(PacketImpl.SESS_XA_RESP);
-
- error = isError;
-
- this.responseCode = responseCode;
-
- this.message = message;
- }
-
- public SessionXAResponseMessage()
- {
- super(PacketImpl.SESS_XA_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isError()
- {
- return error;
- }
-
- public int getResponseCode()
- {
- return responseCode;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(error);
- buffer.writeInt(responseCode);
- buffer.writeNullableString(message);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- error = buffer.readBoolean();
- responseCode = buffer.readInt();
- message = buffer.readNullableString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAResponseMessage == false)
- {
- return false;
- }
-
- SessionXAResponseMessage r = (SessionXAResponseMessage)other;
-
- return super.equals(other) && error == r.error && responseCode ==
r.responseCode && message.equals(r.message);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResumeMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResumeMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAResumeMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAResumeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAResumeMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_RESUME);
-
- this.xid = xid;
- }
-
- public SessionXAResumeMessage()
- {
- super(PacketImpl.SESS_XA_RESUME);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAResumeMessage == false)
- {
- return false;
- }
-
- SessionXAResumeMessage r = (SessionXAResumeMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXARollbackMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXARollbackMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXARollbackMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,94 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXARollbackMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXARollbackMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_ROLLBACK);
-
- this.xid = xid;
- }
-
- public SessionXARollbackMessage()
- {
- super(PacketImpl.SESS_XA_ROLLBACK);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXARollbackMessage == false)
- {
- return false;
- }
-
- SessionXARollbackMessage r = (SessionXARollbackMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXASetTimeoutMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int timeoutSeconds;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXASetTimeoutMessage(final int timeoutSeconds)
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT);
-
- this.timeoutSeconds = timeoutSeconds;
- }
-
- public SessionXASetTimeoutMessage()
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT);
- }
-
- // Public --------------------------------------------------------
-
- public int getTimeoutSeconds()
- {
- return timeoutSeconds;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(timeoutSeconds);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- timeoutSeconds = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXASetTimeoutMessage == false)
- {
- return false;
- }
-
- SessionXASetTimeoutMessage r = (SessionXASetTimeoutMessage)other;
-
- return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutResponseMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,92 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXASetTimeoutResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean ok;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXASetTimeoutResponseMessage(final boolean ok)
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
-
- this.ok = ok;
- }
-
- public SessionXASetTimeoutResponseMessage()
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isOK()
- {
- return ok;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(ok);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- ok = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXASetTimeoutResponseMessage == false)
- {
- return false;
- }
-
- SessionXASetTimeoutResponseMessage r = (SessionXASetTimeoutResponseMessage)other;
-
- return super.equals(other) && ok == r.ok;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAStartMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAStartMessage.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/SessionXAStartMessage.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAStartMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAStartMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_START);
-
- this.xid = xid;
- }
-
- public SessionXAStartMessage()
- {
- super(PacketImpl.SESS_XA_START);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAStartMessage == false)
- {
- return false;
- }
-
- SessionXAStartMessage r = (SessionXAStartMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/XidCodecSupport.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/XidCodecSupport.java 2010-01-21
14:37:33 UTC (rev 8823)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/wireformat/XidCodecSupport.java 2010-01-21
14:39:29 UTC (rev 8824)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class XidCodecSupport
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- public static void encodeXid(final Xid xid, final HornetQBuffer out)
- {
- out.writeInt(xid.getFormatId());
- out.writeInt(xid.getBranchQualifier().length);
- out.writeBytes(xid.getBranchQualifier());
- out.writeInt(xid.getGlobalTransactionId().length);
- out.writeBytes(xid.getGlobalTransactionId());
- }
-
- public static Xid decodeXid(final HornetQBuffer in)
- {
- int formatID = in.readInt();
- byte[] bq = new byte[in.readInt()];
- in.readBytes(bq);
- byte[] gtxid = new byte[in.readInt()];
- in.readBytes(gtxid);
- Xid xid = new XidImpl(bq, formatID, gtxid);
- return xid;
- }
-
- public static int getXidEncodeLength(final Xid xid)
- {
- return DataConstants.SIZE_INT * 3 + xid.getBranchQualifier().length +
xid.getGlobalTransactionId().length;
- }
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}