com.alarmpoint.integrations.infrastructure.agent.service
Class IntegrationServiceResponse

java.lang.Object
  extended by com.alarmpoint.integrations.infrastructure.agent.service.IntegrationServiceResponse

public class IntegrationServiceResponse
extends java.lang.Object

Data container for the external service response. This provides a response code and possible data object from results of the external request.

 IntegrationServiceResponse resps = esr.send();
 if (resps.getResponseCode() == IntegrationServiceResponseCode.UNAUTHORIZED)
 {
     out.print("Unauthorized");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.UNDEFINED_SERVICE)
 {
     out.print("Undefined service");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.INACTIVE_SERVICE)
 {
     out.print("Inactive service");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.SUSPENDED_SERVICE)
 {
     out.print("Suspended service");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.NO_AGENT)
 {
     out.print("No agent");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.FAILOVER)
 {
     out.print("Failover");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.ERROR)
 {
     out.print("Error");
 }
 else if (resps.getResponseCode() == IntegrationServiceResponseCode.SUCCESSFUL)
 {
     out.print("Success");
 }
 Object result = resps.getResponse();
 

Since:
3.2.1
Author:
cgulliver

Nested Class Summary
static class IntegrationServiceResponse.IntegrationServiceResponseCode
           
 
Constructor Summary
IntegrationServiceResponse(IntegrationServiceResponse.IntegrationServiceResponseCode responseCode)
           
IntegrationServiceResponse(java.lang.Object response, IntegrationServiceResponse.IntegrationServiceResponseCode responseCode)
           
 
Method Summary
 java.lang.Object getResponse()
          Get the external service response provided from the integration agent.
 IntegrationServiceResponse.IntegrationServiceResponseCode getResponseCode()
          Get the external service response code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegrationServiceResponse

public IntegrationServiceResponse(java.lang.Object response,
                                  IntegrationServiceResponse.IntegrationServiceResponseCode responseCode)

IntegrationServiceResponse

public IntegrationServiceResponse(IntegrationServiceResponse.IntegrationServiceResponseCode responseCode)
Method Detail

getResponseCode

public IntegrationServiceResponse.IntegrationServiceResponseCode getResponseCode()
Get the external service response code. It can be one of

Returns:
response code

getResponse

public java.lang.Object getResponse()
Get the external service response provided from the integration agent.

Returns:
object from the external inetgration agent