ImaSubscription (Eclipse Amlen Javadoc Reference)

Package com.ibm.ima.plugin

## Interface ImaSubscription

-     public interface ImaSubscription

  The ImaSubscription object is created using the newSubscription() method of ImaConnection. The configuration of the subscription is read only, and the only actions which can be taken on the subscription are subscribe() and close(). A subscription object is tied to a connection.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `COPYRIGHT` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` | Close a subscription.
    `ImaConnection` | `getConnection()` | Returns the connection of the subscription
    `String` | `getDestination()` | Returns the destination of the subscription
    `ImaDestinationType` | `getDestinationType()` | Returns the destination type.
    `String` | `getName()` | Returns the name of the subscription.
    `boolean` | `getNoLocal()` | Returns the nolocal setting of the subscription.
    `ImaReliability` | `getReliability()` | Returns the reliability setting of the subscription
    `ImaSubscriptionType` | `getSubscriptionType()` | Returns the subscription type.
    `Object` | `getUserData()` | Returns the user data
    `boolean` | `isSubscribed()` | Returns whether the subscription is currently active.
    `void` | `setReliability​(ImaReliability qos)` | Sets the reliability setting of the subscription
    `void` | `setUserData​(Object userData)` | Sets the user data
    `void` | `subscribe()` | Make the subscription.
    `void` | `subscribeNoAck()` | Make the subscription without waiting for an ACK.

- - ### Field Detail

    - #### COPYRIGHT

          static final String COPYRIGHT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### subscribe

          void subscribe()

      Make the subscription. Some time after making this call, the onComplete() callback of the connection listener will be called with this subscription as its object. The properties of the subscription are set when the object is created.

      After the subscribe(), another subscribe cannot be done until after a close() is done.

    - #### subscribeNoAck

          void subscribeNoAck()

      Make the subscription without waiting for an ACK.

      After the subscribe(), another subscribe cannot be done until after a close() is done.

      Throws:
        `ImaPluginException` - if an error occurs while subscribing

    - #### close

          void close()

      Close a subscription. A subscription is automatically closed when the connection is closed, but can also be closed explicitly. If the subscription type is non-durable, it will be destroyed. After a subscription is closed, another subscribe() can be done.
      Throws:
        `ImaPluginException` - if an error occurs while closing a subscription.

    - #### getConnection

          ImaConnection getConnection()

      Returns the connection of the subscription
      Returns:
        the connection object

    - #### getDestination

          String getDestination()

      Returns the destination of the subscription
      Returns:
        the destination name

    - #### getDestinationType

          ImaDestinationType getDestinationType()

      Returns the destination type.
      Returns:
        The destination type as topic or queue.

    - #### getName

          String getName()

      Returns the name of the subscription.
      Returns:

    - #### getNoLocal

          boolean getNoLocal()

      Returns the nolocal setting of the subscription. The nolocal setting is ignored for shared subscriptions.
      Returns:
        true if nolocal is selected, false otherwise.

    - #### getReliability

          ImaReliability getReliability()

      Returns the reliability setting of the subscription
      Returns:
        the reliability setting

    - #### setReliability

          void setReliability​(ImaReliability qos)

      Sets the reliability setting of the subscription

    - #### getSubscriptionType

          ImaSubscriptionType getSubscriptionType()

      Returns the subscription type.
      Returns:
        the subscription type

    - #### isSubscribed

          boolean isSubscribed()

      Returns whether the subscription is currently active.
      Returns:
        true if the subscription is active and false otherwise.

    - #### getUserData

          Object getUserData()

      Returns the user data
      Returns:
        user data

    - #### setUserData

          void setUserData​(Object userData)

      Sets the user data