com.alarmpoint.integration.infrastructure.agent.service.tag
Class IntegrationAgentServiceTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.alarmpoint.integration.infrastructure.agent.service.tag.IntegrationAgentServiceTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
IntegrationAgentServiceFilteredTag

public class IntegrationAgentServiceTag
extends javax.servlet.jsp.tagext.TagSupport

A JSP custom tag to make an external service request to the integration agent To declare the tag library use the JSP taglib directive.

 <%@ taglib uri="http://alarmpoint.com/alarmpoint/4.0#integrationagentservice" prefix="apia" %>
 
Tag Reference: request
AttributeDescription
actionAn action provided by the integration service.
serviceThe integration service that will perform the action provided by an integration agent.
domainThe Event Domain associated with the integration service.
companyThe Company Name associated with the integration service. Defaults to Default Company
Tag Reference: argument
AttributeDescription
namename of the parameter
typethe data type associated with the parameter
Sample request:
 <apia:request action="echo" service="test_service_1" domain="default" company="Default Company">
   <apia:argument name="String" type="string">This is a string.</apia:argument>
   <apia:argument name="Integer" type="integer">100</apia:argument>
   <apia:argument name="Float" type="float">11.11</apia:argument>
   <apia:argument name="Boolean" type="boolean">true</apia:argument>
 </apia:request>
 

Since:
4.0
Author:
Mike Bennett
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
IntegrationAgentServiceTag()
          Creates a new instance of SubscriptionIntegrationServiceTag
 
Method Summary
protected  java.lang.String convertProperty(java.lang.String propertyName)
          Converts first character of property to UpperCase
 int doEndTag()
          Using the tag data, pass the information to the Integration Agent and process the response
 int doStartTag()
          Start processing the tag
 java.util.Map<java.lang.String,java.lang.Object> getArguments()
          Retrieve a map of names and values to be provided as parameters to the integration service as part of the action.
protected  java.lang.Object getValue(java.lang.Object obj, java.lang.String propertyName)
          Reflective call to retrieve the values from the object stored in the returned list
 void setAction(java.lang.String action)
          An action provided by the integration service.
 void setArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)
          Set a map of names and values to be provided as parameters to the integration service as part of the action.
 void setCompany(java.lang.String company)
          The Company Name associated with the integration service.
 void setDomain(java.lang.String domain)
          The Event Domain associated with the integration service.
 void setService(java.lang.String service)
          The integration service that will perform the action provided by an integration agent.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegrationAgentServiceTag

public IntegrationAgentServiceTag()
Creates a new instance of SubscriptionIntegrationServiceTag

Method Detail

doStartTag

public int doStartTag()
Start processing the tag

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
int indicating the body of the tag (argument list) should be processed

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspTagException
Using the tag data, pass the information to the Integration Agent and process the response

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
int indicating the remainder of the page should be processed
Throws:
javax.servlet.jsp.JspTagException - if there are any issue processing the request

getValue

protected java.lang.Object getValue(java.lang.Object obj,
                                    java.lang.String propertyName)
                             throws javax.servlet.jsp.JspTagException
Reflective call to retrieve the values from the object stored in the returned list

Parameters:
obj - instance of the object to query
propertyName - name of the property to retrieve
Returns:
Object containing the requested value
Throws:
javax.servlet.jsp.JspTagException

convertProperty

protected java.lang.String convertProperty(java.lang.String propertyName)
Converts first character of property to UpperCase

Parameters:
propertyName - name of the property
Returns:
String property name with first character upper case

setAction

public void setAction(java.lang.String action)
An action provided by the integration service.

Parameters:
action - String identifying the name of the method to call in the IA script

setService

public void setService(java.lang.String service)
The integration service that will perform the action provided by an integration agent.

Parameters:
service - integration service

setDomain

public void setDomain(java.lang.String domain)
The Event Domain associated with the integration service.

Parameters:
domain - event domain

setCompany

public void setCompany(java.lang.String company)
The Company Name associated with the integration service.

Parameters:
company - company name

setArguments

public void setArguments(java.util.Map<java.lang.String,java.lang.Object> arguments)
Set a map of names and values to be provided as parameters to the integration service as part of the action.

Parameters:
arguments - map of names and values

getArguments

public java.util.Map<java.lang.String,java.lang.Object> getArguments()
Retrieve a map of names and values to be provided as parameters to the integration service as part of the action.

Returns:
map of names and values