flex.messaging.services.messaging
Class Subtopic

java.lang.Object
  extended by flex.messaging.services.messaging.Subtopic

public class Subtopic
extends Object

Represents a message destination subtopic. You are given instances of Subtopics as arguments to the MessagingAdapter.allowSubscribe and allowSend methods. These are used to implement your own authorization for the subscribe and send messages to specific subtopics.


Field Summary
static String SUBTOPIC_WILDCARD
          The wildcard token for hierarchical subtopics.
 
Method Summary
 boolean containsSubtopicWildcard()
          Returns true if the subtopic contains a hierarchical subtopic wildcard.
 boolean equals(Object other)
          Override of equals.
 String getSeparator()
          Returns the separator used to create this Subtopic instance.
 String getValue()
          Returns the subtopic value used to create this Subtopic instance.
 int hashCode()
          Override of hashCode.
 boolean isHierarchical()
          Returns true is the subtopic is hierarchical.
 boolean matches(Subtopic other)
          Matches the passed subtopic against this subtopic.
 String toString()
          Override of toString.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SUBTOPIC_WILDCARD

public static final String SUBTOPIC_WILDCARD
The wildcard token for hierarchical subtopics.

See Also:
Constant Field Values
Method Detail

containsSubtopicWildcard

public boolean containsSubtopicWildcard()
Returns true if the subtopic contains a hierarchical subtopic wildcard.

Returns:
true if the subtopic contains a hierarchical subtopic wildcard, otherwise false.

equals

public boolean equals(Object other)
Override of equals.

Overrides:
equals in class Object
Parameters:
other - The object to compare against.
Returns:
true if other equals to this; false otherwise;

getSeparator

public String getSeparator()
Returns the separator used to create this Subtopic instance. This value may be null.

Returns:
The separator used to create this Subtopic instance.

getValue

public String getValue()
Returns the subtopic value used to create this Subtopic instance.

Returns:
The subtopic value used to create this Subtopic instance.

hashCode

public int hashCode()
Override of hashCode. Hash using the subtopic String rather than the object's address.

Overrides:
hashCode in class Object
Returns:
The hashCode.

isHierarchical

public boolean isHierarchical()
Returns true is the subtopic is hierarchical.

Returns:
true if the subtopic is hierarchical, otherwise false.

matches

public boolean matches(Subtopic other)
Matches the passed subtopic against this subtopic. If neither subtopic contains a wildcard they must literally match. If one or the other contains a wildcard they may match. "chatrooms.*" will match "chatrooms.lobby" or "chatrooms.us.ca" but will not match "chatrooms" (assuming a subtopic separator of "."). "chatrooms.*.ca" will match "chatrooms.us.ca" but not "chatrooms.us.ma".

Parameters:
other - The other subtopic to match against this subtopic.
Returns:
true if they match, otherwise false.

toString

public String toString()
Override of toString.

Overrides:
toString in class Object
Returns:
The subtopic string.


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/services/messaging/Subtopic.html