Skip navigation links


com.fatwire.services.beans
Class ServiceResponse

java.lang.Object
  extended by com.fatwire.services.beans.BaseBean
      extended by com.fatwire.services.beans.ServiceResponse

All Implemented Interfaces:
java.io.Serializable

public class ServiceResponse
extends BaseBean

This class encapsulates a response value object populated by the services.

The response may arise out of a successful transaction, a warning or error. It can associate an end-user message to describe the response, a severity, and an error code to classify the transaction.

See Also:
Serialized Form

Nested Class Summary
static class ServiceResponse.Severity
          This class enumerates severities of conditions handled in the service modules.
static class ServiceResponse.Status
           An enumeration of possible states which a response can have.

 

Constructor Summary
ServiceResponse()
           Default constructor.
ServiceResponse(ServiceResponse.Severity severity)
           Overloaded constructor with a standard severity.
ServiceResponse(java.lang.String severity)
           Overloaded constructor with a free-form severity.

 

Method Summary
 java.util.List<java.lang.String> getMessages()
          Returns a list of descriptive messages returned from the service.
 void setSeverity(ServiceResponse.Severity severity)
          Sets the severity of this response from one of the standard values specified.
 void setSeverity(java.lang.String severity)
          Sets the severity of this response.
 void setStatus(java.lang.Integer status)
           Sets a custom status code to be associated with this response.
 void setStatus(ServiceResponse.Status status)
           Sets a status code to be associated with this response from one of the standard values specified.
 java.lang.String severity()
          Returns the severity of this response, as an upper case string, otherwise returns null.
 java.lang.Integer status()
          Returns the status code, if any, associated with this response.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ServiceResponse

public ServiceResponse()

Default constructor.

Creates an empty service response object with severity ServiceResponse.Severity.INFO.

ServiceResponse

public ServiceResponse(ServiceResponse.Severity severity)

Overloaded constructor with a standard severity.

Creates an empty service response object with the specified severity. For free-form values, ServiceResponse.ServiceResponse(String) may be used.
Parameters:
severity - The severity for this response object.

ServiceResponse

public ServiceResponse(java.lang.String severity)

Overloaded constructor with a free-form severity.

Creates an empty service response object with the specified free-form severity. For enumerated values, ServiceResponse.ServiceResponse(Severity) may be used.
Parameters:
severity - The severity for this response object.

Method Detail

getMessages

public java.util.List<java.lang.String> getMessages()
Returns a list of descriptive messages returned from the service.
Returns:
Description of the response.

setSeverity

public void setSeverity(java.lang.String severity)
Sets the severity of this response. The Severity is specified as a string. For enumerated values, ServiceResponse.setSeverity(Severity) may be used.
Parameters:
severity - Severity of this response.
See Also:
ServiceResponse.Severity

setSeverity

public void setSeverity(ServiceResponse.Severity severity)
Sets the severity of this response from one of the standard values specified. For custom values, ServiceResponse.setSeverity(String) may be used.
Parameters:
severity - Severity of this response.
See Also:
ServiceResponse.Severity

severity

public java.lang.String severity()
Returns the severity of this response, as an upper case string, otherwise returns null.
Returns:
Severity of the error condition.

status

public java.lang.Integer status()
Returns the status code, if any, associated with this response.
Returns:
status code.

setStatus

public void setStatus(java.lang.Integer status)

Sets a custom status code to be associated with this response.

For enumerated values, ServiceResponse.setStatus(Status) may be used.
Parameters:
status - - Status to be associated with this response.

setStatus

public void setStatus(ServiceResponse.Status status)

Sets a status code to be associated with this response from one of the standard values specified.

For custom values, ServiceResponse.setStatus(Integer) may be used.
Parameters:
status - - Status to be associated with this response.

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.