|
Sonic ESB API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJavaScript.HelperFunctions
public abstract class HelperFunctions
IMPORTANT:
The methods documented in this class do NOT correspond to Java classes.
This file contains a description of the standard variables and helper functions available to SonicESB programmers who use the default JavaScript rules interpretter. This interpretter is standard with Content-based Routing, or XSLT Transformation Services. It can also be used to generate TrackingID's for SonicESB Processes.
The variables and functions described below are ONLY available in the context
of the JavaScript interpretter where the default file:
sonicfs:///System/SonicESB/7.0/Common/jsHelperFunctions.js
is used. You can examine the contents of this file though the Resources branch
of the SonicESB Domain in the Sonic Explorer tool.
The descriptions below are done using Javadoc and act as if the JavaScript functions were actual Java classes. This is done as a convenience to the programmer, but you must remember that, in reality, these are really JavaScript functions.
Practically speaking, this means two things:
Field Summary | |
---|---|
XQMessage |
XQMessage
The Javascript engine provides access to the current message as variable XQMessage . |
XQServiceContext |
XQServiceContext
The Javascript engine provides access to the current service context as variable XQServiceContext . |
Constructor Summary | |
---|---|
HelperFunctions()
|
Method Summary | |
---|---|
abstract XQAddress |
XQ_getEndpoint(java.lang.String endpointName)
Returns an single Address object of type "ENDPOINT". |
abstract XQAddress |
XQ_getFaultAddress()
Returns an single Address object correspoding to the Fault address of the service or process. |
abstract XQAddress |
XQ_getProcess(java.lang.String processName)
Returns an single Address object of type "PROCESS". |
abstract java.lang.Object |
XQ_getProperty(java.lang.String propertyName,
int msgPartIndex)
Function XQ_getProperty(propertyName) returns the value of the specified propertyName from the XQMessage or XQPart header. |
abstract XQAddress |
XQ_getReplyToAddress()
Returns an single Address object correspoding to the REPLY_TO address of the service or process. |
abstract XQAddress |
XQ_getService(java.lang.String serviceName)
Returns an single Address object of type "SERVICE". |
abstract XQAddress |
XQ_getStepAddress(java.lang.String stepName)
Returns the address corresponding to the step name, in the currently executing process. |
abstract java.lang.String |
XQ_getStringParameter(java.lang.String parameterName)
Function XQ_getStringParameter(parameterName) returns the value of the specified parameterName from the XQServiceParameters associated with the
current XQServiceContext . |
abstract java.lang.Object |
XQ_getXPath(java.lang.String xpathExpression,
int msgPartIndex,
java.lang.String namespaceString)
Function XQ_getXPath(xpathExpression) returns the value of the specified XPath expression from the XQMessage's content. |
abstract boolean |
XQ_isLGSwitchTrue(java.lang.String switchName)
Returns the status of the stabilizer switch. |
abstract void |
XQ_logError(java.lang.String error)
Sends the string to the XQServiceContext's XQLog as an Error. |
abstract void |
XQ_logInformation(java.lang.String info)
Sends the string to the XQServiceContext's XQLog as an information message. |
abstract void |
XQ_logWarning(java.lang.String warning)
Sends the string to the XQServiceContext's XQLog as a warning. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public XQMessage XQMessage
XQMessage
. This is the first incoming message to the
XQService where the JavaScript interpretter is running.
public XQServiceContext XQServiceContext
XQServiceContext
.
Constructor Detail |
---|
public HelperFunctions()
Method Detail |
---|
public abstract java.lang.Object XQ_getProperty(java.lang.String propertyName, int msgPartIndex)
propertyName
- is the name of the header field whose value is to be retrieved.msgPartIndex
- can be omitted if you want to access the header fields of the XQMessage.
Otherwise use 0..n for part headers (-1 will access the XQMessage headerfields.
public abstract java.lang.Object XQ_getXPath(java.lang.String xpathExpression, int msgPartIndex, java.lang.String namespaceString)
The evaluation of xpathExpression returns:
java.lang.Object
:public Object enumerate() throws java.lang.Exception
:public int getCount() throws java.lang.Exception
:public Object getFirst() throws java.lang.Exception
:For more information on XPath see:
xpathExpression
- is the XPath expression which is to be resolved.msgPartIndex
- can be omitted if you want to access the first part of the message.
Otherwise use 0..n for part.namespaceString
- is a namespace mapping to be used by the xpathExpression. Only one
namespace prefix is supported (e.g. SOAP-ENV=http://www.w3.org/2001/06/soap-envelope
).
public abstract java.lang.String XQ_getStringParameter(java.lang.String parameterName)
XQServiceParameters
associated with the
current XQServiceContext
. This function is expected to be used
primarily to get runtime parameters, such as the service name or container name
that are passed into every service (see com.sonicsw.xq.XQConstants
for a list of the standard parameter names.)
parameterName
- is the name of the parameter whose String value is to be retrieved.
XQConstants
public abstract XQAddress XQ_getEndpoint(java.lang.String endpointName)
java.lang.Exception
- thrown if no Endpoint is defined with this name.public abstract XQAddress XQ_getService(java.lang.String serviceName)
java.lang.Exception
- thrown if no Service is defined with this name.public abstract XQAddress XQ_getProcess(java.lang.String processName)
java.lang.Exception
- thrown if no Process is defined with this name.public abstract XQAddress XQ_getReplyToAddress()
public abstract XQAddress XQ_getFaultAddress()
public abstract void XQ_logWarning(java.lang.String warning)
warning
- The text of the warning message.public abstract void XQ_logError(java.lang.String error)
error
- The text of the error message.public abstract void XQ_logInformation(java.lang.String info)
info
- The text of the message.public abstract XQAddress XQ_getStepAddress(java.lang.String stepName)
stepName
- String containing the name of a step within a process.
It should not contain the ":" character.
XQAddressNotFoundException
java.lang.Exception
public abstract boolean XQ_isLGSwitchTrue(java.lang.String switchName)
Returns the status of the stabilizer switch.
This method could also return false if LG is not enabled for the container.
switchName
- The name of the stabilizer switch
|
Sonic ESB API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |