|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServiceAPI
This interface represents the Integration Service functions that are exposed to an Integration Service's script.
NOTE: By convention, implementors of this interface must be thread-safe.
Field Summary | |
---|---|
static java.lang.String |
NAME
This is the name of the global variable in each Integration Service's script that is assigned an instance of this interface. |
Method Summary | |
---|---|
APXMLMessage |
createAPXML()
Creates an new APXML message that the caller can populate. |
IntegrationServiceRequest |
createIntegrationServiceRequest()
Creates an object that can be used to make an Integration Service Request to either a local (i.e., hosted on the same Integration Agent), or external Integration Service. |
Logger |
getLogger()
Gets a logger that will write to the APIA log file in the same log4j category and format as the Integration Service. |
void |
sendAPXML(APXMLMessage apxml)
Adds the specified APXML message to the end of the Integration Service's outbound queue. |
void |
sendAPXML(APXMLMessage apxml,
java.lang.String domain,
java.lang.String serviceName)
Adds the specified APXML message to the end of the specified service's inbound queue. |
Field Detail |
---|
static final java.lang.String NAME
Method Detail |
---|
Logger getLogger()
For example, if the Integration Service is (default,sample), the logger will write to the category com.alarmpoint.integrationagents.services.default.sample).
APXMLMessage createAPXML()
void sendAPXML(APXMLMessage apxml) throws java.lang.Exception
apxml
- - the outbound APXML message; must be non-null
java.lang.Exception
- if the message cannot be queuedvoid sendAPXML(APXMLMessage apxml, java.lang.String domain, java.lang.String serviceName) throws java.lang.Exception
Below is a sample usage of this method to send an APXML to the local ping|ping service.
var apxml = ServiceAPI.createAPXML(); apxml.setMethod("add"); apxml.setSubclass("event"); apxml.setToken("recipients","bsmith"); apxml.setToken("situation","Redirected ping from sample."); apxml.setToken("device","localhost"); apxml.setToken("incident_id","Redirected-localhost-ping-test"); ServiceAPI.sendAPXML(apxml, "ping", "ping");
apxml
- - the inbound APXML message; must be non-nulldomain
- - the domain of the targeted serviceserviceName
- - the service name to queue the message
java.lang.Exception
- if the message cannot be queuedIntegrationServiceRequest createIntegrationServiceRequest()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |