Remove deprecated Rpcs and RpcErrors 25/70025/2
authorTom Pantelis <tompantelis@gmail.com>
Fri, 23 Mar 2018 14:33:46 +0000 (10:33 -0400)
committerStephen Kitt <skitt@redhat.com>
Tue, 27 Mar 2018 17:40:49 +0000 (17:40 +0000)
The only user was in snmp4sdn and a patch has been submitted
for that.

Change-Id: I751a6c1181187e1bd0207f31965f61d6d494434d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/RpcErrors.java [deleted file]
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java [deleted file]

diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/RpcErrors.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/RpcErrors.java
deleted file mode 100644 (file)
index ad550da..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.common.util;
-
-import org.opendaylight.yangtools.yang.common.RpcError;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity;
-import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
-
-/**
- * Deprecated.
- *
- * @deprecated Use {@link org.opendaylight.yangtools.yang.common.RpcResultBuilder}
- */
-@Deprecated
-public final class RpcErrors {
-    private RpcErrors() {
-    }
-
-    /**
-     * Creates an RpcError.
-     *
-     * @return {@link RpcError} implementation
-     */
-    public static RpcError getRpcError(String applicationTag, String tag, String info,
-            ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
-        RpcErrorTO ret = new RpcErrorTO(applicationTag, tag, info, severity, message,
-                errorType, cause);
-        return ret;
-    }
-
-    private static class RpcErrorTO implements RpcError {
-
-        private final String applicationTag;
-        private final String tag;
-        private final String info;
-        private final ErrorSeverity severity;
-        private final String message;
-        private final ErrorType errorType;
-        private final Throwable cause;
-
-        protected RpcErrorTO(String applicationTag, String tag, String info,
-                ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
-            this.applicationTag = applicationTag;
-            this.tag = tag;
-            this.info = info;
-            this.severity = severity;
-            this.message = message;
-            this.errorType = errorType;
-            this.cause = cause;
-        }
-
-        @Override
-        public String getApplicationTag() {
-            return applicationTag;
-        }
-
-        @Override
-        public String getInfo() {
-            return info;
-        }
-
-        @Override
-        public String getMessage() {
-            return message;
-        }
-
-        @Override
-        public ErrorSeverity getSeverity() {
-            return severity;
-        }
-
-        @Override
-        public String getTag() {
-            return tag;
-        }
-
-        @Override
-        public Throwable getCause() {
-            return cause;
-        }
-
-        @Override
-        public ErrorType getErrorType() {
-            return errorType;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java
deleted file mode 100644 (file)
index 3278cef..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.common.util;
-
-import com.google.common.collect.ImmutableList;
-import java.util.Collection;
-import org.opendaylight.yangtools.concepts.Immutable;
-import org.opendaylight.yangtools.yang.common.RpcError;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-/**
- * Deprecated.
- *
- * @deprecated Use {@link org.opendaylight.yangtools.yang.common.RpcResultBuilder}
- */
-@Deprecated
-public final class Rpcs {
-    private Rpcs() {
-    }
-
-    public static <T> RpcResult<T> getRpcResult(boolean successful) {
-        return new RpcResultTO<>(successful, null, ImmutableList.of());
-    }
-
-    public static <T> RpcResult<T> getRpcResult(boolean successful, T result,
-            Collection<RpcError> errors) {
-        return new RpcResultTO<>(successful, result, errors);
-    }
-
-    public static <T> RpcResult<T> getRpcResult(boolean successful, Collection<RpcError> errors) {
-        return new RpcResultTO<>(successful, null, errors);
-    }
-
-    private static class RpcResultTO<T> implements RpcResult<T>, Immutable {
-        private final Collection<RpcError> errors;
-        private final T result;
-        private final boolean successful;
-
-        RpcResultTO(boolean successful, T result, Collection<RpcError> errors) {
-            this.successful = successful;
-            this.result = result;
-            this.errors = ImmutableList.copyOf(errors);
-        }
-
-        @Override
-        public boolean isSuccessful() {
-            return successful;
-        }
-
-        @Override
-        public T getResult() {
-            return result;
-        }
-
-        @Override
-        public Collection<RpcError> getErrors() {
-            return errors;
-        }
-    }
-}