Package org.apache.jackrabbit.oak.api
Class CommitFailedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.jackrabbit.oak.api.CommitFailedException
-
- All Implemented Interfaces:
Serializable
public class CommitFailedException extends Exception
Main exception thrown by methods defined on theContentSession
interface indicating that committing a given set of changes failed.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCESS
Type name for access violation (i.e.static String
ACCESS_CONTROL
Type name for access control violation errors.static String
CONSTRAINT
Type name for constraint violation errors.static String
INTEGRITY
Type name for referential integrity violation errors.static String
LABEL_EXISTS
Type name for label exists version errors.static String
LOCK
Type name for lock violation errors.static String
MERGE
Type name for merge errors.static String
NAME
Type name for name violation errors.static String
NAMESPACE
Type name for namespace violation errors.static String
NODE_TYPE
Type name for node type violation errors.static String
OAK
Source name for exceptions thrown by components in the Oak project.static String
STATE
Type name for state violation errors.static String
UNSUPPORTED
Unsupported operation or featurestatic String
VERSION
Type name for version violation errors.
-
Constructor Summary
Constructors Constructor Description CommitFailedException(String type, int code, String message)
CommitFailedException(String type, int code, String message, Throwable cause)
CommitFailedException(String source, String type, int code, String message, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryException
asRepositoryException()
Wraps the givenCommitFailedException
instance using the appropriateRepositoryException
subclass based on thetype
of the given exception.RepositoryException
asRepositoryException(@NotNull String message)
Wraps the givenCommitFailedException
instance using the appropriateRepositoryException
subclass based on thetype
of the given exception.int
getCode()
Returns the type-specific error code of this exception.String
getSource()
Returns the name of the source of this exception.String
getType()
Return the name of the type of this exception.boolean
isAccessControlViolation()
Checks whether this is an access control violation exception.boolean
isAccessViolation()
Checks whether this is an access violation exception.boolean
isConstraintViolation()
Checks whether this is a constraint violation exception.boolean
isOfType(String type)
Checks whether this exception is of the given type.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
OAK
public static final String OAK
Source name for exceptions thrown by components in the Oak project.- See Also:
- Constant Field Values
-
ACCESS
public static final String ACCESS
Type name for access violation (i.e. permission denied) errors.- See Also:
- Constant Field Values
-
ACCESS_CONTROL
public static final String ACCESS_CONTROL
Type name for access control violation errors.- See Also:
- Constant Field Values
-
CONSTRAINT
public static final String CONSTRAINT
Type name for constraint violation errors.- See Also:
- Constant Field Values
-
INTEGRITY
public static final String INTEGRITY
Type name for referential integrity violation errors.- See Also:
- Constant Field Values
-
LOCK
public static final String LOCK
Type name for lock violation errors.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
Type name for name violation errors.- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
Type name for namespace violation errors.- See Also:
- Constant Field Values
-
NODE_TYPE
public static final String NODE_TYPE
Type name for node type violation errors.- See Also:
- Constant Field Values
-
STATE
public static final String STATE
Type name for state violation errors.- See Also:
- Constant Field Values
-
VERSION
public static final String VERSION
Type name for version violation errors.- See Also:
- Constant Field Values
-
LABEL_EXISTS
public static final String LABEL_EXISTS
Type name for label exists version errors.- See Also:
- Constant Field Values
-
MERGE
public static final String MERGE
Type name for merge errors.- See Also:
- Constant Field Values
-
UNSUPPORTED
public static final String UNSUPPORTED
Unsupported operation or feature- See Also:
- Constant Field Values
-
-
Method Detail
-
isOfType
public boolean isOfType(String type)
Checks whether this exception is of the given type.- Parameters:
type
- type name- Returns:
true
iff this exception is of the given type
-
isAccessViolation
public boolean isAccessViolation()
Checks whether this is an access violation exception.- Returns:
true
iff this is an access violation exception
-
isAccessControlViolation
public boolean isAccessControlViolation()
Checks whether this is an access control violation exception.- Returns:
true
iff this is an access control violation exception
-
isConstraintViolation
public boolean isConstraintViolation()
Checks whether this is a constraint violation exception.- Returns:
true
iff this is a constraint violation exception
-
getSource
public String getSource()
Returns the name of the source of this exception.- Returns:
- source name
-
getType
public String getType()
Return the name of the type of this exception.- Returns:
- type name
-
getCode
public int getCode()
Returns the type-specific error code of this exception.- Returns:
- error code
-
asRepositoryException
public RepositoryException asRepositoryException()
Wraps the givenCommitFailedException
instance using the appropriateRepositoryException
subclass based on thetype
of the given exception.- Returns:
- matching repository exception
-
asRepositoryException
public RepositoryException asRepositoryException(@NotNull @NotNull String message)
Wraps the givenCommitFailedException
instance using the appropriateRepositoryException
subclass based on thetype
of the given exception.- Parameters:
message
- The exception message.- Returns:
- matching repository exception
-
-