Class HostInfo

java.lang.Object
org.bedework.util.config.ConfigBase<HostInfo>
org.bedework.calsvc.scheduling.hosts.HostInfo
All Implemented Interfaces:
Serializable, Comparable<HostInfo>, Comparator<HostInfo>, org.bedework.caldav.server.sysinterface.Host, org.bedework.util.logging.Logged

public class HostInfo extends org.bedework.util.config.ConfigBase<HostInfo> implements org.bedework.caldav.server.sysinterface.Host, Comparator<HostInfo>
This class provides information about a host. This should eventually come from some form of dns-like lookup based on the CUA.

Currently we are adding dynamic look-up and DKIM security to the model. Even with that in place there will be a need for hard-wired connections, with and without DKIM.

To increase security we should use some form of authentication. However, if we use servlet authentication we need to create accounts to authenticate against. Those accounts need to be given to administrators at other sites which is probably unacceptable. On the other hand we can run it through the unauthenticated service and check the id/pw ourselves.

The information here can be used for outgoing or can provide us with information to handle incoming requests. For incoming we need to resolve the host name and we then search for an entry prefixed with *IN*. We'll need to progressively shorten the name by removing leading elements until we get a match or there's nothing left. For example, if we get an incoming request for cal.example.org we check:

  1. *IN*cal.example.org
  2. *IN*example.org
  3. *IN*org
  4. *IN*
  5. The last entry, if it exists, provides a default behavior. If absent we disallow all unidentified incoming requests. If present they must satisfy the requirements specified, e.g. DKIM

    To avoid any need to rebuild the db the host info shown here doesn't match up to the column names in the db. At some point we'll fix that.

Author:
Mike Douglass douglm - rpi.edu
See Also:
  • Constructor Details

    • HostInfo

      public HostInfo()
  • Method Details

    • setHostname

      public void setHostname(String val)
      Set the hostname
      Parameters:
      val - hostname
    • getHostname

      public String getHostname()
      Specified by:
      getHostname in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String hostname
    • setPort

      public void setPort(int val)
      Parameters:
      val - port
    • getPort

      public int getPort()
      Specified by:
      getPort in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      int
    • setSecure

      public void setSecure(boolean val)
      Parameters:
      val - true for ssh
    • getSecure

      public boolean getSecure()
      Specified by:
      getSecure in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setLocalService

      public void setLocalService(boolean val)
      Set localService flag
      Parameters:
      val - boolean localService
    • getLocalService

      public boolean getLocalService()
      Specified by:
      getLocalService in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      boolean localService
    • setCaldavUrl

      public void setCaldavUrl(String val)
      Parameters:
      val - String
    • getCaldavUrl

      public String getCaldavUrl()
      Specified by:
      getCaldavUrl in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setCaldavPrincipal

      public void setCaldavPrincipal(String val)
      Parameters:
      val - String
    • getCaldavPrincipal

      public String getCaldavPrincipal()
      Specified by:
      getCaldavPrincipal in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setCaldavCredentials

      public void setCaldavCredentials(String val)
      Parameters:
      val - String
    • getCaldavCredentials

      public String getCaldavCredentials()
      Specified by:
      getCaldavCredentials in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setIScheduleUrl

      public void setIScheduleUrl(String val)
      Parameters:
      val - String
    • getIScheduleUrl

      public String getIScheduleUrl()
      Specified by:
      getIScheduleUrl in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setISchedulePrincipal

      public void setISchedulePrincipal(String val)
      Parameters:
      val - String
    • getISchedulePrincipal

      public String getISchedulePrincipal()
      Specified by:
      getISchedulePrincipal in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setIScheduleCredentials

      public void setIScheduleCredentials(String val)
      Parameters:
      val - String
    • setDkimPublicKeys

      public void setDkimPublicKeys(List<String> val)
      Parameters:
      val - the dkim public keys
    • getDkimPublicKeys

      public List<String> getDkimPublicKeys()
      Specified by:
      getDkimPublicKeys in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String val
    • getIScheduleCredentials

      public String getIScheduleCredentials()
      Specified by:
      getIScheduleCredentials in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • addDkimPublicKey

      public void addDkimPublicKey(String selector, String val)
      Add a dkim public key
      Parameters:
      selector - key selector
      val - the key
    • getDkimPublicKey

      public String getDkimPublicKey(String selector)
      Get a dkim public key
      Parameters:
      selector - for the key
      Returns:
      value or null
    • removeDkimPublicKey

      public void removeDkimPublicKey(String selector)
      Remove a dkim public key
      Parameters:
      selector - for the key
    • setDkimPublicKey

      public void setDkimPublicKey(String selector, String val)
      Set a dkim public key
      Parameters:
      selector - for the key
      val - the key
    • setIScheduleUsePublicKey

      public void setIScheduleUsePublicKey(boolean val)
      Parameters:
      val - boolean
    • getIScheduleUsePublicKey

      public boolean getIScheduleUsePublicKey()
      True if we delivered our public key for use for dkim
      Specified by:
      getIScheduleUsePublicKey in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      boolean
    • setFbUrl

      public void setFbUrl(String val)
      Parameters:
      val - String
    • getFbUrl

      public String getFbUrl()
      Specified by:
      getFbUrl in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      String
    • setSupportsBedework

      public void setSupportsBedework(boolean val)
      Parameters:
      val - boolean true if supports Bedework
    • getSupportsBedework

      public boolean getSupportsBedework()
      Specified by:
      getSupportsBedework in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      boolean true if caldav supported
    • setSupportsCaldav

      public void setSupportsCaldav(boolean val)
      Parameters:
      val - boolean true if supports CalDAV
    • getSupportsCaldav

      public boolean getSupportsCaldav()
      Specified by:
      getSupportsCaldav in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      boolean true if caldav supported
    • setSupportsISchedule

      public void setSupportsISchedule(boolean val)
      Parameters:
      val - boolean true if supports iSchedule
    • getSupportsISchedule

      public boolean getSupportsISchedule()
      Specified by:
      getSupportsISchedule in interface org.bedework.caldav.server.sysinterface.Host
      Returns:
      boolean true if iSchedule supported
    • setSupportsFreebusy

      public void setSupportsFreebusy(boolean val)
      Parameters:
      val - boolean true if supports Freebusy
    • getSupportsFreebusy

      public boolean getSupportsFreebusy()
      Specified by:
      getSupportsFreebusy in interface org.bedework.caldav.server.sysinterface.Host
    • toStringSegment

      public void toStringSegment(org.bedework.base.ToString ts)
      Overrides:
      toStringSegment in class org.bedework.util.config.ConfigBase<HostInfo>
    • compare

      public int compare(HostInfo o1, HostInfo o2)
      Specified by:
      compare in interface Comparator<HostInfo>
    • compareTo

      public int compareTo(HostInfo o2)
      Specified by:
      compareTo in interface Comparable<HostInfo>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.bedework.util.config.ConfigBase<HostInfo>
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Comparator<HostInfo>
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class org.bedework.util.config.ConfigBase<HostInfo>