|
@@ -18,6 +18,8 @@
|
|
|
|
|
|
package org.apache.zookeeper;
|
|
|
|
|
|
+import org.apache.yetus.audience.InterfaceAudience;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.EnumSet;
|
|
|
import java.util.HashMap;
|
|
@@ -25,6 +27,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@SuppressWarnings("serial")
|
|
|
+@InterfaceAudience.Public
|
|
|
public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* All multi-requests that result in an exception retain the results
|
|
@@ -172,6 +175,7 @@ public abstract class KeeperException extends Exception {
|
|
|
* javadoc to include in the user API spec.
|
|
|
*/
|
|
|
@Deprecated
|
|
|
+ @InterfaceAudience.Public
|
|
|
public interface CodeDeprecated {
|
|
|
/**
|
|
|
* @deprecated deprecated in 3.1.0, use {@link Code#OK} instead
|
|
@@ -317,6 +321,7 @@ public abstract class KeeperException extends Exception {
|
|
|
* constants. The old, deprecated, values are in "camel case" while the new
|
|
|
* enum values are in all CAPS.
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static enum Code implements CodeDeprecated {
|
|
|
/** Everything is OK */
|
|
|
OK (Ok),
|
|
@@ -546,6 +551,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#APIERROR
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class APIErrorException extends KeeperException {
|
|
|
public APIErrorException() {
|
|
|
super(Code.APIERROR);
|
|
@@ -555,6 +561,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#AUTHFAILED
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class AuthFailedException extends KeeperException {
|
|
|
public AuthFailedException() {
|
|
|
super(Code.AUTHFAILED);
|
|
@@ -564,6 +571,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#BADARGUMENTS
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class BadArgumentsException extends KeeperException {
|
|
|
public BadArgumentsException() {
|
|
|
super(Code.BADARGUMENTS);
|
|
@@ -576,6 +584,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#BADVERSION
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class BadVersionException extends KeeperException {
|
|
|
public BadVersionException() {
|
|
|
super(Code.BADVERSION);
|
|
@@ -588,6 +597,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#CONNECTIONLOSS
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class ConnectionLossException extends KeeperException {
|
|
|
public ConnectionLossException() {
|
|
|
super(Code.CONNECTIONLOSS);
|
|
@@ -597,6 +607,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#DATAINCONSISTENCY
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class DataInconsistencyException extends KeeperException {
|
|
|
public DataInconsistencyException() {
|
|
|
super(Code.DATAINCONSISTENCY);
|
|
@@ -606,6 +617,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#INVALIDACL
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class InvalidACLException extends KeeperException {
|
|
|
public InvalidACLException() {
|
|
|
super(Code.INVALIDACL);
|
|
@@ -618,6 +630,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#INVALIDCALLBACK
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class InvalidCallbackException extends KeeperException {
|
|
|
public InvalidCallbackException() {
|
|
|
super(Code.INVALIDCALLBACK);
|
|
@@ -627,6 +640,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#MARSHALLINGERROR
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class MarshallingErrorException extends KeeperException {
|
|
|
public MarshallingErrorException() {
|
|
|
super(Code.MARSHALLINGERROR);
|
|
@@ -636,6 +650,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NOAUTH
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NoAuthException extends KeeperException {
|
|
|
public NoAuthException() {
|
|
|
super(Code.NOAUTH);
|
|
@@ -645,6 +660,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NEWCONFIGNOQUORUM
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NewConfigNoQuorum extends KeeperException {
|
|
|
public NewConfigNoQuorum() {
|
|
|
super(Code.NEWCONFIGNOQUORUM);
|
|
@@ -654,6 +670,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#RECONFIGINPROGRESS
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class ReconfigInProgress extends KeeperException {
|
|
|
public ReconfigInProgress() {
|
|
|
super(Code.RECONFIGINPROGRESS);
|
|
@@ -663,6 +680,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NOCHILDRENFOREPHEMERALS
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NoChildrenForEphemeralsException extends KeeperException {
|
|
|
public NoChildrenForEphemeralsException() {
|
|
|
super(Code.NOCHILDRENFOREPHEMERALS);
|
|
@@ -675,6 +693,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NODEEXISTS
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NodeExistsException extends KeeperException {
|
|
|
public NodeExistsException() {
|
|
|
super(Code.NODEEXISTS);
|
|
@@ -687,6 +706,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NONODE
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NoNodeException extends KeeperException {
|
|
|
public NoNodeException() {
|
|
|
super(Code.NONODE);
|
|
@@ -699,6 +719,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NOTEMPTY
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NotEmptyException extends KeeperException {
|
|
|
public NotEmptyException() {
|
|
|
super(Code.NOTEMPTY);
|
|
@@ -711,6 +732,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#OPERATIONTIMEOUT
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class OperationTimeoutException extends KeeperException {
|
|
|
public OperationTimeoutException() {
|
|
|
super(Code.OPERATIONTIMEOUT);
|
|
@@ -720,6 +742,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#RUNTIMEINCONSISTENCY
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class RuntimeInconsistencyException extends KeeperException {
|
|
|
public RuntimeInconsistencyException() {
|
|
|
super(Code.RUNTIMEINCONSISTENCY);
|
|
@@ -729,6 +752,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#SESSIONEXPIRED
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class SessionExpiredException extends KeeperException {
|
|
|
public SessionExpiredException() {
|
|
|
super(Code.SESSIONEXPIRED);
|
|
@@ -738,6 +762,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#UNKNOWNSESSION
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class UnknownSessionException extends KeeperException {
|
|
|
public UnknownSessionException() {
|
|
|
super(Code.UNKNOWNSESSION);
|
|
@@ -747,6 +772,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#SESSIONMOVED
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class SessionMovedException extends KeeperException {
|
|
|
public SessionMovedException() {
|
|
|
super(Code.SESSIONMOVED);
|
|
@@ -756,6 +782,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NOTREADONLY
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NotReadOnlyException extends KeeperException {
|
|
|
public NotReadOnlyException() {
|
|
|
super(Code.NOTREADONLY);
|
|
@@ -765,6 +792,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#EPHEMERALONLOCALSESSION
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class EphemeralOnLocalSessionException extends KeeperException {
|
|
|
public EphemeralOnLocalSessionException() {
|
|
|
super(Code.EPHEMERALONLOCALSESSION);
|
|
@@ -774,6 +802,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#SYSTEMERROR
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class SystemErrorException extends KeeperException {
|
|
|
public SystemErrorException() {
|
|
|
super(Code.SYSTEMERROR);
|
|
@@ -783,6 +812,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#UNIMPLEMENTED
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class UnimplementedException extends KeeperException {
|
|
|
public UnimplementedException() {
|
|
|
super(Code.UNIMPLEMENTED);
|
|
@@ -792,6 +822,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#NOWATCHER
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class NoWatcherException extends KeeperException {
|
|
|
public NoWatcherException() {
|
|
|
super(Code.NOWATCHER);
|
|
@@ -805,6 +836,7 @@ public abstract class KeeperException extends Exception {
|
|
|
/**
|
|
|
* @see Code#RECONFIGDISABLED
|
|
|
*/
|
|
|
+ @InterfaceAudience.Public
|
|
|
public static class ReconfigDisabledException extends KeeperException {
|
|
|
public ReconfigDisabledException() { super(Code.RECONFIGDISABLED); }
|
|
|
public ReconfigDisabledException(String path) {
|