org.richfaces.application.push

## Class TopicKey

- java.lang.Object
- - org.richfaces.application.push.TopicKey

- All Implemented Interfaces:
    Serializable

      public class TopicKey
      extends Object
      implements Serializable

  Immutable TopicKey class encapsulates address of the particular topic.

  In order to support reuse of the same topic (e.g. JMS topic) for different application message topics, TopicKey contains topic name and sub-topic name separated with ‘@’.

  Application specifies TopicKey when publishing messages as topic address.

  Author:
    Nick Belaevski
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `SUBCHANNEL_SEPARATOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TopicKey(String topicAddress)` Constructs new topic by providing a topic address in format 'subtopic@topic'
    `TopicKey(String topicName, String subtopicName)` Contrstructs new topic by providing a name of the topic and a name of a subtopic.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `static com.google.common.base.Function<String,TopicKey>` | `factory()` Returns the function for creating `TopicKey`s from strings.
    `TopicKey` | `getRootTopicKey()` Returns the `TopicKey` that identifies topic without subtopic.
    `String` | `getSubtopicName()` Returns name of the subtopic
    `String` | `getTopicAddress()` Returns whole address of topic in format 'subtopic@topic'
    `String` | `getTopicName()` Returns name of the topic
    `int` | `hashCode()`
    `static com.google.common.base.Function<TopicKey,String>` | `toAddress()` Returns a function for converting `TopicKey` to address strings in format 'subtopic@topic'.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### SUBCHANNEL_SEPARATOR

          public static final char SUBCHANNEL_SEPARATOR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TopicKey

          public TopicKey(String topicAddress)

      Constructs new topic by providing a topic address in format 'subtopic@topic'

    - #### TopicKey

          public TopicKey(String topicName,
                  String subtopicName)

      Contrstructs new topic by providing a name of the topic and a name of a subtopic.

  - ### Method Detail

    - #### getTopicName

          public String getTopicName()

      Returns name of the topic

    - #### getSubtopicName

          public String getSubtopicName()

      Returns name of the subtopic

    - #### getTopicAddress

          public String getTopicAddress()

      Returns whole address of topic in format 'subtopic@topic'

    - #### getRootTopicKey

          public TopicKey getRootTopicKey()

      Returns the `TopicKey` that identifies topic without subtopic.

      This method returns this instance if it isn't associated with subtopic. It returns new `TopicKey` with the same topic name as this instance otherwise.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### factory

          public static com.google.common.base.Function<String,TopicKey> factory()

      Returns the function for creating `TopicKey`s from strings.

    - #### toAddress

          public static com.google.common.base.Function<TopicKey,String> toAddress()

      Returns a function for converting `TopicKey` to address strings in format 'subtopic@topic'.

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.