Updated Branches: refs/heads/master 860892521 -> 939acb0f4
Remove unused CloudExecutionException. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/939acb0f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/939acb0f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/939acb0f Branch: refs/heads/master Commit: 939acb0f4c951f8c04de78cf897c8f6a25b1f05d Parents: 8608925 Author: Min Chen <[email protected]> Authored: Tue Jan 15 18:17:35 2013 -0800 Committer: Min Chen <[email protected]> Committed: Tue Jan 15 18:17:35 2013 -0800 ---------------------------------------------------------------------- .../cloud/exception/CloudExecutionException.java | 57 --------------- api/src/com/cloud/exception/ErrorCode.java | 52 ------------- 2 files changed, 0 insertions(+), 109 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/939acb0f/api/src/com/cloud/exception/CloudExecutionException.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/exception/CloudExecutionException.java b/api/src/com/cloud/exception/CloudExecutionException.java deleted file mode 100755 index c19fc45..0000000 --- a/api/src/com/cloud/exception/CloudExecutionException.java +++ /dev/null @@ -1,57 +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 com.cloud.exception; - -import java.util.HashMap; - -import com.cloud.utils.exception.CloudRuntimeException; -import com.cloud.utils.SerialVersionUID; - -/** - * - */ -public class CloudExecutionException extends CloudRuntimeException { - private final static long serialVersionUID = SerialVersionUID.CloudExecutionException; - - private final ErrorCode code; - private final HashMap<String, Object> details; - - public CloudExecutionException(ErrorCode code, String message, Throwable cause) { - super(message, cause); - this.code = code; - details = new HashMap<String, Object>(); - } - - public ErrorCode getErrorCode() { - return code; - } - - public String getErrorMessage() { - return new StringBuilder("Error Code=").append(code).append("; Error Message=").append(super.toString()).toString(); - } - - @Override - public String toString() { - StringBuilder buff = new StringBuilder(); - buff.append("Error Code=").append(code); - buff.append("; Error Message=").append(super.toString()); - if (details.size() > 0) { - buff.append("; Error Details=").append(details.toString()); - } - return buff.toString(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/939acb0f/api/src/com/cloud/exception/ErrorCode.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/exception/ErrorCode.java b/api/src/com/cloud/exception/ErrorCode.java deleted file mode 100755 index 8f048b8..0000000 --- a/api/src/com/cloud/exception/ErrorCode.java +++ /dev/null @@ -1,52 +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 com.cloud.exception; - -import java.util.HashSet; - -/** - */ -public class ErrorCode { - String code; - private static HashSet<ErrorCode> s_codes = new HashSet<ErrorCode>(); - - public ErrorCode(String code) { - this.code = code; - assert !s_codes.contains(this) : "There is already an error code registered for this code: " + code; - s_codes.add(this); - } - - public String getCode() { - return code; - } - - @Override - public int hashCode() { - return code.hashCode(); - } - - @Override - public boolean equals(Object that) { - if (!(that instanceof ErrorCode)) { - return false; - } - - return this.code.equals(((ErrorCode)that).code); - } - - public final static ErrorCode UnableToReachResource = new ErrorCode("resource.unavailable"); -}
