public interface Mediation
However, functions dependent on libraries that are not shipped with the main distribution may still be available with the UltraESB as additional beans (e.g. XQuerySupport)
Modifier and Type | Method and Description |
---|---|
MessageFile |
acquireTempMessageFile(Message message)
Acquires a
MessageFile from the default file cache, to be used for message processing needs. |
void |
callTemplate(Message msg,
java.lang.String templateInstance)
Calls the specified template instance for the given message
|
void |
callTemplateAsynchronously(Message msg,
java.lang.String templateInstance)
Calls the specified template instance asynchronously for the given message
|
void |
callTemplates(Message msg,
java.util.List templateInstances)
Calls the specified list of template instances for the given message in-order, unless any of the templates drops
the message, in which case the message flow will completely be abandoned
|
void |
dropMessage(Message m)
Mark this message as a 'Dropped' message.
|
AlertSupport |
getAlertSupport()
Access the alert support API for mediation
|
AS2Manager |
getAS2Manager()
Get the AS2Manager from the bean with the id "as2Manager"
|
AS2Manager |
getAS2Manager(java.lang.String name)
Get the AS2Manager by the given name
|
AuditSupport |
getAuditSupport()
Access the auditing API, for persisted auditing
|
AuditSupport |
getAuditSupport(java.lang.String dataSource)
Access the auditing API, for persisted auditing backed by the given data source bean id
|
CachingSupport |
getCachingSupport()
Access Caching support API
|
ClusterSupport |
getClusterSupport()
Access the cluster support API for mediation
|
java.sql.Connection |
getConnection(java.lang.String dataSource)
Get a database connection from the datasource defined in the [Spring] configuration with the given id
|
javax.sql.DataSource |
getDataSource(java.lang.String dataSource)
Get the DataSource with the specified id from the [Spring] configuration
|
DateSupport |
getDateSupport()
Access Date support API
|
java.lang.String |
getDefaultPlatformTM()
Get the ID of the only PlatformTransactionManager defined into the configuration
Only supported when only one transaction manager is defined
|
EmailSupport |
getEmailSupport()
Access the Email support API
|
FastInfosetSupport |
getFastInfosetSupport()
Access FastInfoset support API
|
FileSupport |
getFileSupport()
Access the File support API
|
FIXSupport |
getFIXSupport()
Access FIX support API
|
HL7Support |
getHL7Support()
Access the HL7 mediation utilities
|
HTTPSupport |
getHTTPSupport()
Access HTTP support API
|
JAXBSupport |
getJAXBSupport()
Access JAXB support API
|
JMSSupport |
getJMSSupport()
Access the JMS support API
|
JSONSupport |
getJSONSupport()
Access JSON support API
|
LogSupport |
getLogSupport()
Access the log support API for mediation
|
MetricsSupport |
getMetricsSupport()
Access the Metrics API, for custom metrics collection and alerting
|
ProtocolBufferSupport |
getProtocolBufferSupport()
Access Protocol Buffer support API
|
SOAPSupport |
getSOAPSupport()
Access SOAP support API
|
java.lang.Object |
getSpringBean(java.lang.String id)
Get the Spring bean with the given ID from the [Spring] configuration
|
java.lang.Object |
getSpringBean(java.lang.String id,
java.lang.Class clazz)
Get the Spring bean with the given ID from the [Spring] configuration
|
java.lang.Object |
getSupport(java.lang.Class clazz)
Gets the defined support interface instance
|
SwiftSupport |
getSwiftSupport()
Access the Swift message parsing and validation service
|
ThrottleSupport |
getThrottleSupport(java.lang.String id)
Gives the implementation of the
ThrottleSupport defined in the UltraESB
configuration with the given bean identifier. |
WSSecurityManager |
getWSSecurityManager()
Get the WS-Security Manager defined with the id "wssecMgr"
|
XACMLSupport |
getXACMLSupport()
Access XACML support API
|
XMLSupport |
getXMLSupport()
Access DOM support API
|
void |
invokeSequence(Message msg,
java.lang.String sequenceName)
Invoke another sequence from within a sequence
|
void |
invokeSequenceAsynchronously(Message msg,
java.lang.String sequenceName)
Invoke another sequence asynchronously
Use caution, especially about async resource clearing, and concurrent execution
|
void |
invokeSequences(Message msg,
java.util.List sequenceIDs)
Invoke a list of named sequences from within a parent sequence.
|
void |
invokeService(Message msg,
java.lang.String proxyService)
Invokes the specified service with the given message asynchronously, if the specified service responds to this
request message the response will be sent to the outSequence of the calling proxy service
|
java.lang.String |
readFullPayloadAsString(Message m)
Return the complete current message payload as a String
NOTE: Serializing large messages into Strings can have a Memory, Performance and GC impact
|
byte[] |
readPayloadAsByteArray(Message m)
Return the current message payload as a byte[] limited to 100K
|
java.util.Map |
readPayloadAsMap(Message m)
Return the current message payload as a Map where possible
|
java.lang.String |
readPayloadAsString(Message m)
Return the current message payload as a String limited to 8K
|
java.lang.Object |
readPayloadAsTypedObject(Message m,
java.lang.Class type)
Reads the current message payload as a Java Object of the given type
|
org.w3c.dom.Document |
readPayloadAsXMLDocument(Message m)
Return the current message payload as a XML Document where possible, else throw an IllegalArgumentException
|
java.io.InputStream |
readResource(java.lang.String path)
Reads a resource as an
InputStream from the specified path. |
java.io.File |
resolveResource(java.lang.String path)
Resolves a file for the given relative path, first looking for the deployment unit resources relative path, then
from the system configuration resources relative path, and finally from the system configuration root relative
path
|
void |
savePayloadToFile(Message m,
java.lang.String filePath)
Save the current message payload into the specified file
|
void |
sendPart(Message msg,
int code,
int part,
int size)
Send the current payload as one single part of the complete payload.
|
void |
sendResponse(Message msg,
int code)
Trigger off sending the current payload as a synchronous response message for the currently processing message
If the response for the message has already been submitted, any duplicates calls are silently ignored
|
void |
sendResponseAndDrop(Message m,
int code)
Trigger off sending the current payload as a synchronous response message for the currently processing message,
and stop processing this message thereafter.
|
void |
sendToEndpoint(Message m,
java.lang.String endpointName)
Send the current message to the endpoint with the given name.
|
void |
setPayloadFromByteArray(Message m,
byte[] bytes)
Set the payload of the current message to the byte array passed
|
void |
setPayloadFromDataHandler(Message m,
javax.activation.DataHandler dh)
Set the payload of the current message to the DataHandler passed in
|
void |
setPayloadFromFile(Message m,
java.lang.String filePath)
Set the current payload of the message as the content of the given file
|
void |
setPayloadFromMap(Message m,
java.util.Map map)
Set the payload of the current message to the Map passed in
|
void |
setPayloadFromObject(Message m,
java.lang.Object obj)
Set the payload of the current message to the Java Object passed in
|
void |
setPayloadFromString(Message m,
java.lang.String text)
Set the payload of the current message to the given String
|
void |
setPayloadFromXMLDocument(Message m,
org.w3c.dom.Document doc)
Set the payload of the current message to the XML Document passed in
|
java.sql.Connection getConnection(java.lang.String dataSource)
dataSource
- the datasource id in the Spring configurationjavax.sql.DataSource getDataSource(java.lang.String dataSource)
dataSource
- the data source idjava.lang.String readPayloadAsString(Message m)
m
- the current messagejava.lang.String readFullPayloadAsString(Message m) throws java.io.IOException
m
- the current messagejava.io.IOException
java.util.Map readPayloadAsMap(Message m)
m
- the current messagebyte[] readPayloadAsByteArray(Message m)
m
- the current messageorg.w3c.dom.Document readPayloadAsXMLDocument(Message m)
m
- the current messagejava.lang.Object readPayloadAsTypedObject(Message m, java.lang.Class type)
m
- the message from which the payload is extractedtype
- the class of the object typevoid setPayloadFromString(Message m, java.lang.String text)
m
- the current messagetext
- the text to which the payload should be setvoid setPayloadFromByteArray(Message m, byte[] bytes)
m
- the current messagebytes
- the byte array to set as the current payloadvoid setPayloadFromMap(Message m, java.util.Map map)
m
- the current messagemap
- the Map to be set as the current payloadvoid setPayloadFromXMLDocument(Message m, org.w3c.dom.Document doc)
m
- the current messagedoc
- the XML Document to be set as the current payloadvoid setPayloadFromObject(Message m, java.lang.Object obj)
m
- the current messageobj
- the Java Object to be set as the current payloadvoid setPayloadFromDataHandler(Message m, javax.activation.DataHandler dh)
m
- the current messagedh
- the DataHandler to be set as the current payloadvoid setPayloadFromFile(Message m, java.lang.String filePath)
m
- current messagefilePath
- the path for the file to loadvoid savePayloadToFile(Message m, java.lang.String filePath) throws java.io.IOException
m
- current messagefilePath
- file path to save tojava.io.IOException
- on IO exceptionsvoid sendResponse(Message msg, int code)
msg
- the message to be sent as the responsecode
- an optional transport level status code to set (e.g. SOAP faults usually are sent with an HTTP 500
error, but sometimes may be expected as a HTTP 200 response)void sendPart(Message msg, int code, int part, int size)
msg
- the current message to be sent as a part of the response. If this is the first part, this message
dictates the headers etc for the responsecode
- the response code to usepart
- the part number as "part i of n" ; with i = 1 for first and i = size for lastsize
- the total parts for the final messagevoid sendResponseAndDrop(Message m, int code)
m
- the message to be sent as the responsecode
- an optional transport level status code to set. (e.g. SOAP faults usually are sent with an HTTP 500
error, but sometimes may be expected as a HTTP 200 response)void dropMessage(Message m)
m
- the message to be marked as a dropped messagevoid sendToEndpoint(Message m, java.lang.String endpointName)
m
- the current nameendpointName
- the name of the endpoint to sendvoid invokeSequence(Message msg, java.lang.String sequenceName) throws java.lang.Exception
msg
- the current message to be passed to the invoked sequencesequenceName
- the name of the invoked sequencejava.lang.Exception
- if the sequence logic raises an exceptionvoid invokeSequenceAsynchronously(Message msg, java.lang.String sequenceName)
msg
- the current message to be passed to the invoked sequencesequenceName
- the name of the invoked sequencevoid invokeService(Message msg, java.lang.String proxyService)
msg
- the message to be used for invoking the serviceproxyService
- the proxy service that is invoked over the VM transportvoid invokeSequences(Message msg, java.util.List sequenceIDs) throws java.lang.Exception
msg
- the current message to be passed to the invoked sequencessequenceIDs
- the names of the invoked sequencesjava.lang.Exception
- if any sub-sequence logic raises an exceptionvoid callTemplate(Message msg, java.lang.String templateInstance) throws java.lang.Exception
msg
- the message being executed by the templatetemplateInstance
- the identifier of the template instancejava.lang.Exception
- in an error in calling the specified templatevoid callTemplates(Message msg, java.util.List templateInstances) throws java.lang.Exception
msg
- the message being executed by the templatetemplateInstances
- the list of template instance identifiers to be calledjava.lang.Exception
- in an error in calling the specified templatevoid callTemplateAsynchronously(Message msg, java.lang.String templateInstance) throws java.lang.Exception
msg
- the message being executed by the templatetemplateInstance
- the identifier of the template instancejava.lang.Exception
- in an error in calling the specified templatejava.lang.Object getSpringBean(java.lang.String id)
id
- the ID of the Spring bean to returnjava.lang.Object getSpringBean(java.lang.String id, java.lang.Class clazz)
id
- the ID of the Spring bean to returnclazz
- the class of the bean requestedMessageFile acquireTempMessageFile(Message message)
MessageFile
from the default file cache, to be used for message processing needs. For example
if you need a fast temp file, you may acquire a message file from the file cache pool. The lifetime of the file
is equivalent to the lifecycle of the message passed in.message
- the message to which the retrieved file is attached tojava.lang.String getDefaultPlatformTM()
java.io.InputStream readResource(java.lang.String path) throws java.io.IOException
InputStream
from the specified path. This method resolves the file by calling
Mediation.resolveResource(String)
which first uses the current execution contexts deployment unit relative path,
the the system root resources path, and finally the system working directory relative pathpath
- the path to be read as an InputStream
java.io.IOException
- if the file cannot be resolvedjava.io.File resolveResource(java.lang.String path) throws java.io.IOException
path
- the path to be resolved.java.io.IOException
- if the specified relative file cannot be locatedAS2Manager getAS2Manager()
AS2Manager getAS2Manager(java.lang.String name)
WSSecurityManager getWSSecurityManager()
ThrottleSupport getThrottleSupport(java.lang.String id) throws BusRuntimeException
ThrottleSupport
defined in the UltraESB
configuration with the given bean identifier.
Usage of this ThrottleSupport
is to provide the mediation logic development to
use the throttling functionality as a condition.
For example if the throttling configuration is defined with myThrottleConfig
the
relevant mediation logic would be;
if (mediation.getThrottleSupport("myThrottleConfig").isAllowed()) {
... throttle success ...
} else {
... throttle hit failure ...
}
id
- bean identifier of the throttle implementationBusRuntimeException
- if the specified bean id is not referring to a ThrottleSupportXMLSupport getXMLSupport()
SOAPSupport getSOAPSupport()
FastInfosetSupport getFastInfosetSupport()
JSONSupport getJSONSupport()
CachingSupport getCachingSupport()
ClusterSupport getClusterSupport()
LogSupport getLogSupport()
AlertSupport getAlertSupport()
DateSupport getDateSupport()
HTTPSupport getHTTPSupport()
JMSSupport getJMSSupport()
FileSupport getFileSupport()
EmailSupport getEmailSupport()
XACMLSupport getXACMLSupport()
JAXBSupport getJAXBSupport()
ProtocolBufferSupport getProtocolBufferSupport()
AuditSupport getAuditSupport()
AuditSupport getAuditSupport(java.lang.String dataSource)
dataSource
- the spring bean id defining a data-sourceMetricsSupport getMetricsSupport()
HL7Support getHL7Support()
SwiftSupport getSwiftSupport()
FIXSupport getFIXSupport()
java.lang.Object getSupport(java.lang.Class clazz)
clazz
- the class of the support interface