Joram ${version}

org.objectweb.joram.client.jms
Class Topic

java.lang.Object
  extended byorg.objectweb.joram.client.jms.admin.AdministeredObject
      extended byorg.objectweb.joram.client.jms.Destination
          extended byorg.objectweb.joram.client.jms.Topic
All Implemented Interfaces:
javax.jms.Destination, javax.naming.Referenceable, java.io.Serializable, fr.dyade.aaa.jndi2.soap.SoapObjectItf, javax.jms.Topic
Direct Known Subclasses:
TemporaryTopic

public class Topic
extends Destination
implements javax.jms.Topic

Implements the javax.jms.Topic interface and provides JORAM specific administration and monitoring methods.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.joram.client.jms.Destination
adminName, agentId
 
Constructor Summary
  Topic()
           
  Topic(java.lang.String name)
           
protected Topic(java.lang.String name, java.lang.String type)
           
 
Method Summary
 void addClusteredTopic(Topic addedTopic)
          Adds a topic into the cluster this topic belongs to.
static Topic create()
          Admin method creating and deploying a topic on the local server.
static Topic create(int serverId)
          Admin method creating and deploying a topic on a given server.
static Topic create(int serverId, java.util.Properties prop)
          Admin method creating and deploying a topic on a given server.
static Topic create(int serverId, java.lang.String name)
          Admin method creating and deploying (or retrieving) a topic on a given server with a given name.
static Topic create(int serverId, java.lang.String className, java.util.Properties prop)
          Admin method creating and deploying a topic on a given server.
static Topic create(int serverId, java.lang.String name, java.lang.String className, java.util.Properties prop)
          Admin method creating and deploying (or retrieving) a topic on a given server.
static Topic create(java.lang.String name)
          Admin method creating and deploying (or retrieving) a topic on the local server.
 java.util.List getClusterFellows()
          Monitoring method returning the list describing the cluster this topic is part of.
 Topic getHierarchicalFather()
          Monitoring method returning the hierarchical father of this topic, null if none.
 java.lang.String[] getSubscriberIds(javax.jms.Topic topic)
           
 int getSubscriptions()
          Monitoring method returning the number of users that subscribes on this topic.
 java.lang.String getTopicName()
          API method.
static boolean isTopic(java.lang.String type)
           
 void removeFromCluster()
          Removes this topic from the cluster it belongs to.
 void setParent(Topic parent)
          Creates a hierarchical relationship between this topic and its father topic.
 java.lang.String toString()
          Returns a String image of the topic.
 void unsetParent()
          Unsets the father of this topic.
 
Methods inherited from class org.objectweb.joram.client.jms.Destination
code, decode, delete, doCreate, equals, getAdminName, getDMQ, getName, getReaders, getReference, getType, getWriters, isAssignableTo, isFreelyReadable, isFreelyWriteable, isQueue, newInstance, setDMQ, setFreeReading, setFreeWriting, setReader, setWriter, unsetFreeReading, unsetFreeWriting, unsetReader, unsetWriter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Topic

public Topic()

Topic

public Topic(java.lang.String name)

Topic

protected Topic(java.lang.String name,
                java.lang.String type)
Method Detail

isTopic

public static boolean isTopic(java.lang.String type)

toString

public java.lang.String toString()
Returns a String image of the topic.

Specified by:
toString in interface javax.jms.Topic

getTopicName

public java.lang.String getTopicName()
                              throws javax.jms.JMSException
API method.

Specified by:
getTopicName in interface javax.jms.Topic
Throws:
javax.jms.JMSException - Actually never thrown.

create

public static Topic create(int serverId,
                           java.lang.String name,
                           java.lang.String className,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a topic on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the topic.
name - The name of the topic.
className - The topic class name.
prop - The topic properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create(int serverId,
                           java.lang.String className,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a topic on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the topic.
className - The topic class name.
prop - The topic properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create(int serverId,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a topic on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the topic.
prop - The topic properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create(int serverId,
                           java.lang.String name)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a topic on a given server with a given name.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the topic.
name - The topic name.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create(java.lang.String name)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a topic on the local server.

The request fails if the destination deployement fails server side.

Parameters:
name - The topic name.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create(int serverId)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a topic on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the topic.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Topic create()
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a topic on the local server.

The request fails if the destination deployement fails server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getHierarchicalFather

public Topic getHierarchicalFather()
                            throws java.net.ConnectException,
                                   AdminException
Monitoring method returning the hierarchical father of this topic, null if none.

The request fails if the topic is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getClusterFellows

public java.util.List getClusterFellows()
                                 throws java.net.ConnectException,
                                        AdminException
Monitoring method returning the list describing the cluster this topic is part of.

The request fails if the topic is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getSubscriptions

public int getSubscriptions()
                     throws java.net.ConnectException,
                            AdminException
Monitoring method returning the number of users that subscribes on this topic. If a client has many subscriptions it is only counted once.

The request fails if the topic is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getSubscriberIds

public java.lang.String[] getSubscriberIds(javax.jms.Topic topic)
                                    throws AdminException,
                                           java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

addClusteredTopic

public void addClusteredTopic(Topic addedTopic)
                       throws java.net.ConnectException,
                              AdminException
Adds a topic into the cluster this topic belongs to. If this topic doesn't belong to a cluster then a cluster is created by clustering this topic with the added topic.

The request fails if one or both of the topics are deleted, or can't belong to a cluster.

Parameters:
addedTopic - topic added to the cluster
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

removeFromCluster

public void removeFromCluster()
                       throws java.net.ConnectException,
                              AdminException
Removes this topic from the cluster it belongs to.

The request fails if the topic does not exist or is not part of any cluster.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

setParent

public void setParent(Topic parent)
               throws java.net.ConnectException,
                      AdminException
Creates a hierarchical relationship between this topic and its father topic.

The request fails if one of the topics does not exist or can't be part of a hierarchy.

Parameters:
parent -
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

unsetParent

public void unsetParent()
                 throws java.net.ConnectException,
                        AdminException
Unsets the father of this topic.

The request fails if the topic does not exist or is not part of any hierarchy.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

Joram ${version}

Copyright ? 2005 Scalagent - All rights reserved