Class PeerEntry

java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.PeerEntry

public class PeerEntry extends ManagedObject
PeerEntry represents a peer DSA configuration entry.
Since:
15.0
Author:
dsm
  • Method Details

    • load

      public void load(Entry entry) throws ConfigOpFailedException
      Description copied from class: ManagedObject
      Load values from an entry. No directory operation should be done in this method.

      Mandatory variables are assigned only after everything is ok. This is done so during re-loading, if there are exceptions and even then the object is used, there is no crash by using mandatory variables that are assumed to have non-null values.

      Specified by:
      load in class ManagedObject
      Parameters:
      entry - Entry representing the object, could be null if the existing entry has to be reloaded
      Throws:
      ConfigOpFailedException - if mandatory attributes are not loaded
    • create

      public static PeerEntry create(IsodeDirectorySession ds, DN dsaDN, PresentationAddress pa, PeerAuthData dspAuthData, PeerAuthData dispAuthData) throws ConfigOpFailedException, ReadFailedException
      Create a peer configuration entry and update DB.
      Parameters:
      ds - Isode directory session, must not be null
      dsaDN - DSA DN, must not be null
      pa - Presentation address, must not be null
      dspAuthData - authentication data to be used for DSP messages, must not be null
      dispAuthData - authentication data to be used for DISP messages, must not be null
      Returns:
      The created peer entry, will not be null
      Throws:
      ReadFailedException - if there is a problem on reading the committed entry back.
      ConfigOpFailedException - if there is any other problem on applying the changes
    • getDSADN

      public DN getDSADN()
      Get the DN of the represented DSA.
      Returns:
      DSA DN, will not be null
    • getPresentationAddress

      public PresentationAddress getPresentationAddress()
      Get the presentation address of the DSA.
      Returns:
      presentation address, will not be null
    • setPA

      public void setPA(PresentationAddress newPa)
      Set the presentation address.
      Parameters:
      newPa - Presentation address, must not be null
    • setAuthInfo

      public void setAuthInfo(Protocol prot, PeerAuthData authData)
      Set protocol specific authentication data.
      Parameters:
      prot - Protocol, must not be null. Currently only DISP & DSP supported
      authData - authentication data to be set, must not be null
    • getAuthData

      public PeerAuthData getAuthData(Protocol prot)
      Get the auth data for the given protocol.
      Parameters:
      prot - Protocol, must not be null. Currently only DISP & DSP supported
      Returns:
      auth data, will not be null for DISP & DSP. Will be null for others
    • toString

      public String toString()
      String representation of the object to be used for display. It contains the DN of the peer.
      Overrides:
      toString in class Object