Interface TransformerAccessor


public interface TransformerAccessor

Allows a Transformer module access to the main interfaces it requires to interact with the Transformer core.

  • Field Details

    • F_DEFAULT

      static final int F_DEFAULT
      Default Subscriber flag.
      See Also:
    • 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:
  • Method Details

    • getDataCache

      DataCache getDataCache()

      Returns an object that allows the Transformer module to access the data cached within the Transformer's core.

      Returns:
      The DataCache object.
    • getPipelineRegistrar

      PipelineRegistrar getPipelineRegistrar()

      Returns an object that allows the Transformer module to register methods for availability in pipelines

      Returns:
      The PipelineRegistrar object.
    • getUDPAccessor

      UDPAccessor getUDPAccessor()

      Returns an object that allows the Transformer module to access the Transformer core's UDP command interface. The module will be able to register and deregister listeners for UDP commands, and send its own UDP commands.

      Returns:
      The UDPAccessor object.
    • getLogDirectory

      String getLogDirectory()
      Gets the logging directory configured for the Transformer
      Returns:
      The directory where log files are stored
    • getLogger

      Logger getLogger()

      Returns the Logger that should be used with this module

      Returns:
      The Logger for this module
    • expandFilename

      String expandFilename(String filename)

      Returns a fully qualified filename based on % substitution fields.

      The possible substitution fields are:

      • %a - the application name.
      • %n - the application name.
      • %r - the application root.
      Parameters:
      filename - The filename, including % substitution fields, to expand.
      Returns:
      The expanded filename.
      Throws:
      NullPointerException - If the filename is null.
    • getPersistence

      Persistence getPersistence()
      Returns:
      An object providing access to the Transformer persistence service.
    • createActivePublisher

      TransformerPublisher createActivePublisher(Namespace namespace, DataProvider dataProvider)

      Creates an TransformerPublisher for the specified namespace.

       

      A TransformerPublisher publishes updates that are for subjects within the specified Namespace, to all peers that have subscribed to those subjects.

      Parameters:
      namespace - The Namespace associated with this publisher.
      dataProvider - The DataProvider that can publish data via this publisher.
      Returns:
      An TransformerPublisher for the supplied Namespace.
    • createActivePublisher

      TransformerPublisher createActivePublisher(String subject, DataProvider dataProvider)

      Creates an TransformerPublisher for the specified subject.

       

      A TransformerPublisher publishes updates for subjects matched by the input subject parameter.

      Parameters:
      subject - The subject to register the provider on. Wildcards may be used if they have been enabled.
      dataProvider - The DataProvider that can publish data via this publisher.
      Returns:
      An TransformerPublisher for the supplied subject.
    • createCachingPublisher

      TransformerCachingPublisher createCachingPublisher(Namespace namespace, CachingDataProvider dataProvider)

      Creates an CachingPublisher for the specified namespace.

       

      An CachingPublisher publishes updates that are for subjects within the specified Namespace, to all peers that have subscribed to those subjects.

      Parameters:
      namespace - The Namespace associated with this publisher.
      dataProvider - The CachingDataProvider that can publish data via this publisher.
      Returns:
      An TransformerCachingPublisher for the supplied Namespace.
    • createActiveSubscription

      TransformerActiveSub createActiveSubscription(String subject, SubscriptionListener subscriptionListener)

      Creates an active subscription to an individual subject.

       

      If a data service has been configured that matches the given subject and active peers within that data service are connected, a request will be made to those peers for the specified subject.

       

      All events whose subjects match the method's subject parameter are passed to the given SubscriptionListener.

      To initialise the subscription, it is necessary to call TransformerActiveSub.subscribe() on the returned TransformerActiveSub object.
      Parameters:
      subject - The subject to subscribe to.
      subscriptionListener - A listener to receive events raised for the ActiveSubscription.
      Returns:
      An TransformerActiveSub.
    • createActiveSubscription

      TransformerActiveSub createActiveSubscription(String subject, SubscriptionListener subscriptionListener, int subscriptionFlags)

      Creates an active subscription to an individual subject.

       

      If a data service has been configured that matches the given subject and active peers within that data service are connected, a request will be made to those peers for the specified subject.

       

      All events whose subjects match the method's subject parameter are passed to the given SubscriptionListener.

      To initialise the subscription, it is necessary to call TransformerActiveSub.subscribe() on the returned TransformerActiveSub object.
      Parameters:
      subject - The subject to subscribe to.
      subscriptionListener - A listener to receive events raised for the ActiveSubscription.
      subscriptionFlags - Flags to set on the active subscription. Flags can be F_LISTENER_ACCESSORY and F_DEFAULT
      Returns:
      An TransformerActiveSub.
    • createActiveJsonSubscription

      <T> TransformerActiveSub createActiveJsonSubscription(String subject, SubjectConsumer<T> listener, Class<T> jsonDeserializationType)

      Creates an active subscription to an individual subject that returns Java objects from their serialized JSON form.

      To deserialize the JSON data a JsonHandler must have been installed

      Type Parameters:
      T - the Generic type of the object to deserialize the JSON to.
      Parameters:
      subject - The subject to subscribe to.
      listener - A listener to receive events raised for this subscription.
      jsonDeserializationType - the type of the object to deserialize the JSON to.
      Returns:
      An TransformerActiveSub.
    • createActiveJsonSubscription

      <T> TransformerActiveSub createActiveJsonSubscription(String subject, SubjectConsumer<T> listener, Class<T> jsonDeserializationType, int subscriptionFlags)

      Creates an active subscription to an individual subject that returns Java objects from their serialized JSON form.

      To deserialize the JSON data a JsonHandler must have been installed

      Type Parameters:
      T - the Generic type of the object to deserialize the JSON to.
      Parameters:
      subject - The subject to subscribe to.
      listener - A listener to receive events raised for this subscription.
      jsonDeserializationType - the type of the object to deserialize the JSON to.
      subscriptionFlags - Flags to set on the active subscription. Flags can be F_LISTENER_ACCESSORY and F_DEFAULT
      Returns:
      An TransformerActiveSub.
    • createBroadcastSubscription

      TransformerBroadcastSub createBroadcastSubscription(Namespace namespace, SubscriptionListener subscriptionListener)

      Creates a subscription to many subjects. The scope of the subscription is defined by a Namespace; all events whose subjects match the given Namespace are passed to the given SubscriptionListener.

      To initialise the subscription, it is necessary to call TransformerBroadcastSub.subscribe() on the returned TransformerBroadcastSub object.
      Parameters:
      namespace - The Namespace defining the subjects to subscribe to.
      subscriptionListener - A listener to receive events raised for the TransformerBroadcastSub.
      Returns:
      A TransformerBroadcastSub.
    • createBroadcastSubscription

      TransformerBroadcastSub createBroadcastSubscription(Namespace namespace, SubscriptionListener subscriptionListener, int subscriptionFlags)

      Creates a subscription to many subjects. The scope of the subscription is defined by a Namespace; all events whose subjects match the given Namespace are passed to the given SubscriptionListener.

      To initialise the subscription, it is necessary to call TransformerBroadcastSub.subscribe() on the returned TransformerBroadcastSub object.
      Parameters:
      namespace - The Namespace defining the subjects to subscribe to.
      subscriptionListener - A listener to receive events raised for the TransformerBroadcastSub.
      subscriptionFlags - Flags to set on the active subscription. Flags can be F_LISTENER_ACCESSORY and F_DEFAULT
      Returns:
      A TransformerBroadcastSub.
    • createBroadcastJsonSubscription

      <T> TransformerBroadcastSub createBroadcastJsonSubscription(Namespace namespace, SubjectConsumer<T> listener, Class<T> jsonDeserializationType)

      Creates a subscription to many subjects that return Java objects from their serialized JSON form. The scope of the subscription is defined by a Namespace; all events whose subjects match the given Namespace are passed to the given SubscriptionListener.

      To deserialize the JSON data a JsonHandler must have been installed

      Type Parameters:
      T - the Generic type of the object to deserialize the JSON to.
      Parameters:
      namespace - The Namespace defining the subjects to subscribe to.
      listener - A listener to receive events raised for this subscription.
      jsonDeserializationType - the type of the object to deserialize the JSON to.
      Returns:
      An BroadcastSubscription.
    • createBroadcastJsonSubscription

      <T> TransformerBroadcastSub createBroadcastJsonSubscription(Namespace namespace, SubjectConsumer<T> listener, Class<T> jsonDeserializationType, int subscriptionFlags)

      Creates a subscription to many subjects that return Java objects from their serialized JSON form. The scope of the subscription is defined by a Namespace; all events whose subjects match the given Namespace are passed to the given SubscriptionListener.

      To deserialize the JSON data a JsonHandler must have been installed

      Type Parameters:
      T - the Generic type of the object to deserialize the JSON to.
      Parameters:
      namespace - The Namespace defining the subjects to subscribe to.
      listener - A listener to receive events raised for this subscription.
      jsonDeserializationType - the type of the object to deserialize the JSON to.
      subscriptionFlags - Flags to set on the active subscription. Flags can be F_LISTENER_ACCESSORY and F_DEFAULT
      Returns:
      An BroadcastSubscription.
    • getFieldManager

      FieldManager getFieldManager()
      Gets the datasource field manager
      Returns:
      FieldManager
    • getGlobalPublisher

      TransformerPublisher getGlobalPublisher()
      Gets the global Publisher. This publisher enables messages to be published by the Transformer without registering as an active publisher. Useful if this module needs to publish updates to a subject when a provider has been registered by another module.
      Returns:
      The global publisher
    • setJsonHandler

      void setJsonHandler(JsonHandler handler)
      Sets the JsonHandler that Parses, Formats and serializes Objects to JSON.
      Parameters:
      handler - the JsonHandler to install.