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,
String templateInstance)
Calls the specified template instance for the given message
|
void |
callTemplateAsynchronously(Message msg,
String templateInstance)
Calls the specified template instance asynchronously for the given message
|
void |
callTemplates(Message msg,
List<String> 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(String name)
Get the AS2Manager by the given name
|
AuditSupport |
getAuditSupport()
Access the auditing API, for persisted auditing
|
AuditSupport |
getAuditSupport(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
|
Connection |
getConnection(String dataSource)
Get a database connection from the datasource defined in the [Spring] configuration with the given id
|
DataSource |
getDataSource(String dataSource)
Get the DataSource with the specified id from the [Spring] configuration
|
DateSupport |
getDateSupport()
Access Date support API
|
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
|
MappingSupport |
getMappingSupport()
Access data-mapping features to transform message payload
|
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
|
Object |
getSpringBean(String id)
Get the Spring bean with the given ID from the [Spring] configuration
|
<T> T |
getSpringBean(String id,
Class<? extends T> clazz)
Get the Spring bean with the given ID from the [Spring] configuration
|
<T> T |
getSpringBean(String id,
Class<? extends T> clazz,
Message msg)
Get the Spring bean with the given ID from the [Spring] configuration
|
<T> T |
getSupport(Class<T> clazz)
Gets the defined support interface instance
|
SwiftSupport |
getSwiftSupport()
Access the Swift message parsing and validation service
|
ThrottleSupport |
getThrottleSupport(String id)
Gives the implementation of the
ThrottleSupport defined in the UltraESB
configuration with the given bean identifier. |
WebSocketSupport |
getWebSocketSupport()
Access WebSocket related supports
|
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,
String sequenceName)
Invoke another sequence from within a sequence
|
Future<Boolean> |
invokeSequenceAsynchronously(Message msg,
String sequenceName)
Invoke another sequence asynchronously and returns a
Future
object with boolean type
Use caution, especially about async resource clearing, and concurrent execution |
void |
invokeSequences(Message msg,
List<String> sequenceIDs)
Invoke a list of named sequences from within a parent sequence.
|
Future<Boolean> |
invokeService(Message msg,
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
|
Future<Boolean> |
invokeService(Message msg,
String proxyService,
boolean propagateTransaction)
Invokes the specified service with the given message asynchronously, optionally propagating the transactional
context currently active; if the specified service responds to this request message the response will be sent
to the outSequence of the calling proxy service
Note: This is an advanced API method, and should be used carefully.
|
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
|
Map |
readPayloadAsMap(Message m)
Return the current message payload as a Map where possible
|
String |
readPayloadAsString(Message m)
Return the current message payload as a String limited to 8K
|
<T> T |
readPayloadAsTypedObject(Message m,
Class<T> type)
Reads the current message payload as a Java Object of the given type
|
Document |
readPayloadAsXMLDocument(Message m)
Return the current message payload as a XML Document where possible, else throw an IllegalArgumentException
|
InputStream |
readResource(String path)
Reads a resource as an
InputStream from the specified path. |
ResourceWrapper |
readResourceWithPath(String path)
Reads a resource as an
ResourceWrapper from the specified path. |
MessageFile |
resetPayloadToNewMessageFile(Message message)
Acquires a
MessageFile from the default file cache and set it as the current payload of the given message. |
File |
resolveResource(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,
String filePath)
Save the current message payload into the specified file
|
Message |
sendAndReceiveResponse(Message msg,
String endpointName,
Message responseMsg)
Send the message - msg to the given endpoint to and populate the response data to the response message - responseMsg
|
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,
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,
DataHandler dh)
Set the payload of the current message to the DataHandler passed in
|
void |
setPayloadFromFile(Message m,
String filePath)
Set the current payload of the message as the content of the given file
|
<K,V> void |
setPayloadFromMap(Message m,
Map<K,V> map)
Set the payload of the current message to the Map passed in
|
void |
setPayloadFromObject(Message m,
Object obj)
Set the payload of the current message to the Java Object passed in
|
void |
setPayloadFromString(Message m,
String text)
Set the payload of the current message to the given String
|
void |
setPayloadFromXMLDocument(Message m,
Document doc)
Set the payload of the current message to the XML Document passed in
|
Connection getConnection(String dataSource)
dataSource
- the datasource id in the Spring configurationDataSource getDataSource(String dataSource)
dataSource
- the data source idString readPayloadAsString(Message m)
m
- the current messageString readFullPayloadAsString(Message m) throws IOException
m
- the current messageIOException
Map readPayloadAsMap(Message m)
m
- the current messagebyte[] readPayloadAsByteArray(Message m)
m
- the current messageDocument readPayloadAsXMLDocument(Message m)
m
- the current message<T> T readPayloadAsTypedObject(Message m, Class<T> type)
T
- the expected typem
- the message from which the payload is extractedtype
- the class of the object typevoid setPayloadFromString(Message m, 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 payload<K,V> void setPayloadFromMap(Message m, Map<K,V> map)
m
- the current messagemap
- the Map to be set as the current payloadvoid setPayloadFromXMLDocument(Message m, Document doc)
m
- the current messagedoc
- the XML Document to be set as the current payloadvoid setPayloadFromObject(Message m, Object obj)
m
- the current messageobj
- the Java Object to be set as the current payloadvoid setPayloadFromDataHandler(Message m, DataHandler dh)
m
- the current messagedh
- the DataHandler to be set as the current payloadvoid setPayloadFromFile(Message m, String filePath)
m
- current messagefilePath
- the path for the file to loadvoid savePayloadToFile(Message m, String filePath) throws IOException
m
- current messagefilePath
- file path to save toIOException
- 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 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 messageMessage sendAndReceiveResponse(Message msg, String endpointName, Message responseMsg)
msg
- the message to send to the given endpointendpointName
- the name of the endpoint to send the messageresponseMsg
- the response message to populate the response data - response content, response status etc.void sendToEndpoint(Message m, String endpointName)
m
- the current nameendpointName
- the name of the endpoint to sendvoid invokeSequence(Message msg, String sequenceName) throws Exception
msg
- the current message to be passed to the invoked sequencesequenceName
- the name of the invoked sequenceException
- if the sequence logic raises an exceptionFuture<Boolean> invokeSequenceAsynchronously(Message msg, String sequenceName)
Future
object with boolean type
Use caution, especially about async resource clearing, and concurrent executionmsg
- the current message to be passed to the invoked sequencesequenceName
- the name of the invoked sequenceFuture
object with boolean value represents the state of
the sequence executionFuture<Boolean> invokeService(Message msg, String proxyService, boolean propagateTransaction)
msg
- the message to be used for invoking the serviceproxyService
- the proxy service that is invoked over the VM transportpropagateTransaction
- propagate the current transactional context if trueFuture<Boolean> invokeService(Message msg, 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, List<String> sequenceIDs) throws Exception
msg
- the current message to be passed to the invoked sequencessequenceIDs
- the names of the invoked sequencesException
- if any sub-sequence logic raises an exceptionvoid callTemplate(Message msg, String templateInstance) throws Exception
msg
- the message being executed by the templatetemplateInstance
- the identifier of the template instanceException
- in an error in calling the specified templatevoid callTemplates(Message msg, List<String> templateInstances) throws Exception
msg
- the message being executed by the templatetemplateInstances
- the list of template instance identifiers to be calledException
- in an error in calling the specified templatevoid callTemplateAsynchronously(Message msg, String templateInstance) throws Exception
msg
- the message being executed by the templatetemplateInstance
- the identifier of the template instanceException
- in an error in calling the specified templateObject getSpringBean(String id)
id
- the ID of the Spring bean to return<T> T getSpringBean(String id, Class<? extends T> clazz)
id
- the ID of the Spring bean to returnclazz
- the class of the bean requested<T> T getSpringBean(String id, Class<? extends T> clazz, Message msg)
id
- the ID of the Spring bean to returnclazz
- the class of the bean requestedmsg
- the message to consider as the current message to get the spring beanMessageFile 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 toMessageFile resetPayloadToNewMessageFile(Message message)
MessageFile
from the default file cache and set it as the current payload of the given message.
This gives you the ability to reset the current payload and assign a new file from the file cache to message
passed in.message
- the message to which the new MessageFile is attached toString getDefaultPlatformTM()
InputStream readResource(String path) throws IOException
InputStream
from the specified path. This method resolves the resource of
the given path which first uses the current execution contexts deployment unit resources relative path, resources
within the jar files of the current execution context's deployment unit, the the system root resources relative
path, the system libraries resources within the jar files and finally the system working directory relative pathpath
- the path to be read as an InputStream
IOException
- if the file cannot be resolvedResourceWrapper readResourceWithPath(String path) throws IOException
ResourceWrapper
from the specified path. This
method resolves the resource of the given path which first uses the current execution context's deployment unit
resources relative path, resources within the jar files of the current execution context's deployment unit, then
the system root resources relative path, and the system libraries resources within the jar files and finally the
system working directory relative pathpath
- the path to be read as a ResourceWrapper
IOException
- if the resource cannot be resolvedFile resolveResource(String path) throws IOException
readResource(String)
alternative to read resource from jar files as wellpath
- the path to be resolved.IOException
- if the specified relative file cannot be locatedAS2Manager getAS2Manager()
AS2Manager getAS2Manager(String name)
WSSecurityManager getWSSecurityManager()
ThrottleSupport getThrottleSupport(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(String dataSource)
dataSource
- the spring bean id defining a data-sourceMetricsSupport getMetricsSupport()
HL7Support getHL7Support()
SwiftSupport getSwiftSupport()
FIXSupport getFIXSupport()
WebSocketSupport getWebSocketSupport()
MappingSupport getMappingSupport()
<T> T getSupport(Class<T> clazz)
T
- the type of the support interfaceclazz
- the class of the support interfaceCopyright © 2010–2016 AdroitLogic. All rights reserved.