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 the ContentSession interface indicating that committing a given set of changes failed.
See Also:
  • Field Details

  • Constructor Details

    • CommitFailedException

      public CommitFailedException(String source, String type, int code, String message, Throwable cause)
    • CommitFailedException

      public CommitFailedException(String type, int code, String message, Throwable cause)
    • CommitFailedException

      public CommitFailedException(String type, int code, String message)
  • Method Details

    • 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 given CommitFailedException instance using the appropriate RepositoryException subclass based on the type of the given exception.
      Returns:
      matching repository exception
    • asRepositoryException

      public RepositoryException asRepositoryException(@NotNull @NotNull String message)
      Wraps the given CommitFailedException instance using the appropriate RepositoryException subclass based on the type of the given exception.
      Parameters:
      message - The exception message.
      Returns:
      matching repository exception