Interface IDirectorySystem

All Superinterfaces:
AutoCloseable

public interface IDirectorySystem extends AutoCloseable
Directory System interface is used to initialize and shutdown shared directory component. Add and remove notification listeners and create directory sessions IDirectorySession, the latter representing the main API interface for shared directory component.

Before attempting to use IDirectorySystem APIs it is required to initialize MWSLibrary class

  • Method Details

    • getTransport

      Transport getTransport()
      Returns the transport that this implemenation uses to communicate to MWS
      Returns:
      the transport
    • addDirectoryPrincipalListener

      void addDirectoryPrincipalListener(IDirectoryPrincipalListener listener)
      Adds directory principal listener. Experimental method. If you want to use via the CDS REST transport like:
       import com.webmethods.sc.directory.DirectorySystemFactory;
       import com.webmethods.sc.directory.IDirectoryPrincipalListener;
       import com.webmethods.sc.directory.IDirectorySystem;
       import com.webmethods.sc.directory.Transport;
       
       ................................................
       
       try (IDirectorySystem dirSystem = DirectorySystemFactory.getDirectorySystem(Transport.REST)) {
           dirSystem.addDirectoryPrincipalListener(new IDirectoryPrincipalListener() {
       
               public void onAction(String prinicipalID, int action) {
                   // do something
               }
       
           });
       }
       
      , please follow the instructions in SoftwareAG_InstallDir/common/lib/cds/readme.txt.
      Parameters:
      listener -
    • removeDirectoryPrincipalListener

      void removeDirectoryPrincipalListener(IDirectoryPrincipalListener listener)
      Removed directory principal listener
      Parameters:
      listener -
    • addDirectoryRoleResolver

      void addDirectoryRoleResolver(IDirectoryRoleResolver resolver)
      Adds directory role resolver
      Parameters:
      resolver -
    • removeDirectoryRoleResolver

      void removeDirectoryRoleResolver(IDirectoryRoleResolver resolver)
      Removed directory role resolver
      Parameters:
      resolver -
    • createSession

      IDirectorySession createSession() throws DirectoryException
      Created default directory session with no permissions restrictions. This call is very cheap and there is no limitations on how many sessions may be created. Created sessions never expire unless explicitly destroyed It is important that every created session should be closed using destroySession(IDirectorySession) call
      Returns:
      valid default instance of the directory session
      Throws:
      DirectoryException - if there was a failure creating directory session
    • createSession

      IDirectorySession createSession(IDirectoryUser directoryUser)
      Created directory session for given directory principal. Created session will obey permissions set in the MWS for the given principal. This is in particular important when doing directory management activities.

      This call is very cheap and there is no limitations on how many sessions may be created. It is important that every created session should be closed using destroySession(IDirectorySession) call

      Parameters:
      directoryUser - user to create directory session for
      Returns:
      valid instance of directory session for given principal
      Throws:
      DirectoryException - if there was a failure creating directory session
    • destroySession

      @Deprecated void destroySession(IDirectorySession session)
      Deprecated.
      Destroys previously created IDirectorySession
      Parameters:
      session -
    • refreshPrincipal

      void refreshPrincipal(String principalID) throws DirectoryException
      Refreshes any in-memory cached information about given principal.
      Parameters:
      principalID -
      Throws:
      DirectoryException
    • checkPrerequisites

      default void checkPrerequisites() throws DirectoryException
      Check for the presense of any existing pre-requisites and throws exception if the prerequisites are not present.
      Throws:
      DirectoryException
    • close

      default void close()
      Release any resources
      Specified by:
      close in interface AutoCloseable