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)
BusinessEventConnection
setContextProvider
in interface BusinessEventConnection
provider
- - ContextProvider objectpublic oracle.j2ee.ws.common.context.ContextProvider getContextProvider()
public void setPersistent(boolean persistent) throws oracle.fabric.common.FabricException
EdnConnection
setPersistent
in interface EdnConnection
persistent
- 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
EdnConnection
isPersistent
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to check the persistent delivery mode.setPersistent
, getDeliveryMode
public void setPriority(int defaultPriority) throws oracle.fabric.common.FabricException
EdnConnection
setPriority
in interface EdnConnection
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
public int getPriority() throws oracle.fabric.common.FabricException
EdnConnection
getPriority
in interface EdnConnection
oracle.fabric.common.FabricException
- if it fails to get the priority.setPriority
public void setTimeToLive(long timeToLive) throws oracle.fabric.common.FabricException
EdnConnection
setTimeToLive
in interface EdnConnection
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
public long getTimeToLive() throws oracle.fabric.common.FabricException
EdnConnection
getTimeToLive
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get the message time to live.setTimeToLive
public void setEDL(String edlURI) throws oracle.fabric.common.FabricException
EdnConnection
setEDL
in interface EdnConnection
edlURI
- URI with "oramds" referencing Event definition content.oracle.fabric.common.FabricException
- If it fails to set EDL URI.getEDL
public String getEDL() throws oracle.fabric.common.FabricException
EdnConnection
getEDL
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get the EDL URI.setEDL
public void setConsistencyLevel(ConsistencyLevel qos) throws oracle.fabric.common.FabricException
EdnConnection
setConsistencyLevel
in interface EdnConnection
qos
- The default ConsistencyLevel of event subscription.oracle.fabric.common.FabricException
- If it fails to set default ConsistencyLevelgetConsistencyLevel
, ONE_AND_ONLY_ONE
, GUARANTEED_DELIVERY
public ConsistencyLevel getConsistencyLevel() throws oracle.fabric.common.FabricException
EdnConnection
getConsistencyLevel
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get default ConsistencyLevel.setConsistencyLevel
, ONE_AND_ONLY_ONE
, GUARANTEED_DELIVERY
public void setXPathFilter(XPathFilter filter) throws oracle.fabric.common.FabricException
EdnConnection
setXPathFilter
in interface EdnConnection
filter
- The default XPath Filter.oracle.fabric.common.FabricException
- If it fails to set the default XPath Filter.getXPathFilter
public XPathFilter getXPathFilter() throws oracle.fabric.common.FabricException
EdnConnection
getXPathFilter
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get the default XPath Filter.setXPathFilter
public void setEventHandler(BusinessEventHandler handler) throws oracle.fabric.common.FabricException
EdnConnection
setEventHandler
in interface EdnConnection
handler
- The default BusinessEvent Handler.oracle.fabric.common.FabricException
- If it fails to set the default BusinessEvent HandlergetEventHandler
public BusinessEventHandler getEventHandler() throws oracle.fabric.common.FabricException
EdnConnection
getEventHandler
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get default BusinessEvent Handler.setEventHandler
public void setRunAsPublisher(boolean asPublisher) throws oracle.fabric.common.FabricException
EdnConnection
setRunAsPublisher
in interface EdnConnection
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
public boolean isRunAsPublisher() throws oracle.fabric.common.FabricException
EdnConnection
isRunAsPublisher
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to check the runAs Publisher flag.setRunAsPublisher
public void setTimeout(long timeout) throws oracle.fabric.common.FabricException
EdnConnection
setTimeout
in interface EdnConnection
timeout
- 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
EdnConnection
getTimeout
in interface EdnConnection
oracle.fabric.common.FabricException
- If it fails to get the timeout.setTimeout
public 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
BusinessEventConnection
close
in interface BusinessEventConnection
oracle.fabric.common.FabricException
- if fabric exception occurspublic void publishEvent(BusinessEvent event, int priority) throws oracle.fabric.common.FabricException
BusinessEventConnection
publishEvent
in interface BusinessEventConnection
event
- - Business Event to be publishedpriority
- - event priorityoracle.fabric.common.FabricException
- if fabric exception occurspublic void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
EdnConnection
publishEvent
in interface EdnConnection
event
- 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
EdnConnection
publishEvent
in interface EdnConnection
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.public void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnection
unsubscribe
in interface EdnConnection
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.public void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnection
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.
subscribe
in interface EdnConnection
eventName
- 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
EdnConnection
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.
subscribe
in interface EdnConnection
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.