public interface EdnConnection extends BusinessEventConnection
It supports event publishing options:
* It supports different event subscription options:
Modifier and Type | Method and Description |
---|---|
ConsistencyLevel |
getConsistencyLevel()
Get the default ConsistencyLevel of event subscription.
|
String |
getEDL()
Get the default EDL URI with "oramds" referencing EDL content for event publishing.
|
BusinessEventHandler |
getEventHandler()
Get the default BusinessEvent Handler to consume subscribed events.
|
int |
getPriority()
Get the default message priority of event publishing.
|
long |
getTimeout()
Get the default timeout value (in milliseconds) to receive an event by the subscriber.
|
long |
getTimeToLive()
Get the default time to live (length of time in milliseconds from its dispatch time that a published message should be retained by the system) of event publishing.
|
XPathFilter |
getXPathFilter()
Get the default XPath Filter to limited subscribed events.
|
boolean |
isPersistent()
Return the default persistent delivery mode of event publishing.
|
boolean |
isRunAsPublisher()
Return the default runAs Publisher flag for event consumption.
|
void |
publishEvent(BusinessEvent event)
Publish an event with default persistent, priority, time to live, and EDL as input source.
|
void |
publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI)
Publish an event with specified delivery mode, priority, time to live, and EDL URI.
|
void |
setConsistencyLevel(ConsistencyLevel qos)
Set the default ConsistencyLevel of event subscription.
|
void |
setEDL(String edlURI)
Set the default EDL URI with "oramds" referencing EDL content for event publishing.
|
void |
setEventHandler(BusinessEventHandler handler)
Set the default BusinessEvent Handler to consume subscribed events.
|
void |
setPersistent(boolean persistent)
Set the default persistent delivery mode of event publishing.
|
void |
setPriority(int defaultPriority)
Set the default message priority of event publishing.
|
void |
setRunAsPublisher(boolean asPublisher)
Set the default runAs Publisher flag for event consumption.
|
void |
setTimeout(long timeout)
Set the default timeout value (in milliseconds) to receive an event by the subscriber.
|
void |
setTimeToLive(long timeToLive)
Set the default time to live (length of time in milliseconds from its dispatch time that a published message should be retained by the system) of event publishing.
|
void |
setXPathFilter(XPathFilter filter)
Set the default XPath Filter to limited subscribed events.
|
void |
subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName)
Subscribe to events with specified event name (QName), consistency level, XPath filter, and event handler that consumes subscribed events.
|
void |
subscribe(QName eventName, String durableSubscriptionName)
Subscribe to events with specified event name (QName) and default consistency level, XPath filter (if a default one exists), timeout, and event handler that consumes subscribed events.
|
void |
unsubscribe(QName eventName, String durableSubscriptionName)
Remove a durable subscription that has been created previously.
|
close, publishEvent, setContextProvider
void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
event
- Business Event to be publishedoracle.fabric.common.FabricException
- If it fails to publish the event with default options.void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException
event
- Business Event to be publishedpersistent
- Persistent (or non persistent) delivery modepriority
- Event prioritytimeToLive
- Time to live in millisecondsedlURI
- URI with "oramds" referencing Event definition contentoracle.fabric.common.FabricException
- If it fails to publish the event with specified options.void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
Whether or not the subscription is durable depends on if the durableSubscriptionName is specified. Passing null or empty string as durableSubscriptionName indicates non-durable subscription.
If durableSubscriptionName is specified, it first creates a durable subscription if the subscription has not been created previously. Then it attempts to receive an event.
Note that the event receiving call blocks until an event arrives, or the timeout expires, or the connection is closed. A timeout value of 0 never expires, and the receive call blocks indefinitely. A negative timeout value means to receive the next event if one is immediately available without blocking.
eventName
- Event QName to subscribe todurableSubscriptionName
- Durable subscription name.oracle.fabric.common.FabricException
- If it fails to subscribe to events with specified options.void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName) throws oracle.fabric.common.FabricException
Whether or not the subscription is durable depends on if the durableSubscriptionName is specified. Passing null or empty string as durableSubscriptionName indicates non-durable subscription.
If durableSubscriptionName is specified, it first creates a durable subscription if the subscription has not been created previously. Then it attempts to receive an event.
Note that the event receiving call blocks until an event arrives, or the timeout expires, or the connection is closed. A timeout value of 0 never expires, and the receive call blocks indefinitely. A negative timeout value means to receive the next event if one is immediately available without blocking.
eventName
- Event QName to subscribe toqos
- Delivery guarantee, either ConsistencyLevel.ONE_AND_ONLY_ONE or ConsistencyLevel.GUARANTEED_DELIVERYfilter
- XPath filter to limit events. This filter is convertible into JMS message selector to apply on eventshandler
- Event handler to consume subscribed events.runAsPublisher
- Whether or not to consume events as publisher's identity.timeout
- Timeout value (in milliseconds). A value of 0 never expires, and this call blocks indefinitely. A negative value means to receive the next event if one is immediately available without blocking.durableSubscriptionName
- Durable subscription name.oracle.fabric.common.FabricException
- If it fails to subscribe to events with specified options.void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
eventName
- Event QName to unsubscribe todurableSubscriptionName
- Durable subscription name whose subscription is to be removed.oracle.fabric.common.FabricException
- if it fails to remove the durable subscription due to some internal error, or the subscription name is invalid.void setPersistent(boolean persistent) throws oracle.fabric.common.FabricException
persistent
- persistent (or non persistent) delivery modeoracle.fabric.common.FabricException
- if it fails to set the delivery mode.isPersistent
, getDeliveryMode
boolean isPersistent() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to check the persistent delivery mode.setPersistent
, getDeliveryMode
void setPriority(int defaultPriority) throws oracle.fabric.common.FabricException
defaultPriority
- The default message priority for event publishing; must be a value between 0 and 9oracle.fabric.common.FabricException
- If it fails to set the default priority.getPriority
int getPriority() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- if it fails to get the priority.setPriority
void setTimeToLive(long timeToLive) throws oracle.fabric.common.FabricException
timeToLive
- The message time to live in milliseconds; zero is unlimitedoracle.fabric.common.FabricException
- If it fails to set the set the time to live.getTimeToLive
long getTimeToLive() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get the message time to live.setTimeToLive
void setEDL(String edlURI) throws oracle.fabric.common.FabricException
edlURI
- URI with "oramds" referencing Event definition content.oracle.fabric.common.FabricException
- If it fails to set EDL URI.getEDL
String getEDL() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get the EDL URI.setEDL
void setConsistencyLevel(ConsistencyLevel qos) throws oracle.fabric.common.FabricException
qos
- The default ConsistencyLevel of event subscription.oracle.fabric.common.FabricException
- If it fails to set default ConsistencyLevelgetConsistencyLevel
, ONE_AND_ONLY_ONE
, GUARANTEED_DELIVERY
ConsistencyLevel getConsistencyLevel() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get default ConsistencyLevel.setConsistencyLevel
, ONE_AND_ONLY_ONE
, GUARANTEED_DELIVERY
void setXPathFilter(XPathFilter filter) throws oracle.fabric.common.FabricException
filter
- The default XPath Filter.oracle.fabric.common.FabricException
- If it fails to set the default XPath Filter.getXPathFilter
XPathFilter getXPathFilter() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get the default XPath Filter.setXPathFilter
void setEventHandler(BusinessEventHandler handler) throws oracle.fabric.common.FabricException
handler
- The default BusinessEvent Handler.oracle.fabric.common.FabricException
- If it fails to set the default BusinessEvent HandlergetEventHandler
BusinessEventHandler getEventHandler() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get default BusinessEvent Handler.setEventHandler
void setRunAsPublisher(boolean asPublisher) throws oracle.fabric.common.FabricException
asPublisher
- Whether or not to consume events as publisher's identity.oracle.fabric.common.FabricException
- If it fails to set the runAs Publisher flag.isRunAsPublisher
boolean isRunAsPublisher() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to check the runAs Publisher flag.setRunAsPublisher
void setTimeout(long timeout) throws oracle.fabric.common.FabricException
timeout
- The timeout value (in milliseconds).oracle.fabric.common.FabricException
- If it fails to set the set the timeout.getTimeout
long getTimeout() throws oracle.fabric.common.FabricException
oracle.fabric.common.FabricException
- If it fails to get the timeout.setTimeout