Class UserNotAuthorizedException

All Implemented Interfaces:
Serializable

public class UserNotAuthorizedException extends OMRSCheckedExceptionBase
The UserNotAuthorizedException is thrown by an OMRS Connector when the supplied UserId is not permitted to perform a specific operation on the metadata collection.
See Also:
  • Constructor Details

    • UserNotAuthorizedException

      public UserNotAuthorizedException(ExceptionMessageDefinition messageDefinition, String className, String actionDescription, String userId)
      This is the typical constructor used for creating an UserNotAuthorizedException.
      Parameters:
      messageDefinition - content of the message
      className - name of class reporting error
      actionDescription - description of function it was performing when error detected
      userId - offending userId
    • UserNotAuthorizedException

      public UserNotAuthorizedException(ExceptionMessageDefinition messageDefinition, String className, String actionDescription, String userId, Map<String,Object> relatedProperties)
      This is the typical constructor used for creating an UserNotAuthorizedException. The properties allow additional information to be associated with the exception.
      Parameters:
      messageDefinition - content of the message
      className - name of class reporting error
      actionDescription - description of function it was performing when error detected
      userId - offending userId
      relatedProperties - arbitrary properties that may help with diagnosing the problem.
    • UserNotAuthorizedException

      public UserNotAuthorizedException(ExceptionMessageDefinition messageDefinition, String className, String actionDescription, Throwable caughtError, String userId)
      This is the constructor used for creating an UserNotAuthorizedException when an unexpected error has been caught. The properties allow additional information to be associated with the exception.
      Parameters:
      messageDefinition - content of the message
      className - name of class reporting error
      actionDescription - description of function it was performing when error detected
      caughtError - previous error causing this exception
      userId - offending userId
    • UserNotAuthorizedException

      public UserNotAuthorizedException(ExceptionMessageDefinition messageDefinition, String className, String actionDescription, Throwable caughtError, String userId, Map<String,Object> relatedProperties)
      This is the constructor used for creating an UserNotAuthorizedException when an unexpected error has been caught. The properties allow additional information to be associated with the exception.
      Parameters:
      messageDefinition - content of the message
      className - name of class reporting error
      actionDescription - description of function it was performing when error detected
      caughtError - previous error causing this exception
      userId - offending userId
      relatedProperties - arbitrary properties that may help with diagnosing the problem.
    • UserNotAuthorizedException

      public UserNotAuthorizedException(int httpCode, String className, String actionDescription, String errorMessage, String errorMessageId, String[] errorMessageParameters, String systemAction, String userAction, String caughtErrorClassName, String userId, Map<String,Object> relatedProperties)
      This is the constructor used when receiving an exception from a remote server. The values are stored directly in the response object and are passed explicitly to the new exception. Notice that the technical aspects of the exception - such as class name creating the exception are local values so that the implementation of the server is not exposed.
      Parameters:
      httpCode - http response code to use if this exception flows over a REST call
      className - name of class reporting error
      actionDescription - description of function it was performing when error detected
      errorMessage - description of error
      errorMessageId - unique identifier for the message
      errorMessageParameters - parameters that were inserted in the message
      systemAction - actions of the system as a result of the error
      userAction - instructions for correcting the error
      caughtErrorClassName - previous error causing this exception
      userId - failing userId
      relatedProperties - arbitrary properties that may help with diagnosing the problem.
    • UserNotAuthorizedException

      public UserNotAuthorizedException(UserNotAuthorizedException caughtError)
      Constructor to translate an OCF exception into an Open Metadata Repository Services (OMRS) exception
      Parameters:
      caughtError - OCF exception
  • Method Details

    • getUserId

      public String getUserId()
      Return the userId passed on the request.
      Returns:
      string user id
    • toString

      public String toString()
      JSON-style toString
      Overrides:
      toString in class OCFCheckedExceptionBase
      Returns:
      string of property names and values for this enum
    • equals

      public boolean equals(Object objectToCompare)
      Return comparison result based on the content of the properties.
      Overrides:
      equals in class OCFCheckedExceptionBase
      Parameters:
      objectToCompare - test object
      Returns:
      result of comparison
    • hashCode

      public int hashCode()
      Return hash code for this object
      Overrides:
      hashCode in class OCFCheckedExceptionBase
      Returns:
      int hash code