Class RC


  • public class RC
    extends Object
    • Field Detail

      • WARNING_TEMPORARILY

        public static final int WARNING_TEMPORARILY
        Miscellaneous warning
        See Also:
        Constant Field Values
      • WARNING

        public static final int WARNING
        Miscellaneous persistent warning
        See Also:
        Constant Field Values
      • ACCESS_DENIED

        public static final int ACCESS_DENIED
        you are not allowed to access the system, causes the client system to ask for a password, exception for authentication
        See Also:
        Constant Field Values
      • FORBIDDEN

        public static final int FORBIDDEN
        you are not allowed to access this resource, user and password is given but access ins not granted, exception for authorization
        See Also:
        Constant Field Values
      • NOT_FOUND

        public static final int NOT_FOUND
        Resource was not found and thats ok - in contrast to CONFLICT - resource should be there
        See Also:
        Constant Field Values
      • CONFLICT

        public static final int CONFLICT
        conflict state or wrong state, to many retries, key to remove not found, key already set wrong configuration - if not fixed fast, result is null, duplicate entry, device is not enabled ... is not writable / read only
        See Also:
        Constant Field Values
      • GONE

        public static final int GONE
        indicating that the resource requested by the client has been permanently deleted, and that the client should not expect an alternative redirection or forwarding address
        See Also:
        Constant Field Values
      • SYNTAX_ERROR

        public static final int SYNTAX_ERROR
        Unsupported Media Type - string instead of int, wrong parameter value type, malformed format
        See Also:
        Constant Field Values
      • USAGE

        public static final int USAGE
        Unprocessable Entity - parameter from client not set, parameter not found, parameter data is null
        See Also:
        Constant Field Values
      • INTERNAL_ERROR

        public static final int INTERNAL_ERROR
        Internal Server Error, general server error
        See Also:
        Constant Field Values
      • NOT_SUPPORTED

        public static final int NOT_SUPPORTED
        Not Implemented, method or operation not found
        See Also:
        Constant Field Values
      • BUSY

        public static final int BUSY
        Service Unavailable, do not use 403 because it could be repeated, Resource currently not available, locked
        See Also:
        Constant Field Values
      • TOO_DEEP

        public static final int TOO_DEEP
        Loop Detected, to deep iteration, stack overflow
        See Also:
        Constant Field Values
    • Constructor Detail

      • RC

        public RC()
    • Method Detail

      • toMessage

        public static String toMessage​(int rc,
                                       RC.CAUSE causeHandling,
                                       String msg,
                                       Object[] parameters,
                                       int maxSize)
      • findReturnCode

        public static int findReturnCode​(RC.CAUSE causeHandling,
                                         int rc,
                                         Object... in)
      • normalize

        public static int normalize​(int rc)
        Allow all between 0 - 999, otherwise 400 (ERROR)
        Parameters:
        rc -
        Returns:
        normalize error code
      • isWarning

        public static boolean isWarning​(int rc)
        is successful but a warning
        Parameters:
        rc -
        Returns:
        true if this kind of error
      • isTechnicalError

        public static boolean isTechnicalError​(int rc)
        not permanent, could be fixed
        Parameters:
        rc -
        Returns:
        true if this kind of error
      • isProfessionalError

        public static boolean isProfessionalError​(int rc)
        permanent error, retry will not fix it
        Parameters:
        rc -
        Returns:
        true if this kind of error
      • isSuccessful

        public static boolean isSuccessful​(int rc)
        not an error - should not be used for exceptions
        Parameters:
        rc -
        Returns:
        true if this kind of error
      • canRetry

        public static boolean canRetry​(int rc)
      • toString

        public static String toString​(int rc)