Class ProductClient

  • All Implemented Interfaces:
    Bootstrappable, ProductClientMBean, Configurable

    public class ProductClient
    extends DefaultConfigurable
    implements ProductClientMBean, Bootstrappable
    The entry point to product distribution. The ProductClient implements the Configurable interface and can use the following configuration parameters:
    receivers
    (Required) A comma separated list of section names that should be loaded as NotificationReceiver objects. Each receiver is a source of notifications for listeners.
    listeners
    (Required) A comma separated list of section names that should be loaded as NotificationListener objects. Each listener receives notifications from receivers.
    logdirectory
    (Optional) Log directory. Default is "log", relative to the current working directory. Log files using a naming convention ProductClient_YYYYMMDD.log.
    loglevel
    (Optional) Default is INFO. One of SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST
    enableTracker
    (Optional) Default is false. Whether or not to send tracker updates to a product tracker. This is generally desirable, but is disabled by default for the paranoid.
    redirectconsole
    (Optional) Default is false. Whether or not to redirect console output to the log file.

    All listeners listen to all receivers for notifications.

    • Field Detail

      • RELEASE_VERSION

        public static final java.lang.String RELEASE_VERSION
        The "release" version number.
        See Also:
        Constant Field Values
      • PDL_CLIENT_VERSION_PROPERTY

        public static final java.lang.String PDL_CLIENT_VERSION_PROPERTY
        Property name used on products for current RELEASE_VERSION.
        See Also:
        Constant Field Values
      • SVN_VERSION

        public static final java.lang.String SVN_VERSION
        SVN Id property.
        See Also:
        Constant Field Values
      • SVN_REVISION

        public static final java.lang.String SVN_REVISION
        SVN Revision property.
        See Also:
        Constant Field Values
      • SVN_LAST_CHANGED_DATE

        public static final java.lang.String SVN_LAST_CHANGED_DATE
        SVN LastChangedDate property.
        See Also:
        Constant Field Values
      • JAR_CONFIG_FILE

        public static final java.lang.String JAR_CONFIG_FILE
        Defaults are loaded from inside the jar file.
        See Also:
        Constant Field Values
      • DEFAULT_CONFIG_FILE

        public static final java.lang.String DEFAULT_CONFIG_FILE
        Default location of config file.
        See Also:
        Constant Field Values
      • CONFIG_FILE_ARGUMENT

        public static final java.lang.String CONFIG_FILE_ARGUMENT
        Custom config file locations.
        See Also:
        Constant Field Values
      • BUILD_ARGUMENT

        public static final java.lang.String BUILD_ARGUMENT
        Run the builder.
        See Also:
        Constant Field Values
      • TRACK_ARGUMENT

        public static final java.lang.String TRACK_ARGUMENT
        Run the tracker.
        See Also:
        Constant Field Values
      • SEND_ARGUMENT

        public static final java.lang.String SEND_ARGUMENT
        Run the builder.
        See Also:
        Constant Field Values
      • RECEIVE_ARGUMENT

        public static final java.lang.String RECEIVE_ARGUMENT
        Run the client.
        See Also:
        Constant Field Values
      • SEARCH_ARGUMENT

        public static final java.lang.String SEARCH_ARGUMENT
        Run the search.
        See Also:
        Constant Field Values
      • USAGE_ARGUMENT

        public static final java.lang.String USAGE_ARGUMENT
        Show usage.
        See Also:
        Constant Field Values
      • RECEIVERS_PROPERTY_NAME

        public static final java.lang.String RECEIVERS_PROPERTY_NAME
        Property containing list of receivers.
        See Also:
        Constant Field Values
      • LISTENERS_PROPERTY_NAME

        public static final java.lang.String LISTENERS_PROPERTY_NAME
        Property containing list of senders.
        See Also:
        Constant Field Values
      • LOGLEVEL_PROPERTY_NAME

        public static final java.lang.String LOGLEVEL_PROPERTY_NAME
        Log level property name.
        See Also:
        Constant Field Values
      • DEFAULT_LOGLEVEL

        public static final java.lang.String DEFAULT_LOGLEVEL
        Default log level is INFO.
        See Also:
        Constant Field Values
      • LOGDIRECTORY_PROPERTY_NAME

        public static final java.lang.String LOGDIRECTORY_PROPERTY_NAME
        Property with location for log directory.
        See Also:
        Constant Field Values
      • DEFAULT_LOGDIRECTORY

        public static final java.lang.String DEFAULT_LOGDIRECTORY
        Default directory for logging.
        See Also:
        Constant Field Values
      • DEFAULT_LOGFILE

        public static final java.lang.String DEFAULT_LOGFILE
        Default location for log file.
        See Also:
        Constant Field Values
      • CONSOLE_REDIRECT_PROPERTY_NAME

        public static final java.lang.String CONSOLE_REDIRECT_PROPERTY_NAME
        Whether or not to redirect stdout and stderr to log file.
        See Also:
        Constant Field Values
      • DEFAULT_CONSOLE_REDIRECT

        public static final java.lang.String DEFAULT_CONSOLE_REDIRECT
        Default console redirect value (don't redirect).
        See Also:
        Constant Field Values
      • ENABLE_TRACKER_PROPERTY_NAME

        public static final java.lang.String ENABLE_TRACKER_PROPERTY_NAME
        Property used to disable tracker updates.
        See Also:
        Constant Field Values
      • ENABLE_ADMIN_SOCKET

        public static final java.lang.String ENABLE_ADMIN_SOCKET
        Property used to enable Admin Socket
        See Also:
        Constant Field Values
      • DEFAULT_ENABLE_ADMIN_SOCKET

        public static final java.lang.String DEFAULT_ENABLE_ADMIN_SOCKET
        Default bool for admin socket property
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductClient

        public ProductClient()
    • Method Detail

      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Description copied from class: DefaultConfigurable
        Process configuration settings. Called before startup().
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class DefaultConfigurable
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • loadListeners

        public void loadListeners​(Config config)
                           throws java.lang.Exception
        Load listeners from a Config object.
        Parameters:
        config - the configuration.
        Throws:
        java.lang.Exception - if error occurs
      • loadReceivers

        public void loadReceivers​(Config config)
                           throws java.lang.Exception
        Load NotificationReceivers from a Config object.
        Parameters:
        config - the configuration
        Throws:
        java.lang.Exception - if error occurs
      • startup

        public void startup()
                     throws java.lang.Exception
        Start up all listeners and receivers.
        Specified by:
        startup in interface Configurable
        Overrides:
        startup in class DefaultConfigurable
        Throws:
        java.lang.Exception - if exceptions occur while starting.
      • shutdown

        public void shutdown()
                      throws java.lang.Exception
        Shut down all receivers and listeners.
        Specified by:
        shutdown in interface Configurable
        Overrides:
        shutdown in class DefaultConfigurable
        Throws:
        java.lang.Exception - if exceptions occur while starting.
      • run

        public void run​(java.lang.String[] args)
                 throws java.lang.Exception
        Entry point into Product Distribution.
        Specified by:
        run in interface Bootstrappable
        Parameters:
        args - argument
        Throws:
        java.lang.Exception - Exception
      • getReceivers

        public java.util.List<NotificationReceiver> getReceivers()
        Returns:
        The list of receivers
      • getListeners

        public java.util.List<NotificationListener> getListeners()
        Returns:
        The list of listeners
      • getUsage

        public static java.lang.String getUsage()
        Returns:
        Product usage
      • getListenerQueueStatus

        public java.lang.String getListenerQueueStatus()
        Specified by:
        getListenerQueueStatus in interface ProductClientMBean
        Returns:
        A string describing the current listener queues.