Class JKServiceClientException

All Implemented Interfaces:
Serializable

public class JKServiceClientException extends JKException
This class represents exceptions thrown to indicate that client-side error occurred when communicating with a remote service.

This exception is a subclass of JKException.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
See Also:
  • Constructor Details

    • JKServiceClientException

      public JKServiceClientException()
      This method constructs a new JKServiceClientException without any specified errors or causes.

      This constructor is typically used when the exception is thrown to represent a specific error condition without additional details.

    • JKServiceClientException

      public JKServiceClientException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
      This method constructs a JKServiceClientException with a specific error message, cause, suppression behavior, and stack trace writability.
      Parameters:
      message - Specifies the error message explaining the reason for this exception.
      cause - Specifies the cause of this exception.
      enableSuppression - Specifies whether suppression is enabled or disabled.
      writableStackTrace - Specifies whether the stack trace should be writable.
    • JKServiceClientException

      public JKServiceClientException(String message, Throwable cause)
      This method constructs a JKServiceClientException with a specific error message and a cause.
      Parameters:
      message - Specifies the error message explaining the reason for this exception.
      cause - Specifies the cause of this exception.
    • JKServiceClientException

      public JKServiceClientException(String message)
      This method constructs a JKServiceClientException with a specific error message.
      Parameters:
      message - Specifies the error message explaining the reason for this exception.
    • JKServiceClientException

      public JKServiceClientException(Throwable cause)
      This method constructs a JKServiceClientException with a cause.
      Parameters:
      cause - Specifies the cause of this exception.
    • JKServiceClientException

      public JKServiceClientException(JKHttpStatus status)
      This method constructs a JKServiceClientException with the specified HTTP status.
      Parameters:
      status - Specifies the HTTP status associated with the exception.
    • JKServiceClientException

      public JKServiceClientException(String serviceName, String url, JKHttpStatus status, String responseMessage, Throwable cause)
      This method constructs a JKServiceClientException with the provided details.
      Parameters:
      serviceName - Specifies the name of the service.
      url - Specifies the URL of the service request.
      status - Specifies the HTTP status associated with the exception.
      responseMessage - Specifies the response message received from the service.
      cause - Specifies the cause of the exception.
    • JKServiceClientException

      public JKServiceClientException(String serviceName, String url, JKHttpStatus status, String responseMessage)
      This method constructs a JKServiceClientException with the provided details.
      Parameters:
      serviceName - Specifies the name of the service.
      url - Specifies the URL of the service request.
      status - Specifies the HTTP status associated with the exception.
      responseMessage - Specifies the response message received from the service.
  • Method Details

    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getServiceName

      public String getServiceName()
      This method gets the name of the service associated with the exception.
      Returns:
      the name of the service associated with the exception.
    • setServiceName

      public void setServiceName(String serviceName)
      This method sets the name of the service associated with the exception to the provided value.
      Parameters:
      serviceName - Specifies the new name of the service associated with the exception.
    • getErrorCode

      public String getErrorCode()
      This method retrieves the error code associated with the exception.
      Returns:
      the error code associated with the exception.
    • setErrorCode

      public void setErrorCode(String errorCode)
      This method sets the error code associated with the exception to the provided value.
      Parameters:
      errorCode - Specifies the new error code associated with the exception.
    • getErrorMessage

      public String getErrorMessage()
      This method retrieves the error message associated with the exception.
      Returns:
      the error message associated with the exception.
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      This method sets the error message associated with the exception to the provided value.
      Parameters:
      errorMessage - Specifies the new error message associated with the exception.
    • getStatus

      public JKHttpStatus getStatus()
      This method retrieves the HTTP status associated with the exception.
      Returns:
      the HTTP status associated with the exception.
    • setStatus

      public void setStatus(JKHttpStatus status)
      This method sets the HTTP status associated with the exception to the provided value.
      Parameters:
      status - Specifies the new HTTP status associated with the exception.
    • getUrl

      public String getUrl()
      This method gets the URL associated with the exception.
      Returns:
      the URL associated with the exception.
    • setUrl

      public void setUrl(String url)
      This method sets the URL associated with the exception to the provided value.
      Parameters:
      url - Specifies the new URL associated with the exception.
    • getResponseMessage

      public String getResponseMessage()
      This method gets the response message received from the service..
      Returns:
      the response message received from the service.
    • setResponseMessage

      public void setResponseMessage(String responseMessage)
      This method sets the response message received from the service to the provided value.
      Parameters:
      responseMessage - Specifies the new response message received from the service.
    • isNotFound

      public boolean isNotFound()
      This method checks if the exception represents a "Not Found" error.
      Returns:
      true, if the exception's status is "Not Found," false otherwise.