public class BaseEdnConnection extends Object implements EdnConnection
| Constructor and Description |
|---|
BaseEdnConnection() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection
|
ConsistencyLevel |
getConsistencyLevel()
Get the default ConsistencyLevel of event subscription.
|
oracle.j2ee.ws.common.context.ContextProvider |
getContextProvider()
Get context provider instance.
|
String |
getEDL()
Get the default EDL URI with "oramds" referencing EDL content for event publishing.
|
oracle.soa.management.facade.edn.IEDN |
getEDN() |
BusinessEventHandler |
getEventHandler()
Get the default BusinessEvent Handler to consume subscribed events.
|
Map<QName,Set<JmsConfig>> |
getEventToJmsMapping()
Get the event type to JMS resource mapping.
|
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 |
publishEvent(BusinessEvent event, int priority)
Publish an event with indicated priority
|
void |
setConsistencyLevel(ConsistencyLevel qos)
Set the default ConsistencyLevel of event subscription.
|
void |
setContextProvider(oracle.j2ee.ws.common.context.ContextProvider provider)
Set ContextProvider object.
|
void |
setEDL(String edlURI)
Set the default EDL URI with "oramds" referencing EDL content for event publishing.
|
void |
setEDN(oracle.soa.management.facade.edn.IEDN edn) |
void |
setEventHandler(BusinessEventHandler handler)
Set the default BusinessEvent Handler to consume subscribed events.
|
void |
setEventToJmsMapping(Map<QName,Set<JmsConfig>> eventToJmsMapping)
Set the event type to JMS resource mapping.
|
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.
|
public void setContextProvider(oracle.j2ee.ws.common.context.ContextProvider provider)
BusinessEventConnectionsetContextProvider in interface BusinessEventConnectionprovider - - ContextProvider objectpublic oracle.j2ee.ws.common.context.ContextProvider getContextProvider()
public void setPersistent(boolean persistent)
throws oracle.fabric.common.FabricException
EdnConnectionsetPersistent in interface EdnConnectionpersistent - persistent (or non persistent) delivery modeoracle.fabric.common.FabricException - if it fails to set the delivery mode.isPersistent, getDeliveryMode
public boolean isPersistent()
throws oracle.fabric.common.FabricException
EdnConnectionisPersistent in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to check the persistent delivery mode.setPersistent, getDeliveryMode
public void setPriority(int defaultPriority)
throws oracle.fabric.common.FabricException
EdnConnectionsetPriority in interface EdnConnectiondefaultPriority - 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
public int getPriority()
throws oracle.fabric.common.FabricException
EdnConnectiongetPriority in interface EdnConnectionoracle.fabric.common.FabricException - if it fails to get the priority.setPriority
public void setTimeToLive(long timeToLive)
throws oracle.fabric.common.FabricException
EdnConnectionsetTimeToLive in interface EdnConnectiontimeToLive - 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
public long getTimeToLive()
throws oracle.fabric.common.FabricException
EdnConnectiongetTimeToLive in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get the message time to live.setTimeToLivepublic void setEDL(String edlURI) throws oracle.fabric.common.FabricException
EdnConnectionsetEDL in interface EdnConnectionedlURI - URI with "oramds" referencing Event definition content.oracle.fabric.common.FabricException - If it fails to set EDL URI.getEDLpublic String getEDL() throws oracle.fabric.common.FabricException
EdnConnectiongetEDL in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get the EDL URI.setEDLpublic void setConsistencyLevel(ConsistencyLevel qos) throws oracle.fabric.common.FabricException
EdnConnectionsetConsistencyLevel in interface EdnConnectionqos - The default ConsistencyLevel of event subscription.oracle.fabric.common.FabricException - If it fails to set default ConsistencyLevelgetConsistencyLevel, ONE_AND_ONLY_ONE, GUARANTEED_DELIVERYpublic ConsistencyLevel getConsistencyLevel() throws oracle.fabric.common.FabricException
EdnConnectiongetConsistencyLevel in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get default ConsistencyLevel.setConsistencyLevel, ONE_AND_ONLY_ONE, GUARANTEED_DELIVERYpublic void setXPathFilter(XPathFilter filter) throws oracle.fabric.common.FabricException
EdnConnectionsetXPathFilter in interface EdnConnectionfilter - The default XPath Filter.oracle.fabric.common.FabricException - If it fails to set the default XPath Filter.getXPathFilterpublic XPathFilter getXPathFilter() throws oracle.fabric.common.FabricException
EdnConnectiongetXPathFilter in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get the default XPath Filter.setXPathFilterpublic void setEventHandler(BusinessEventHandler handler) throws oracle.fabric.common.FabricException
EdnConnectionsetEventHandler in interface EdnConnectionhandler - The default BusinessEvent Handler.oracle.fabric.common.FabricException - If it fails to set the default BusinessEvent HandlergetEventHandlerpublic BusinessEventHandler getEventHandler() throws oracle.fabric.common.FabricException
EdnConnectiongetEventHandler in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get default BusinessEvent Handler.setEventHandler
public void setRunAsPublisher(boolean asPublisher)
throws oracle.fabric.common.FabricException
EdnConnectionsetRunAsPublisher in interface EdnConnectionasPublisher - Whether or not to consume events as publisher's identity.oracle.fabric.common.FabricException - If it fails to set the runAs Publisher flag.isRunAsPublisher
public boolean isRunAsPublisher()
throws oracle.fabric.common.FabricException
EdnConnectionisRunAsPublisher in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to check the runAs Publisher flag.setRunAsPublisher
public void setTimeout(long timeout)
throws oracle.fabric.common.FabricException
EdnConnectionsetTimeout in interface EdnConnectiontimeout - The timeout value (in milliseconds).oracle.fabric.common.FabricException - If it fails to set the set the timeout.getTimeout
public long getTimeout()
throws oracle.fabric.common.FabricException
EdnConnectiongetTimeout in interface EdnConnectionoracle.fabric.common.FabricException - If it fails to get the timeout.setTimeoutpublic void setEventToJmsMapping(Map<QName,Set<JmsConfig>> eventToJmsMapping)
eventToJmsMapping - - event to JMS topic mappingpublic Map<QName,Set<JmsConfig>> getEventToJmsMapping()
public oracle.soa.management.facade.edn.IEDN getEDN()
public void setEDN(oracle.soa.management.facade.edn.IEDN edn)
public void close()
throws oracle.fabric.common.FabricException
BusinessEventConnectionclose in interface BusinessEventConnectionoracle.fabric.common.FabricException - if fabric exception occurspublic void publishEvent(BusinessEvent event, int priority) throws oracle.fabric.common.FabricException
BusinessEventConnectionpublishEvent in interface BusinessEventConnectionevent - - Business Event to be publishedpriority - - event priorityoracle.fabric.common.FabricException - if fabric exception occurspublic void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
EdnConnectionpublishEvent in interface EdnConnectionevent - Business Event to be publishedoracle.fabric.common.FabricException - If it fails to publish the event with default options.public void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException
EdnConnectionpublishEvent in interface EdnConnectionevent - 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.public void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnectionunsubscribe in interface EdnConnectioneventName - 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.public void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnectionWhether 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.
subscribe in interface EdnConnectioneventName - Event QName to subscribe todurableSubscriptionName - Durable subscription name.oracle.fabric.common.FabricException - If it fails to subscribe to events with specified options.public void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnectionWhether 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.
subscribe in interface EdnConnectioneventName - 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.