Class BaseEdnConnection

java.lang.Object
oracle.integration.platform.blocks.event.jms2.BaseEdnConnection
All Implemented Interfaces:
BusinessEventConnection, EdnConnection
Direct Known Subclasses:
EdnAqConnection, EdnJcaConnection, EdnJmsConnection

public class BaseEdnConnection extends Object implements EdnConnection
A skeleton implementation of EdnConnection interface, which should be overridden by the actual implementers to provide concrete implementation of methods such as publishEvent, subscribe, and unsubscribe.
Since:
12.1.2
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the connection
    Get the default ConsistencyLevel of event subscription.
    oracle.j2ee.ws.common.context.ContextProvider
    Get context provider instance.
    Get the default EDL URI with "oramds" referencing EDL content for event publishing.
    oracle.soa.management.facade.edn.IEDN
     
    Get the default BusinessEvent Handler to consume subscribed events.
    Get the event type to JMS resource mapping.
    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
    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
    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
    Set the default BusinessEvent Handler to consume subscribed events.
    void
    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
    Set the default XPath Filter to limited 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
    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 class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseEdnConnection

      public BaseEdnConnection()
  • Method Details

    • setContextProvider

      public void setContextProvider(oracle.j2ee.ws.common.context.ContextProvider provider)
      Description copied from interface: BusinessEventConnection
      Set ContextProvider object.
      Specified by:
      setContextProvider in interface BusinessEventConnection
      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: EdnConnection
      Set the default persistent delivery mode of event publishing.
      Specified by:
      setPersistent in interface EdnConnection
      Parameters:
      persistent - persistent (or non persistent) delivery mode
      Throws:
      oracle.fabric.common.FabricException - if it fails to set the delivery mode.
      See Also:
    • isPersistent

      public boolean isPersistent() throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Return the default persistent delivery mode of event publishing.
      Specified by:
      isPersistent in interface EdnConnection
      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:
    • setPriority

      public void setPriority(int defaultPriority) throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      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.
      Specified by:
      setPriority in interface EdnConnection
      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.FabricException
      Description copied from interface: EdnConnection
      Get the default message priority of event publishing.
      Specified by:
      getPriority in interface EdnConnection
      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: EdnConnection
      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.
      Specified by:
      setTimeToLive in interface EdnConnection
      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.FabricException
      Description copied from interface: EdnConnection
      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.
      Specified by:
      getTimeToLive in interface EdnConnection
      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

      public void setEDL(String edlURI) throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      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.
      Specified by:
      setEDL in interface EdnConnection
      Parameters:
      edlURI - URI with "oramds" referencing Event definition content.
      Throws:
      oracle.fabric.common.FabricException - If it fails to set EDL URI.
      See Also:
    • getEDL

      public String getEDL() throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      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.
      Specified by:
      getEDL in interface EdnConnection
      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

      public void setConsistencyLevel(ConsistencyLevel qos) throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Set the default ConsistencyLevel of event subscription.
      Specified by:
      setConsistencyLevel in interface EdnConnection
      Parameters:
      qos - The default ConsistencyLevel of event subscription.
      Throws:
      oracle.fabric.common.FabricException - If it fails to set default ConsistencyLevel
      See Also:
    • getConsistencyLevel

      public ConsistencyLevel getConsistencyLevel() throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Get the default ConsistencyLevel of event subscription.
      Specified by:
      getConsistencyLevel in interface EdnConnection
      Returns:
      the default ConsistencyLevel of event subscription.
      Throws:
      oracle.fabric.common.FabricException - If it fails to get default ConsistencyLevel.
      See Also:
    • setXPathFilter

      public void setXPathFilter(XPathFilter filter) throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Set the default XPath Filter to limited subscribed events.
      Specified by:
      setXPathFilter in interface EdnConnection
      Parameters:
      filter - The default XPath Filter.
      Throws:
      oracle.fabric.common.FabricException - If it fails to set the default XPath Filter.
      See Also:
    • getXPathFilter

      public XPathFilter getXPathFilter() throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Get the default XPath Filter to limited subscribed events.
      Specified by:
      getXPathFilter in interface EdnConnection
      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: EdnConnection
      Set the default BusinessEvent Handler to consume subscribed events.
      Specified by:
      setEventHandler in interface EdnConnection
      Parameters:
      handler - The default BusinessEvent Handler.
      Throws:
      oracle.fabric.common.FabricException - If it fails to set the default BusinessEvent Handler
      See Also:
    • getEventHandler

      public BusinessEventHandler getEventHandler() throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Get the default BusinessEvent Handler to consume subscribed events.
      Specified by:
      getEventHandler in interface EdnConnection
      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: EdnConnection
      Set the default runAs Publisher flag for event consumption.
      Specified by:
      setRunAsPublisher in interface EdnConnection
      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.FabricException
      Description copied from interface: EdnConnection
      Return the default runAs Publisher flag for event consumption.
      Specified by:
      isRunAsPublisher in interface EdnConnection
      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: EdnConnection
      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.
      Specified by:
      setTimeout in interface EdnConnection
      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.FabricException
      Description copied from interface: EdnConnection
      Get the default timeout value (in milliseconds) to receive an event by the subscriber.
      Specified by:
      getTimeout in interface EdnConnection
      Returns:
      The timeout value (in milliseconds).
      Throws:
      oracle.fabric.common.FabricException - If it fails to get the timeout.
      See Also:
    • setEventToJmsMapping

      public void setEventToJmsMapping(Map<QName,Set<JmsConfig>> eventToJmsMapping)
      Set the event type to JMS resource mapping.
      Parameters:
      eventToJmsMapping - - event to JMS topic mapping
    • getEventToJmsMapping

      public Map<QName,Set<JmsConfig>> 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.FabricException
      Description copied from interface: BusinessEventConnection
      Close the connection
      Specified by:
      close in interface BusinessEventConnection
      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: BusinessEventConnection
      Publish an event with indicated priority
      Specified by:
      publishEvent in interface BusinessEventConnection
      Parameters:
      event - - Business Event to be published
      priority - - event priority
      Throws:
      oracle.fabric.common.FabricException - if fabric exception occurs
    • publishEvent

      public void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
      Description copied from interface: EdnConnection
      Publish an event with default persistent, priority, time to live, and EDL as input source.
      Specified by:
      publishEvent in interface EdnConnection
      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: EdnConnection
      Publish an event with specified delivery mode, priority, time to live, and EDL URI.
      Specified by:
      publishEvent in interface EdnConnection
      Parameters:
      event - Business Event to be published
      persistent - Persistent (or non persistent) delivery mode
      priority - Event priority
      timeToLive - Time to live in milliseconds
      edlURI - 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: EdnConnection
      Remove a durable subscription that has been created previously.
      Specified by:
      unsubscribe in interface EdnConnection
      Parameters:
      eventName - Event QName to unsubscribe to
      durableSubscriptionName - 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: EdnConnection
      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.

      Specified by:
      subscribe in interface EdnConnection
      Parameters:
      eventName - Event QName to subscribe to
      durableSubscriptionName - 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: EdnConnection
      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.

      Specified by:
      subscribe in interface EdnConnection
      Parameters:
      eventName - Event QName to subscribe to
      qos - Delivery guarantee, either ConsistencyLevel.ONE_AND_ONLY_ONE or ConsistencyLevel.GUARANTEED_DELIVERY
      filter - XPath filter to limit events. This filter is convertible into JMS message selector to apply on events
      handler - 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.