Interface EdnConnection
- All Superinterfaces:
BusinessEventConnection
- All Known Implementing Classes:
BaseEdnConnection
,EdnAqConnection
,EdnJcaConnection
,EdnJmsConnection
It supports event publishing options:
- Specifying EDL to support optimized filtering mechanism
- Specifying default message priority
- Specifying default JMS delivery mode
- Specifying default message priority
- Specifying default time to live
* It supports different event subscription options:
- Specifying interested event type
- Specifying message filters
- Specifying delivery guarantee
- Specifying durability
- Specifying event handler for asynchronous consumption
- Since:
- 12.1.2
-
Method Summary
Modifier and TypeMethodDescriptionGet the default ConsistencyLevel of event subscription.getEDL()
Get the default EDL URI with "oramds" referencing EDL content for event publishing.Get the default BusinessEvent Handler to consume subscribed events.int
Get the default message priority of event publishing.long
Get the default timeout value (in milliseconds) to receive an event by the subscriber.long
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.Get the default XPath Filter to limited subscribed events.boolean
Return the default persistent delivery mode of event publishing.boolean
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
Set the default ConsistencyLevel of event subscription.void
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 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
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
unsubscribe
(QName eventName, String durableSubscriptionName) Remove a durable subscription that has been created previously.Methods inherited from interface oracle.fabric.blocks.event.BusinessEventConnection
close, publishEvent, setContextProvider
-
Method Details
-
publishEvent
Publish an event with default persistent, priority, time to live, and EDL as input source.- Parameters:
event
- Business Event to be published- Throws:
oracle.fabric.common.FabricException
- If it fails to publish the event with default options.
-
publishEvent
void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException Publish an event with specified delivery mode, priority, time to live, and EDL URI.- Parameters:
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 content- Throws:
oracle.fabric.common.FabricException
- If it fails to publish the event with specified options.
-
subscribe
void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException 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.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.
- Parameters:
eventName
- Event QName to subscribe todurableSubscriptionName
- Durable subscription name.- Throws:
oracle.fabric.common.FabricException
- If it fails to subscribe to events with specified options.
-
subscribe
void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName) throws oracle.fabric.common.FabricException Subscribe to events with specified event name (QName), consistency level, XPath filter, and event handler that consumes subscribed events.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.
- Parameters:
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.- Throws:
oracle.fabric.common.FabricException
- If it fails to subscribe to events with specified options.
-
unsubscribe
void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException Remove a durable subscription that has been created previously.- Parameters:
eventName
- Event QName to unsubscribe todurableSubscriptionName
- Durable subscription name whose subscription is to be removed.- Throws:
oracle.fabric.common.FabricException
- if it fails to remove the durable subscription due to some internal error, or the subscription name is invalid.
-
setPersistent
void setPersistent(boolean persistent) throws oracle.fabric.common.FabricException Set the default persistent delivery mode of event publishing.- Parameters:
persistent
- persistent (or non persistent) delivery mode- Throws:
oracle.fabric.common.FabricException
- if it fails to set the delivery mode.- See Also:
-
isPersistent
getDeliveryMode
-
isPersistent
boolean isPersistent() throws oracle.fabric.common.FabricExceptionReturn the default persistent delivery mode of event publishing.- Returns:
- an indication of whether or not the default delivery mode of event publishing is persistent.
- Throws:
oracle.fabric.common.FabricException
- If it fails to check the persistent delivery mode.- See Also:
-
setPersistent
getDeliveryMode
-
setPriority
void setPriority(int defaultPriority) throws oracle.fabric.common.FabricException Set the default message priority of event publishing. The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default.- Parameters:
defaultPriority
- The default message priority for event publishing; must be a value between 0 and 9- Throws:
oracle.fabric.common.FabricException
- If it fails to set the default priority.- See Also:
-
getPriority
int getPriority() throws oracle.fabric.common.FabricExceptionGet the default message priority of event publishing.- Returns:
- the default message priority for event publishing.
- Throws:
oracle.fabric.common.FabricException
- if it fails to get the priority.- See Also:
-
setTimeToLive
void setTimeToLive(long timeToLive) throws oracle.fabric.common.FabricException 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. Note that time to live value is 0 by default.- Parameters:
timeToLive
- The message time to live in milliseconds; zero is unlimited- Throws:
oracle.fabric.common.FabricException
- If it fails to set the set the time to live.- See Also:
-
getTimeToLive
long getTimeToLive() throws oracle.fabric.common.FabricExceptionGet 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.- Returns:
- the message time to live in milliseconds for event publishing; 0 is unlimited
- Throws:
oracle.fabric.common.FabricException
- If it fails to get the message time to live.- See Also:
-
setEDL
Set the default EDL URI with "oramds" referencing EDL content for event publishing. EDL may contain "key" fields in the format of XPath. For optimized filtering, these "key" fields are used to apply the XPaths to extract key field values and copy into properties of JMS message before publish.- Parameters:
edlURI
- URI with "oramds" referencing Event definition content.- Throws:
oracle.fabric.common.FabricException
- If it fails to set EDL URI.- See Also:
-
getEDL
Get the default EDL URI with "oramds" referencing EDL content for event publishing. EDL may contain "key" fields in the format of XPath. For optimized filtering, these "key" fields are used to apply the XPaths to extract key field values and copy into properties of JMS message before publish.- Returns:
- the default EDL URI with "oramds" referencing EDL content
- Throws:
oracle.fabric.common.FabricException
- If it fails to get the EDL URI.- See Also:
-
setConsistencyLevel
Set the default ConsistencyLevel of event subscription.- Parameters:
qos
- The default ConsistencyLevel of event subscription.- Throws:
oracle.fabric.common.FabricException
- If it fails to set default ConsistencyLevel- See Also:
-
getConsistencyLevel
Get the default ConsistencyLevel of event subscription.- Returns:
- the default ConsistencyLevel of event subscription.
- Throws:
oracle.fabric.common.FabricException
- If it fails to get default ConsistencyLevel.- See Also:
-
setXPathFilter
Set the default XPath Filter to limited subscribed events.- Parameters:
filter
- The default XPath Filter.- Throws:
oracle.fabric.common.FabricException
- If it fails to set the default XPath Filter.- See Also:
-
getXPathFilter
Get the default XPath Filter to limited subscribed events.- Returns:
- the default XPath Filter.
- Throws:
oracle.fabric.common.FabricException
- If it fails to get the default XPath Filter.- See Also:
-
setEventHandler
Set the default BusinessEvent Handler to consume subscribed events.- Parameters:
handler
- The default BusinessEvent Handler.- Throws:
oracle.fabric.common.FabricException
- If it fails to set the default BusinessEvent Handler- See Also:
-
getEventHandler
Get the default BusinessEvent Handler to consume subscribed events.- Returns:
- the default BusinessEvent Handler.
- Throws:
oracle.fabric.common.FabricException
- If it fails to get default BusinessEvent Handler.- See Also:
-
setRunAsPublisher
void setRunAsPublisher(boolean asPublisher) throws oracle.fabric.common.FabricException Set the default runAs Publisher flag for event consumption.- Parameters:
asPublisher
- Whether or not to consume events as publisher's identity.- Throws:
oracle.fabric.common.FabricException
- If it fails to set the runAs Publisher flag.- See Also:
-
isRunAsPublisher
boolean isRunAsPublisher() throws oracle.fabric.common.FabricExceptionReturn the default runAs Publisher flag for event consumption.- Returns:
- an indication of whether or not to consume events as publisher's identity.
- Throws:
oracle.fabric.common.FabricException
- If it fails to check the runAs Publisher flag.- See Also:
-
setTimeout
void setTimeout(long timeout) throws oracle.fabric.common.FabricException Set the default timeout value (in milliseconds) to receive an event by the subscriber. A value of 0 never expires, and the subscribe call blocks indefinitely. A negative value means to receive the next event if one is immediately available without blocking. Note that timeout value is 0 by default.- Parameters:
timeout
- The timeout value (in milliseconds).- Throws:
oracle.fabric.common.FabricException
- If it fails to set the set the timeout.- See Also:
-
getTimeout
long getTimeout() throws oracle.fabric.common.FabricExceptionGet the default timeout value (in milliseconds) to receive an event by the subscriber.- Returns:
- The timeout value (in milliseconds).
- Throws:
oracle.fabric.common.FabricException
- If it fails to get the timeout.- See Also:
-