2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.access.concepts;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import org.eclipse.jdt.annotation.NonNull;
16 * A failure cause behind a {@link RequestFailure} to process a {@link Request}.
18 * @author Robert Varga
21 public abstract class RequestException extends Exception {
22 private static final long serialVersionUID = 1L;
24 protected RequestException(final @NonNull String message) {
25 super(requireNonNull(message));
28 protected RequestException(final @NonNull String message, final @NonNull Throwable cause) {
29 super(requireNonNull(message), requireNonNull(cause));
32 public abstract boolean isRetriable();
35 * Unwraps the underlying failure. This method is overridden only in {@link RuntimeRequestException}.
37 * @return Underlying cause of the failure if exception is a {@link RuntimeRequestException}, or the exception
40 public Throwable unwrap() {