Class Topic

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        define serialVersionUID for interoperability
        See Also:
        Constant Field Values
    • Constructor Detail

      • Topic

        public Topic()
      • Topic

        public Topic​(String id)
      • Topic

        protected Topic​(String id,
                        byte type)
    • Method Detail

      • toString

        public String toString()
        Returns a String image of the topic.
        Specified by:
        toString in interface Topic
        Overrides:
        toString in class Object
        Returns:
        A provider-specific identity values for this topic.
      • getTopicName

        public String getTopicName()
                            throws JMSException
        API method. Gets the The Joram's internal unique identifier of this topic.
        Specified by:
        getTopicName in interface Topic
        Returns:
        The Joram's internal unique identifier.
        Throws:
        JMSException - Actually never thrown.
      • create

        public static Topic create​(int serverId,
                                   String name,
                                   String className,
                                   Properties prop)
                            throws ConnectException,
                                   AdminException
        Admin method creating and deploying (or retrieving) a topic on a given server. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.

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

        Be careful this method use the static AdminModule connection.

        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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • create

        public static Topic create​(int serverId,
                                   String className,
                                   Properties prop)
                            throws 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 deployment fails server side.

        Be careful this method use the static AdminModule connection.

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

        public static Topic create​(int serverId,
                                   Properties prop)
                            throws ConnectException,
                                   AdminException
        Admin method creating and deploying a topic on a given server. It creates a Jorram's standard topic.

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

        Be careful this method use the static AdminModule connection.

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

        public static Topic create​(int serverId,
                                   String name)
                            throws ConnectException,
                                   AdminException
        Admin method creating and deploying (or retrieving) a topic on a given server with a given name. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.

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

        Be careful this method use the static AdminModule connection.

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

        public static Topic create​(String name)
                            throws ConnectException,
                                   AdminException
        Admin method creating and deploying (or retrieving) a topic on the local server. First a destination with the specified name is searched on the given server, if it does not exist it is created. In any case, its provider-specific address is returned.

        The request fails if the destination deployment fails server side.

        Be careful this method use the static AdminModule connection.

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

        public static Topic create​(int serverId)
                            throws 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 deployment fails server side.

        Be careful this method use the static AdminModule connection.

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

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

        The request fails if the destination deployment fails server side.

        Be careful this method use the static AdminModule connection.

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

        public Topic getHierarchicalFather()
                                    throws 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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • getClusterFellows

        public List getClusterFellows()
                               throws 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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • getSubscriptions

        public int getSubscriptions()
                             throws 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.

        Specified by:
        getSubscriptions in interface TopicMBean
        Throws:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • addClusteredTopic

        public void addClusteredTopic​(Topic addedTopic)
                               throws 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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • removeFromCluster

        public void removeFromCluster()
                               throws 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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • setParent

        public void setParent​(Topic parent)
                       throws 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 - the topic which will be parent. null to remove previous parent.
        Throws:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.
      • unsetParent

        public void unsetParent()
                         throws 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:
        ConnectException - If the admin connection is closed or broken.
        AdminException - If the request fails.