Groovy Documentation

com.ace.mws.plugins
[Java] Class WebServiceException

java.lang.Object
  java.lang.Throwable
      com.ace.mws.plugins.WebServiceException

public class WebServiceException
extends Throwable

This exception is designed to be thrown from a plugin's custom web service. It has fields for specifying the messages to be returned as well as the HTTP response code.

Authors:
bsaville


Field Summary
private List messages

private Integer responseCode

private static long serialVersionUID

 
Constructor Summary
WebServiceException()

Empty constructor.

WebServiceException(String message)

If no additional values are set, this will return a list of messages containing the specified message as the single element and a 500 error.

WebServiceException(Integer responseCode)

If no additional values are set, this will return the default message and the specified response code.

WebServiceException(String message, Integer responseCode)

This will return a list of errors containing the specified message and the specified response code.

WebServiceException(List messages, Integer responseCode)

This will return the list of errors specified and the specified response code.

 
Method Summary
List getMessages()

Retrieves the list of messages for this exception.

Integer getResponseCode()

Retrieves the HTTP response code for this exception.

void setMessages(String message)

Sets the messages to a list with a single element as the specified message.

void setMessages(List messages)

Sets the messages to the specified list.

void setResponseCode(Integer responseCode)

Sets the response code for this exception.

 
Methods inherited from class Throwable
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

messages

private List messages


responseCode

private Integer responseCode


serialVersionUID

private static final long serialVersionUID


 
Constructor Detail

WebServiceException

public WebServiceException()
Empty constructor. If no additional values are set, this will return a 500 error with a default message.


WebServiceException

public WebServiceException(String message)
If no additional values are set, this will return a list of messages containing the specified message as the single element and a 500 error.
Parameters:
message - A message to return to the user


WebServiceException

public WebServiceException(Integer responseCode)
If no additional values are set, this will return the default message and the specified response code.
Parameters:
responseCode - The HTTP response code to return to the user


WebServiceException

public WebServiceException(String message, Integer responseCode)
This will return a list of errors containing the specified message and the specified response code.
Parameters:
message - A message to return to the user
responseCode - HTTP The response code to return to the user


WebServiceException

public WebServiceException(List messages, Integer responseCode)
This will return the list of errors specified and the specified response code.
Parameters:
messages - A list of messages to return to the user
responseCode - The HTTP response code to return to the user


 
Method Detail

getMessages

public List getMessages()
Retrieves the list of messages for this exception.
Returns:
The current value


getResponseCode

public Integer getResponseCode()
Retrieves the HTTP response code for this exception.
Returns:
The current value


setMessages

public void setMessages(String message)
Sets the messages to a list with a single element as the specified message.
Parameters:
message - A message to return to the user


setMessages

public void setMessages(List messages)
Sets the messages to the specified list.
Parameters:
messages - A list of messages to return to the user


setResponseCode

public void setResponseCode(Integer responseCode)
Sets the response code for this exception.
Parameters:
responseCode - The HTTP response code to return to the user


 

Groovy Documentation