Class BwHosts

java.lang.Object
org.bedework.util.jmx.ConfBase
org.bedework.calsvc.scheduling.hosts.BwHosts
All Implemented Interfaces:
BwHostsMBean, org.bedework.util.jmx.BaseMBean, org.bedework.util.jmx.ConfBaseMBean, org.bedework.util.logging.Logged

public class BwHosts extends org.bedework.util.jmx.ConfBase implements BwHostsMBean
Author:
douglm
  • Field Summary

    Fields inherited from class org.bedework.util.jmx.ConfBase

    cfg, statusDone, statusFailed, statusInterrupted, statusRunning, statusStopped, statusTimedout, statusUnknown
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a host.
    addIscheduleHost(String hostname, int port, boolean secure, String url, String principal, String pw)
    Add an ischedule host.
    void
    Delete a host.
    find(String name)
     
    get(String name)
     
    getHost(String hostname)
     
    static HostInfo
    Return host information for the given parameter which might be a url or an email address.
    static HostInfo
     
    static org.apache.james.jdkim.api.JDKIM
     
     
     
    (Re)load the configurations
    static void
    Should be called by BwHost instances on key update
    void
    Update a host.

    Methods inherited from class org.bedework.util.jmx.ConfBase

    createObjectName, ensureDir, getConfig, getConfigDirectory, getConfigInfo, getConfigInfo, getConfigInfo, getConfigName, getLogger, getManagementContext, getPathSuffix, getRegisteredMBeans, getServiceName, getServiceObjectName, getStatus, getStore, isRunning, loadConfig, makeObject, register, register, saveConfig, setStatus, setStore, start, stop, unregister, unregister

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.bedework.util.jmx.BaseMBean

    getServiceName, isRunning, start, stop

    Methods inherited from interface org.bedework.util.jmx.ConfBaseMBean

    getConfigName, getStatus, saveConfig, setStatus

    Methods inherited from interface org.bedework.util.logging.Logged

    audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
  • Constructor Details

    • BwHosts

      public BwHosts()
  • Method Details

    • loadConfig

      public String loadConfig()
      Specified by:
      loadConfig in class org.bedework.util.jmx.ConfBase
    • getHost

      public String getHost(String hostname)
      Specified by:
      getHost in interface BwHostsMBean
    • addIscheduleHost

      public String addIscheduleHost(String hostname, int port, boolean secure, String url, String principal, String pw)
      Description copied from interface: BwHostsMBean
      Add an ischedule host.
      Specified by:
      addIscheduleHost in interface BwHostsMBean
      Returns:
      status message
    • listHosts

      public List<String> listHosts()
      Specified by:
      listHosts in interface BwHostsMBean
      Returns:
      all hosts
    • loadConfigs

      public String loadConfigs()
      Description copied from interface: BwHostsMBean
      (Re)load the configurations
      Specified by:
      loadConfigs in interface BwHostsMBean
      Returns:
      status
    • get

      public HostInfo get(String name)
      Parameters:
      name - of host
      Returns:
      corresponding host info or null
    • find

      public BwHost find(String name)
      Parameters:
      name - of host
      Returns:
      BwHost object for name
    • add

      public void add(HostInfo val)
      Add a host.
      Parameters:
      val - host info
    • update

      public void update(HostInfo val)
      Update a host.
      Parameters:
      val - host info
    • delete

      public void delete(HostInfo val)
      Delete a host.
      Parameters:
      val - host info
    • getHostForRecipient

      public static HostInfo getHostForRecipient(String val)
      Return host information for the given parameter which might be a url or an email address. This information may be obtained through discovery of the service.

      The key to the object is the calculated closest domain of the given recipient.

      Parameters:
      val - - a url or an email address
      Returns:
      HostInfo - null if no service available.
    • getHostInfo

      public static HostInfo getHostInfo(String name)
      Parameters:
      name - of host
      Returns:
      host info or null
    • getJDKIM

      public static org.apache.james.jdkim.api.JDKIM getJDKIM()
    • refreshStoredKeys

      public static void refreshStoredKeys()
      Should be called by BwHost instances on key update