summaryrefslogtreecommitdiff
path: root/java/common/src/main
diff options
context:
space:
mode:
authorAndrew Donald Kennedy <grkvlt@apache.org>2010-07-26 14:09:55 +0000
committerAndrew Donald Kennedy <grkvlt@apache.org>2010-07-26 14:09:55 +0000
commitc36251461bb48a12e540abc554f5b2e0495f4ead (patch)
tree5dea4a9482ae7aba2801d2ebc492930678c10148 /java/common/src/main
parent83caed5a5afc944415b125daf52015dad07ae7b2 (diff)
downloadqpid-python-c36251461bb48a12e540abc554f5b2e0495f4ead.tar.gz
QPID-2675: Remove obsolete QpidException
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@979294 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src/main')
-rw-r--r--java/common/src/main/java/org/apache/qpid/ErrorCode.java123
-rw-r--r--java/common/src/main/java/org/apache/qpid/QpidException.java58
-rw-r--r--java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java15
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java2
4 files changed, 7 insertions, 191 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/ErrorCode.java b/java/common/src/main/java/org/apache/qpid/ErrorCode.java
deleted file mode 100644
index 0549869e71..0000000000
--- a/java/common/src/main/java/org/apache/qpid/ErrorCode.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.qpid;
-/*
- *
- * 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.
- *
- */
-
-
-public enum ErrorCode
-{
- //Qpid specific - for the time being
- UNDEFINED(1,"undefined",true),
- MESSAGE_REJECTED(2,"message_rejected",true),
- CONNECTION_ERROR(3,"connection was closed",true),
- UNSUPPORTED_PROTOCOL(4, "protocol version is unsupported", true),
-
- //This might change in the spec, the error class is not applicable
- NO_ERROR(200,"reply-success",true),
-
- //From the spec
- CONTENT_TOO_LARGE(311,"content-too-large",false),
- NO_ROUTE(312,"no-route",false),
- NO_CONSUMERS(313,"content-consumers",false),
- CONNECTION_FORCED(320,"connection-forced",true),
- INVALID_PATH(402,"invalid-path",true),
- ACCESS_REFUSED(403,"access-refused",false),
- NOT_FOUND(404,"not-found",false),
- RESOURCE_LOCKED(405,"resource-locked",false),
- PRE_CONDITION_FAILED(406,"precondition-failed",false),
-
- FRAME_ERROR(501,"frame_error",true),
- SYNTAX_ERROR(502,"syntax_error",true),
- COMMAND_INVALID(503,"command_invalid",true),
- SESSION_ERROR(504,"sesion_error",true),
- NOT_ALLOWED(530,"not_allowed",true),
- NOT_IMPLEMENTED(540,"not_implemented",true),
- INTERNAL_ERROR(541,"internal_error",true),
- INVALID_ARGUMENT(542,"invalid_argument",true);
-
- private int _code;
- private String _desc;
- private boolean _hardError;
-
- private ErrorCode(int code,String desc,boolean hardError)
- {
- _code = code;
- _desc= desc;
- _hardError = hardError;
- }
-
- public int getCode()
- {
- return _code;
- }
-
- public String getDesc()
- {
- return _desc;
- }
-
- private boolean isHardError()
- {
- return _hardError;
- }
-
- public static ErrorCode get(int code)
- {
- switch(code)
- {
- case 200 : return NO_ERROR;
- case 311 : return CONTENT_TOO_LARGE;
- case 312 : return NO_ROUTE;
- case 313 : return NO_CONSUMERS;
- case 320 : return CONNECTION_FORCED;
- case 402 : return INVALID_PATH;
- case 403 : return ACCESS_REFUSED;
- case 404 : return NOT_FOUND;
- case 405 : return RESOURCE_LOCKED;
- case 406 : return PRE_CONDITION_FAILED;
- case 501 : return FRAME_ERROR;
- case 502 : return SYNTAX_ERROR;
- case 503 : return COMMAND_INVALID;
- case 504 : return SESSION_ERROR;
- case 530 : return NOT_ALLOWED;
- case 540 : return NOT_IMPLEMENTED;
- case 541 : return INTERNAL_ERROR;
- case 542 : return INVALID_ARGUMENT;
-
- default : return UNDEFINED;
- }
- }
- }
-
-/*
-
-<constant name="internal-error" value="541" class="hard-error">
-<doc>
- The server could not complete the method because of an internal error. The server may require
- intervention by an operator in order to resume normal operations.
-</doc>
-</constant>
-
-<constant name="invalid-argument" value="542" class="hard-error">
-<doc>
- An invalid or illegal argument was passed to a method, and the operation could not proceed.
-</doc>
-</constant>
-*/
diff --git a/java/common/src/main/java/org/apache/qpid/QpidException.java b/java/common/src/main/java/org/apache/qpid/QpidException.java
deleted file mode 100644
index 8503adaef8..0000000000
--- a/java/common/src/main/java/org/apache/qpid/QpidException.java
+++ /dev/null
@@ -1,58 +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;
-
-public class QpidException extends Exception
-{
- /**
- * AMQP error code
- */
- private ErrorCode _errorCode;
-
- /**
- * Constructor for a Qpid Exception.
- * <p> This is the only provided constructor and the parameters have to be set to null when
- * they are unknown.
- * @param message A description of the reason of this exception .
- * @param errorCode A string specifyin the error code of this exception.
- * @param cause The linked Execption. *
- *
- */
- public QpidException(String message, ErrorCode errorCode, Throwable cause)
- {
- super(message, cause);
- _errorCode = errorCode;
- }
-
- /*hack to get rid of a compile error from a generated class
- public QpidException(String message, String errorCode, Throwable cause)
- {
-
- }*/
-
- /**
- * Get this execption error code.
- *
- * @return This exception error code.
- */
- public ErrorCode getErrorCode()
- {
- return _errorCode;
- }
-}
-
diff --git a/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java b/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java
index 49effc2dae..69ccef7c29 100644
--- a/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java
+++ b/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java
@@ -19,7 +19,7 @@ package org.apache.qpid.dtx;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.qpid.QpidException;
+import org.apache.qpid.AMQInvalidArgumentException;
import javax.transaction.xa.Xid;
@@ -107,9 +107,9 @@ public class XidImpl implements Xid
* Note - The sum of the two lengths must equal the length of the data field.
*
* @param xid an XID STring Form
- * @throws QpidException If the string does not represent a valid Xid
+ * @throws AMQInvalidArgumentException If the string does not represent a valid Xid
*/
- public XidImpl(String xid) throws QpidException
+ public XidImpl(String xid) throws AMQInvalidArgumentException
{
if (_logger.isDebugEnabled())
{
@@ -125,16 +125,16 @@ public class XidImpl implements Xid
_branchQualifier = new byte[b];
if (input.read(_globalTransactionID, 0, g) != g)
{
- throw new QpidException("Cannot convert the string " + xid + " into an Xid", null, null);
+ throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
}
if (input.read(_branchQualifier, 0, b) != b)
{
- throw new QpidException("Cannot convert the string " + xid + " into an Xid", null, null);
+ throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
}
}
catch (IOException e)
{
- throw new QpidException("cannot convert the string " + xid + " into an Xid", null, e);
+ throw new AMQInvalidArgumentException("cannot convert the string " + xid + " into an Xid", e);
}
}
@@ -239,9 +239,8 @@ public class XidImpl implements Xid
*
* @param xid an Xid to convert.
* @return The String representation of this Xid
- * @throws QpidException In case of problem when converting this Xid into a string.
*/
- public static org.apache.qpid.transport.Xid convert(Xid xid) throws QpidException
+ public static org.apache.qpid.transport.Xid convert(Xid xid)
{
return new org.apache.qpid.transport.Xid(xid.getFormatId(),
xid.getGlobalTransactionId(),
diff --git a/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java b/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
index 9c56d36ade..5af2d4d1b3 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
@@ -26,8 +26,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
-import org.apache.qpid.QpidException;
-
import javax.security.sasl.Sasl;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;