summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2014-09-30 18:47:26 +0000
committerRobert Godfrey <rgodfrey@apache.org>2014-09-30 18:47:26 +0000
commit49947bf1e2369fc1a989139f30885599c348466a (patch)
treeb7a3ccc17a4cf61bea873c95c7af6aa1ca3fd3cf
parent907a77ca345ae585038d502a059f9e0a42d1d50c (diff)
downloadqpid-python-49947bf1e2369fc1a989139f30885599c348466a.tar.gz
Remove (essentially) unusued state class, tidy up package structure
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-6125-ProtocolRefactoring@1628514 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java1
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java28
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java4
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java1
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverter.java (renamed from java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java)2
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java (renamed from java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java)3
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ServerMethodDispatcherImpl.java (renamed from java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java)23
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/UnexpectedMethodException.java (renamed from java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/UnexpectedMethodException.java)2
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/AMQState.java36
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/StateListener.java30
-rw-r--r--java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java1
-rw-r--r--java/common/src/main/java/org/apache/qpid/framing/MessagePublishInfo.java2
12 files changed, 5 insertions, 128 deletions
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index 6b36e846c0..79f73b5ca9 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -90,7 +90,6 @@ import org.apache.qpid.server.model.State;
import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.protocol.CapacityChecker;
import org.apache.qpid.server.protocol.ConsumerListener;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.security.SecurityManager;
import org.apache.qpid.server.store.MessageStore;
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
index 188c8b6879..ea2ee7bb2d 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
@@ -72,10 +72,6 @@ import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.Transport;
import org.apache.qpid.server.protocol.AMQSessionModel;
import org.apache.qpid.server.protocol.SessionModelListener;
-import org.apache.qpid.server.protocol.v0_8.handler.ServerMethodDispatcherImpl;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl;
-import org.apache.qpid.server.protocol.v0_8.state.AMQState;
import org.apache.qpid.server.security.SubjectCreator;
import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
import org.apache.qpid.server.stats.StatisticsCounter;
@@ -125,9 +121,6 @@ public class AMQProtocolEngine implements ServerProtocolEngine, AMQProtocolSessi
private final Set<AMQChannel<AMQProtocolEngine>> _channelsForCurrentMessage =
new HashSet<AMQChannel<AMQProtocolEngine>>();
- /** The current state */
- private AMQState _currentState;
-
private AMQDecoder _decoder;
private SaslServer _saslServer;
@@ -1110,7 +1103,6 @@ public class AMQProtocolEngine implements ServerProtocolEngine, AMQProtocolSessi
{
try
{
- changeState(AMQState.CONNECTION_CLOSING);
writeFrame(e.getCloseFrame());
}
finally
@@ -1126,19 +1118,6 @@ public class AMQProtocolEngine implements ServerProtocolEngine, AMQProtocolSessi
public void closeProtocolSession()
{
_network.close();
-
- try
- {
- changeState(AMQState.CONNECTION_CLOSED);
- }
- catch (ConnectionScopedRuntimeException e)
- {
- _logger.info(e.getMessage());
- }
- catch (TransportException e)
- {
- _logger.info(e.getMessage());
- }
}
public String toString()
@@ -1732,13 +1711,6 @@ public class AMQProtocolEngine implements ServerProtocolEngine, AMQProtocolSessi
}
@Override
- public void changeState(AMQState newState)
- {
- _logger.debug("State changing to " + newState + " from old state " + _currentState);
- _currentState = newState;
- }
-
- @Override
public Broker<?> getBroker()
{
return _broker;
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java
index 709ea409bf..15ed24b78f 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java
@@ -37,8 +37,6 @@ import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.protocol.AMQConnectionModel;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
-import org.apache.qpid.server.protocol.v0_8.state.AMQState;
import org.apache.qpid.server.security.AuthorizationHolder;
import org.apache.qpid.server.security.SubjectCreator;
import org.apache.qpid.server.virtualhost.VirtualHostImpl;
@@ -218,8 +216,6 @@ public interface AMQProtocolSession<T extends AMQProtocolSession<T>>
int getMessageCompressionThreshold();
- void changeState(AMQState state);
-
Broker<?> getBroker();
SubjectCreator getSubjectCreator();
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java
index acb74c99e6..446ba256ab 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java
@@ -39,7 +39,6 @@ import org.apache.qpid.server.message.MessageInstance;
import org.apache.qpid.server.message.MessageReference;
import org.apache.qpid.server.message.ServerMessage;
import org.apache.qpid.server.protocol.AMQSessionModel;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
import org.apache.qpid.server.queue.QueueEntry;
import org.apache.qpid.server.txn.AutoCommitTransaction;
import org.apache.qpid.server.txn.ServerTransaction;
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverter.java
index 4225e12930..69f71f14a9 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverter.java
@@ -24,7 +24,7 @@
* Supported AMQP versions:
* 8-0
*/
-package org.apache.qpid.server.protocol.v0_8.output;
+package org.apache.qpid.server.protocol.v0_8;
import org.apache.qpid.framing.AMQDataBlock;
import org.apache.qpid.framing.AMQShortString;
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
index dc034f7bd2..0cfbabe042 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.protocol.v0_8.output;
+package org.apache.qpid.server.protocol.v0_8;
import java.io.DataOutput;
import java.io.IOException;
@@ -44,6 +44,7 @@ import org.apache.qpid.server.plugin.MessageConverter;
import org.apache.qpid.server.protocol.MessageConverterRegistry;
import org.apache.qpid.server.protocol.v0_8.AMQMessage;
import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
+import org.apache.qpid.server.protocol.v0_8.ProtocolOutputConverter;
import org.apache.qpid.util.GZIPUtils;
public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ServerMethodDispatcherImpl.java
index ada1b43ad2..d8300709f2 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ServerMethodDispatcherImpl.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ServerMethodDispatcherImpl.java
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.protocol.v0_8.handler;
+package org.apache.qpid.server.protocol.v0_8;
import java.security.AccessControlException;
import java.util.Collection;
@@ -57,13 +57,6 @@ import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.UnknownConfiguredObjectException;
import org.apache.qpid.server.model.port.AmqpPort;
import org.apache.qpid.server.protocol.AMQSessionModel;
-import org.apache.qpid.server.protocol.v0_8.AMQChannel;
-import org.apache.qpid.server.protocol.v0_8.AMQMessage;
-import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
-import org.apache.qpid.server.protocol.v0_8.ClientDeliveryMethod;
-import org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8;
-import org.apache.qpid.server.protocol.v0_8.RecordDeliveryMethod;
-import org.apache.qpid.server.protocol.v0_8.state.AMQState;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.QueueArgumentsConverter;
import org.apache.qpid.server.security.SubjectCreator;
@@ -884,8 +877,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
MethodRegistry methodRegistry = _connection.getMethodRegistry();
AMQMethodBody responseBody = methodRegistry.createConnectionOpenOkBody(body.getVirtualHost());
- _connection.changeState(AMQState.CONNECTION_OPEN);
-
_connection.writeFrame(responseBody.generateFrame(channelId));
}
return true;
@@ -924,7 +915,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
try
{
- _connection.changeState(AMQState.CONNECTION_CLOSED);
_connection.closeSession();
}
catch (Exception e)
@@ -1031,9 +1021,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
_logger.info("Authentication failed:" + (cause == null ? "" : cause.getMessage()));
- // This should be abstracted
- _connection.changeState(AMQState.CONNECTION_CLOSING);
-
ConnectionCloseBody connectionCloseBody =
methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(),
AMQConstant.NOT_ALLOWED.getName(),
@@ -1048,7 +1035,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
{
_logger.info("Connected as: " + authResult.getSubject());
}
- _connection.changeState(AMQState.CONNECTION_NOT_TUNED);
int frameMax = broker.getContextValue(Integer.class, Broker.BROKER_FRAME_SIZE);
@@ -1066,7 +1052,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
disposeSaslServer(_connection);
break;
case CONTINUE:
- _connection.changeState(AMQState.CONNECTION_NOT_AUTH);
ConnectionSecureBody
secureBody = methodRegistry.createConnectionSecureBody(authResult.getChallenge());
@@ -1129,8 +1114,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
_logger.info("Authentication failed:" + (cause == null ? "" : cause.getMessage()));
- _connection.changeState(AMQState.CONNECTION_CLOSING);
-
ConnectionCloseBody closeBody =
methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(), // replyCode
AMQConstant.NOT_ALLOWED.getName(),
@@ -1148,7 +1131,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
}
_connection.setAuthorizedSubject(authResult.getSubject());
- _connection.changeState(AMQState.CONNECTION_NOT_TUNED);
int frameMax = broker.getContextValue(Integer.class, Broker.BROKER_FRAME_SIZE);
if(frameMax <= 0)
@@ -1163,8 +1145,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
_connection.writeFrame(tuneBody.generateFrame(0));
break;
case CONTINUE:
- _connection.changeState(AMQState.CONNECTION_NOT_AUTH);
-
ConnectionSecureBody
secureBody = methodRegistry.createConnectionSecureBody(authResult.getChallenge());
_connection.writeFrame(secureBody.generateFrame(0));
@@ -1186,7 +1166,6 @@ public class ServerMethodDispatcherImpl implements MethodDispatcher
{
_logger.debug(body);
}
- connection.changeState(AMQState.CONNECTION_NOT_OPENED);
connection.initHeartbeats(body.getHeartbeat());
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/UnexpectedMethodException.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/UnexpectedMethodException.java
index cb14254494..432a725c86 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/UnexpectedMethodException.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/UnexpectedMethodException.java
@@ -18,7 +18,7 @@
* under the License.
*
*/
-package org.apache.qpid.server.protocol.v0_8.handler;
+package org.apache.qpid.server.protocol.v0_8;
import org.apache.qpid.AMQException;
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/AMQState.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/AMQState.java
deleted file mode 100644
index ee97d5fa87..0000000000
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/AMQState.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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.apache.qpid.server.protocol.v0_8.state;
-
-/**
- * States used in the AMQ protocol. Used by the finite state machine to determine
- * valid responses.
- */
-public enum AMQState
-{
- CONNECTION_NOT_STARTED,
- CONNECTION_NOT_AUTH,
- CONNECTION_NOT_TUNED,
- CONNECTION_NOT_OPENED,
- CONNECTION_OPEN,
- CONNECTION_CLOSING,
- CONNECTION_CLOSED
-}
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/StateListener.java b/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/StateListener.java
deleted file mode 100644
index e065ae0d42..0000000000
--- a/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/state/StateListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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.apache.qpid.server.protocol.v0_8.state;
-
-import org.apache.qpid.AMQException;
-
-public interface StateListener
-{
- void stateChanged(AMQState oldState, AMQState newState) throws AMQException;
-
- void error(Throwable t);
-}
diff --git a/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java b/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
index d88e466443..163ae368c7 100644
--- a/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
+++ b/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
@@ -46,7 +46,6 @@ import org.apache.qpid.server.message.InstanceProperties;
import org.apache.qpid.server.message.MessageContentSource;
import org.apache.qpid.server.message.ServerMessage;
import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverter;
import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
import org.apache.qpid.server.security.auth.UsernamePrincipal;
import org.apache.qpid.server.virtualhost.VirtualHostImpl;
diff --git a/java/common/src/main/java/org/apache/qpid/framing/MessagePublishInfo.java b/java/common/src/main/java/org/apache/qpid/framing/MessagePublishInfo.java
index 1381fadbdc..cc8f7eab58 100644
--- a/java/common/src/main/java/org/apache/qpid/framing/MessagePublishInfo.java
+++ b/java/common/src/main/java/org/apache/qpid/framing/MessagePublishInfo.java
@@ -20,8 +20,6 @@
*/
package org.apache.qpid.framing;
-import org.apache.qpid.framing.AMQShortString;
-
public final class MessagePublishInfo
{
private AMQShortString _exchange;