com.h3c.sdn.alert

## Class AlertTopicListener

- java.lang.Object
- - com.h3c.sdn.AbstractModel<T,UUID>
  - - com.h3c.sdn.Model<AlertTopicListener>
    - - com.h3c.sdn.alert.AlertTopicListener

- All Implemented Interfaces:
    Transportable<AlertTopicListener,UUID>, Serializable

      public class AlertTopicListener
      extends Model<AlertTopicListener>

  Represents a listener for a given alert topic, with the notification when an alert from the associated alert topic occurs being sent to the supplied URI.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AlertTopicListener.CallBack` Alert Topic Listener call back definition.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlertTopicListener(Id<AlertTopicListener,UUID> id, String apId, String name)` Construct a listener for an alert topic.
    `AlertTopicListener(String apId, String name)` Construct a listener for an alert topic.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCallback(Set<String> topics, URI uri)` Define the set of topicIdSet and URI to be used in alert notification.
    `String` | `apId()` Returns the string associated with the application that contributed this listener.
    `boolean` | `equals(Object o)`
    `Set<AlertTopicListener.CallBack>` | `getCallbacks()` Returns the call back definitions that have been defined for this listener.
    `int` | `hashCode()`
    `String` | `name()` Returns the name associated with this listener.

    - ### Methods inherited from class com.h3c.sdn.AbstractModel

      `getId, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AlertTopicListener

          public AlertTopicListener(Id<AlertTopicListener,UUID> id,
                            String apId,
                            String name)

      Construct a listener for an alert topic. This constructor will use the unique ID supplied, rather than generating one.
      Parameters:
        `id` - the unique identification to use
        `apId` - the application contributing the listener
        `name` - the name for the listener
      Throws:
        `IllegalArgumentException` - if either parameter is null or empty

    - #### AlertTopicListener

          public AlertTopicListener(String apId,
                            String name)

      Construct a listener for an alert topic. This constructor will automatically generate a unique ID.
      Parameters:
        `apId` - the application contributing the listener
        `name` - the name for the listener
      Throws:
        `IllegalArgumentException` - if either parameter is null or empty

  - ### Method Detail

    - #### addCallback

          public void addCallback(Set<String> topics,
                         URI uri)

      Define the set of topicIdSet and URI to be used in alert notification.
      Parameters:
        `topics` - the topicIdSet of interest
        `uri` - the uri to post to
      Throws:
        `NullPointerException` - if either parameter is null

    - #### apId

          public String apId()

      Returns the string associated with the application that contributed this listener.
      Returns:
        the application identifier

    - #### name

          public String name()

      Returns the name associated with this listener.
      Returns:
        the name

    - #### getCallbacks

          public Set<AlertTopicListener.CallBack> getCallbacks()

      Returns the call back definitions that have been defined for this listener.
      Returns:
        the call backs

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `AbstractModel<AlertTopicListener,UUID>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractModel<AlertTopicListener,UUID>`

Copyright © 2014. All Rights Reserved.