Interface Subscriber


  • public interface Subscriber

    Allows a Transformer module to subscribe, and unsubscribe, listeners interested in receiving updates for objects that match a particular name pattern, or are of a specific object type.

    • Field Detail

      • F_LISTENER_ACCESSORY

        static final int F_LISTENER_ACCESSORY
        Setting this flag on subscribe will cause the subscriber to behave as an accessory listener. Accessory listeners will not necessarily result in objects being requested by the Transformer. Instead, the 'accessory listener' listens to subscriptions made by other subscribing clients.

        Objects which are 'listened to' by an accessory listener can be discarded and dropped from the Transformer cache. This can occur when there are no other subscribing clients.
        See Also:
        Constant Field Values
    • Method Detail

      • addSubscriptionListener

        void addSubscriptionListener​(java.lang.String objectNamePattern,
                                     SubscriptionListener listener)

        Adds the subscription listener for the specified object name pattern and returns the current data for that object to the listener. The listener will now be informed of all the updates for any object with a name that matches the pattern.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectNamePattern - The object name pattern the listener was subscribed with.
        listener - The listener that should be informed when an update occurs for an object with a name that matches the specified pattern.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • addSubscriptionListener

        void addSubscriptionListener​(java.lang.String objectNamePattern,
                                     SubscriptionListener listener,
                                     int subscriptionFlags)

        Adds the subscription listener for the specified object name pattern and returns the current data for that object to the listener. The listener will now be informed of all the updates for any object with a name that matches the pattern.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectNamePattern - The object name pattern the listener was subscribed with.
        listener - The listener that should be informed when
        subscriptionFlags - Enables flags to be set for this subscription. Settable flags include F_DEFAULT, F_LISTENER_ACCESSORY. an update occurs for an object with a name that matches the specified pattern.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • addSubscriptionListener

        void addSubscriptionListener​(java.util.Collection<java.lang.String> objectNamePatterns,
                                     SubscriptionListener listener,
                                     int subscriptionFlags)

        Adds the subscription listener for the specified object name patterns and returns the current data for those objects to the listener. The listener will now be informed of all the updates for any object with a name that matches any of the patterns.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectNamePatterns - A Collection of object name patterns the listener was subscribed with.
        listener - The listener that should be informed when an update occurs for an object with a name that matches the specified pattern.
        subscriptionFlags - Enables flags to be set for this subscription. Settable flags include F_DEFAULT, F_LISTENER_ACCESSORY
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • addSubscriptionListener

        void addSubscriptionListener​(ObjectType objectType,
                                     SubscriptionListener listener,
                                     int subscriptionFlags)

        Adds the subscription listener for the specified object type and returns the current data for that object to the listener. The listener will now be informed of all the updates for any object of that type.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectType - The type of object the listener is interested in.
        listener - The listener that should be informed when an update occurs for any object of the specified type.
        subscriptionFlags - Enables flags to be set for this subscription. Settable flags include F_DEFAULT, F_LISTENER_ACCESSORY
        Throws:
        java.lang.NullPointerException - If either the objectType or listener arguments are null.
      • addSubscriptionListener

        void addSubscriptionListener​(java.util.Collection<java.lang.String> objectNamePatterns,
                                     SubscriptionListener listener)

        Adds the subscription listener for the specified object name patterns and returns the current data for those objects to the listener. The listener will now be informed of all the updates for any object with a name that matches any of the patterns.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectNamePatterns - A Collection of object name patterns the listener was subscribed with.
        listener - The listener that should be informed when an update occurs for an object with a name that matches the specified pattern.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • addSubscriptionListener

        void addSubscriptionListener​(ObjectType objectType,
                                     SubscriptionListener listener)

        Adds the subscription listener for the specified object type and returns the current data for that object to the listener. The listener will now be informed of all the updates for any object of that type.

        A listener can be added for multiple subscriptions, so that it can be called several times for the same object update. For example, an update to the record /LO/VOD will result in the update method being invoked three times for a listener that has been registered for the pattern /??/VOD, for the pattern /LO/* and for the object type record.

        Parameters:
        objectType - The type of object the listener is interested in.
        listener - The listener that should be informed when an update occurs for any object of the specified type.
        Throws:
        java.lang.NullPointerException - If either the objectType or listener arguments are null.
      • removeSubscriptionListener

        void removeSubscriptionListener​(java.lang.String objectNamePattern,
                                        SubscriptionListener listener)

        Removes the subscription listener for the specified object name pattern. If the listener was added multiple times for the specified object name pattern, then only the first instance will be removed.

        Parameters:
        objectNamePattern - The object name pattern the listener was subscribed with.
        listener - The listener that had been subscribed for the specified pattern.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • removeSubscriptionListener

        void removeSubscriptionListener​(java.util.Collection<java.lang.String> objectNamePatterns,
                                        SubscriptionListener listener)

        Removes the subscription listener for the specified object name patterns. If the listener was added multiple times for the specified object name pattern, then only the first instance will be removed.

        Parameters:
        objectNamePatterns - The object name patterns the listener was subscribed with.
        listener - The listener that had been subscribed for the specified pattern.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or listener arguments are null.
      • removeSubscriptionListener

        void removeSubscriptionListener​(ObjectType objectType,
                                        SubscriptionListener listener)

        Removes the subscription listener for the specified object type. If the listener was added multiple times for the specified object type, then only the first instance will be removed.

        Parameters:
        objectType - The type of object the listener was subscribed with.
        listener - The listener that had been subscribed for the specified object type.
        Throws:
        java.lang.NullPointerException - If either the objectType or listener arguments are null.