Package com.webmethods.sc.directory
Interface IDirectorySystem
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionvoid
Adds directory principal listener.void
Adds directory role resolverdefault void
Check for the presense of any existing pre-requisites and throws exception if the prerequisites are not present.default void
close()
Release any resourcesCreated default directory session with no permissions restrictions.createSession
(IDirectoryUser directoryUser) Created directory session for given directory principal.void
destroySession
(IDirectorySession session) Deprecated.Returns the transport that this implemenation uses to communicate to MWSvoid
refreshPrincipal
(String principalID) Refreshes any in-memory cached information about given principal.void
Removed directory principal listenervoid
Removed directory role resolver
-
Method Details
-
getTransport
Transport getTransport()Returns the transport that this implemenation uses to communicate to MWS- Returns:
- the transport
-
addDirectoryPrincipalListener
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
Removed directory principal listener- Parameters:
listener
-
-
addDirectoryRoleResolver
Adds directory role resolver- Parameters:
resolver
-
-
removeDirectoryRoleResolver
Removed directory role resolver- Parameters:
resolver
-
-
createSession
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 usingdestroySession(IDirectorySession)
call- Returns:
- valid default instance of the directory session
- Throws:
DirectoryException
- if there was a failure creating directory session
-
createSession
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.useIDirectorySession.close()
insteadDestroys previously created IDirectorySession- Parameters:
session
-
-
refreshPrincipal
Refreshes any in-memory cached information about given principal.- Parameters:
principalID
-- Throws:
DirectoryException
-
checkPrerequisites
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 interfaceAutoCloseable
-
IDirectorySession.close()
instead