Class BaseEdnConnection
- All Implemented Interfaces:
BusinessEventConnection,EdnConnection
- Direct Known Subclasses:
EdnAqConnection,EdnJcaConnection,EdnJmsConnection
- Since:
- 12.1.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the connectionGet the default ConsistencyLevel of event subscription.oracle.j2ee.ws.common.context.ContextProviderGet context provider instance.getEDL()Get the default EDL URI with "oramds" referencing EDL content for event publishing.oracle.soa.management.facade.edn.IEDNgetEDN()Get the default BusinessEvent Handler to consume subscribed events.Get the event type to JMS resource mapping.intGet the default message priority of event publishing.longGet the default timeout value (in milliseconds) to receive an event by the subscriber.longGet 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.booleanReturn the default persistent delivery mode of event publishing.booleanReturn the default runAs Publisher flag for event consumption.voidpublishEvent(BusinessEvent event) Publish an event with default persistent, priority, time to live, and EDL as input source.voidpublishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) Publish an event with specified delivery mode, priority, time to live, and EDL URI.voidpublishEvent(BusinessEvent event, int priority) Publish an event with indicated priorityvoidSet the default ConsistencyLevel of event subscription.voidsetContextProvider(oracle.j2ee.ws.common.context.ContextProvider provider) Set ContextProvider object.voidSet the default EDL URI with "oramds" referencing EDL content for event publishing.voidsetEDN(oracle.soa.management.facade.edn.IEDN edn) voidsetEventHandler(BusinessEventHandler handler) Set the default BusinessEvent Handler to consume subscribed events.voidsetEventToJmsMapping(Map<QName, Set<JmsConfig>> eventToJmsMapping) Set the event type to JMS resource mapping.voidsetPersistent(boolean persistent) Set the default persistent delivery mode of event publishing.voidsetPriority(int defaultPriority) Set the default message priority of event publishing.voidsetRunAsPublisher(boolean asPublisher) Set the default runAs Publisher flag for event consumption.voidsetTimeout(long timeout) Set the default timeout value (in milliseconds) to receive an event by the subscriber.voidsetTimeToLive(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.voidsetXPathFilter(XPathFilter filter) Set the default XPath Filter to limited subscribed events.voidSubscribe 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.voidsubscribe(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.voidunsubscribe(QName eventName, String durableSubscriptionName) Remove a durable subscription that has been created previously.
-
Constructor Details
-
BaseEdnConnection
public BaseEdnConnection()
-
-
Method Details
-
setContextProvider
public void setContextProvider(oracle.j2ee.ws.common.context.ContextProvider provider) Description copied from interface:BusinessEventConnectionSet ContextProvider object.- Specified by:
setContextProviderin interfaceBusinessEventConnection- Parameters:
provider- - ContextProvider object
-
getContextProvider
public oracle.j2ee.ws.common.context.ContextProvider getContextProvider()Get context provider instance.- Returns:
- context provider.
-
setPersistent
public void setPersistent(boolean persistent) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet the default persistent delivery mode of event publishing.- Specified by:
setPersistentin interfaceEdnConnection- Parameters:
persistent- persistent (or non persistent) delivery mode- Throws:
oracle.fabric.common.FabricException- if it fails to set the delivery mode.- See Also:
-
isPersistentgetDeliveryMode
-
isPersistent
public boolean isPersistent() throws oracle.fabric.common.FabricExceptionDescription copied from interface:EdnConnectionReturn the default persistent delivery mode of event publishing.- Specified by:
isPersistentin interfaceEdnConnection- 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:
-
setPersistentgetDeliveryMode
-
setPriority
public void setPriority(int defaultPriority) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet 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.- Specified by:
setPriorityin interfaceEdnConnection- 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
public int getPriority() throws oracle.fabric.common.FabricExceptionDescription copied from interface:EdnConnectionGet the default message priority of event publishing.- Specified by:
getPriorityin interfaceEdnConnection- Returns:
- the default message priority for event publishing.
- Throws:
oracle.fabric.common.FabricException- if it fails to get the priority.- See Also:
-
setTimeToLive
public void setTimeToLive(long timeToLive) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet 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.- Specified by:
setTimeToLivein interfaceEdnConnection- 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
public long getTimeToLive() throws oracle.fabric.common.FabricExceptionDescription copied from interface:EdnConnectionGet 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.- Specified by:
getTimeToLivein interfaceEdnConnection- 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
Description copied from interface:EdnConnectionSet 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.- Specified by:
setEDLin interfaceEdnConnection- Parameters:
edlURI- URI with "oramds" referencing Event definition content.- Throws:
oracle.fabric.common.FabricException- If it fails to set EDL URI.- See Also:
-
getEDL
Description copied from interface:EdnConnectionGet 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.- Specified by:
getEDLin interfaceEdnConnection- 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
Description copied from interface:EdnConnectionSet the default ConsistencyLevel of event subscription.- Specified by:
setConsistencyLevelin interfaceEdnConnection- Parameters:
qos- The default ConsistencyLevel of event subscription.- Throws:
oracle.fabric.common.FabricException- If it fails to set default ConsistencyLevel- See Also:
-
getConsistencyLevel
Description copied from interface:EdnConnectionGet the default ConsistencyLevel of event subscription.- Specified by:
getConsistencyLevelin interfaceEdnConnection- Returns:
- the default ConsistencyLevel of event subscription.
- Throws:
oracle.fabric.common.FabricException- If it fails to get default ConsistencyLevel.- See Also:
-
setXPathFilter
Description copied from interface:EdnConnectionSet the default XPath Filter to limited subscribed events.- Specified by:
setXPathFilterin interfaceEdnConnection- Parameters:
filter- The default XPath Filter.- Throws:
oracle.fabric.common.FabricException- If it fails to set the default XPath Filter.- See Also:
-
getXPathFilter
Description copied from interface:EdnConnectionGet the default XPath Filter to limited subscribed events.- Specified by:
getXPathFilterin interfaceEdnConnection- Returns:
- the default XPath Filter.
- Throws:
oracle.fabric.common.FabricException- If it fails to get the default XPath Filter.- See Also:
-
setEventHandler
public void setEventHandler(BusinessEventHandler handler) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet the default BusinessEvent Handler to consume subscribed events.- Specified by:
setEventHandlerin interfaceEdnConnection- Parameters:
handler- The default BusinessEvent Handler.- Throws:
oracle.fabric.common.FabricException- If it fails to set the default BusinessEvent Handler- See Also:
-
getEventHandler
Description copied from interface:EdnConnectionGet the default BusinessEvent Handler to consume subscribed events.- Specified by:
getEventHandlerin interfaceEdnConnection- Returns:
- the default BusinessEvent Handler.
- Throws:
oracle.fabric.common.FabricException- If it fails to get default BusinessEvent Handler.- See Also:
-
setRunAsPublisher
public void setRunAsPublisher(boolean asPublisher) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet the default runAs Publisher flag for event consumption.- Specified by:
setRunAsPublisherin interfaceEdnConnection- 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
public boolean isRunAsPublisher() throws oracle.fabric.common.FabricExceptionDescription copied from interface:EdnConnectionReturn the default runAs Publisher flag for event consumption.- Specified by:
isRunAsPublisherin interfaceEdnConnection- 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
public void setTimeout(long timeout) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSet 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.- Specified by:
setTimeoutin interfaceEdnConnection- Parameters:
timeout- The timeout value (in milliseconds).- Throws:
oracle.fabric.common.FabricException- If it fails to set the set the timeout.- See Also:
-
getTimeout
public long getTimeout() throws oracle.fabric.common.FabricExceptionDescription copied from interface:EdnConnectionGet the default timeout value (in milliseconds) to receive an event by the subscriber.- Specified by:
getTimeoutin interfaceEdnConnection- Returns:
- The timeout value (in milliseconds).
- Throws:
oracle.fabric.common.FabricException- If it fails to get the timeout.- See Also:
-
setEventToJmsMapping
Set the event type to JMS resource mapping.- Parameters:
eventToJmsMapping- - event to JMS topic mapping
-
getEventToJmsMapping
Get the event type to JMS resource mapping.- Returns:
- event type to JMS resource mapping.
-
getEDN
public oracle.soa.management.facade.edn.IEDN getEDN() -
setEDN
public void setEDN(oracle.soa.management.facade.edn.IEDN edn) -
close
public void close() throws oracle.fabric.common.FabricExceptionDescription copied from interface:BusinessEventConnectionClose the connection- Specified by:
closein interfaceBusinessEventConnection- Throws:
oracle.fabric.common.FabricException- if fabric exception occurs
-
publishEvent
public void publishEvent(BusinessEvent event, int priority) throws oracle.fabric.common.FabricException Description copied from interface:BusinessEventConnectionPublish an event with indicated priority- Specified by:
publishEventin interfaceBusinessEventConnection- Parameters:
event- - Business Event to be publishedpriority- - event priority- Throws:
oracle.fabric.common.FabricException- if fabric exception occurs
-
publishEvent
Description copied from interface:EdnConnectionPublish an event with default persistent, priority, time to live, and EDL as input source.- Specified by:
publishEventin interfaceEdnConnection- Parameters:
event- Business Event to be published- Throws:
oracle.fabric.common.FabricException- If it fails to publish the event with default options.
-
publishEvent
public void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionPublish an event with specified delivery mode, priority, time to live, and EDL URI.- Specified by:
publishEventin interfaceEdnConnection- 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.
-
unsubscribe
public void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionRemove a durable subscription that has been created previously.- Specified by:
unsubscribein interfaceEdnConnection- 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.
-
subscribe
public void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSubscribe 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.
- Specified by:
subscribein interfaceEdnConnection- 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
public void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSubscribe 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.
- Specified by:
subscribein interfaceEdnConnection- 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.
-