public interface IDirectorySession extends AutoCloseable
Modifier and Type | Field and Description |
---|---|
static String |
CURRENT_USER
Identifies currently logged in user to be used in the
lookupPrincipalByID(String) method. |
static String |
ROLE_COOKIE_ID |
Modifier and Type | Method and Description |
---|---|
void |
addPrincipalToGroup(String principalID,
String groupID)
Adds a principal to a group.
|
void |
addPrincipalToRole(String principalID,
String roleID)
Adds a principal to a role.
|
IDirectoryUser |
authenticateUser(String username,
String password)
Attempts to authenticate the user based on the credentials with any
registered directory service in their configured search order.
|
default IDirectoryUser |
authenticateUser(String username,
String password,
String oneTimePassword)
Attempts to authenticate the user based on the credentials with any
registered directory service in their configured search order.
|
default void |
beginConversation()
Mark the current transient conversation long-running.
|
void |
close()
Release any resources
|
IDirectoryService |
createDirectoryService(String name,
IDirectoryService.DIRECTORY_XTYPES type,
Map<String,Object> properties)
Creates an instance of
IDirectoryService from the supplied parameters. |
IDirectoryPagingCookie |
createPagingCookie(String directoryServiceID)
Creates instance of directory paging cookie to be used for
searchDirectory(String, int, DirectorySearchQuery, IDirectoryPagingCookie)
method. |
IDirectoryPrincipal |
createPrincipal(String directoryServiceID,
int principalType,
String name,
Map<String,? extends Object> properties)
Creates a new principal group or user associated with this specified directory service.
|
IDirectoryRole |
createRole(int roleType,
String name,
Map<String,?> properties)
Deprecated.
Use
createRole(String, String, Map) instead |
IDirectoryRole |
createRole(String roleType,
String name,
Map<String,?> properties)
Creates new role of the specified type
|
void |
deleteDirectoryService(String directoryServiceID)
Deletes a
IDirectoryService by its ID. |
void |
deletePrincipal(String principalID)
Deletes a principal by its unique ID
|
void |
destroyPagingCookie(IDirectoryPagingCookie directoryPagingCookie)
Destroys directory paging cookie and frees up any associated resources
|
default void |
endConversation()
Mark the current long-running conversation transient.
|
default Object |
getAttribute(String principalID,
String papID,
String attrName) |
Map<String,Object> |
getAttributeExtendedInfo(String principalID,
String principalAttributeProviderID,
String attributeName)
Returns extended information about attributes of the given provider (only if provider supports this
|
List<String> |
getAttributeNames(String principalID,
String principalAttributeProviderID)
List defined attribute names for the specified attribute provider
|
IDirectoryPrincipalAttributeProvider |
getAttributeProvider(String attributeProviderID)
Gets
IDirectoryPrincipalAttributeProvider by its ID |
List<String> |
getAttributeTitles(String principalID,
String principalAttributeProviderID,
Locale locale)
List defined user friendly attribute titles for the specified attribute
provider
|
ICertificateManager |
getCertificateManager()
Returns instance of certificate manager
|
IDirectoryService |
getDirectoryService(String directoryServiceID)
Returns instance of
IDirectoryService by its ID. |
IDirectoryService |
getDirectoryServiceByName(String directoryServiceID)
Returns instance of
IDirectoryService by its ID. |
Map<String,Object> |
getDirectoryServiceDefaultValues(IDirectoryService.DIRECTORY_XTYPES type,
String dirSubType)
Retruns a Map with the initial directory parameters.
|
IGdprConfig |
getGdprConfig() |
List<IDirectoryGroup> |
getGroupMembership(String principalID)
Retrieve the group membership for this principal
|
List<IDirectoryPrincipal> |
getMembers(String principalID)
Returns members of the group or role.
|
List<IDirectoryRole> |
getRoleMembership(String principalID)
Retrieve the role membership for this principal
|
default ITOTPConfiguration |
getTotpConfig() |
default Map<String,TypedAttribute> |
getTypedAttributes(String papID,
String principalURI) |
int |
getUsersCount(IDirectoryService dirSvc)
Lists all existing users for a particular dir service, or for all dir services if null provided
|
default boolean |
isConversation()
Returns if the conversation is marked transient or long-running
|
List<IDirectoryService> |
listAllDirectoryServices()
Retrieves the list of all registered
IDirectoryService s ( regardless of state ) in the
search order as defined in MWS directory services administration |
List<IDirectoryPrincipalAttributeProvider> |
listAttributeProviders(int principalType)
Gets all registered principal attribute providers
IDirectoryPrincipalAttributeProvider |
List<IDirectoryService> |
listDirectoryServices()
Retrieves the list of all 'enabled and running' registered
IDirectoryService s in the
search order as defined in MWS directory services administration |
List<IDirectoryRole> |
listRoles()
Lists all roles defined in the system
|
IDirectoryPrincipal |
lookupPrincipalByAlias(String principalAlias)
Attempts to lookup a principal by well known alias
|
IDirectoryPrincipal |
lookupPrincipalByDN(String principalDN,
int type)
Attempts to lookup a principal by their dn.
|
IDirectoryPrincipal |
lookupPrincipalByDN(String principalDN,
int type,
String dirServiceName)
Attempts to lookup a principal by their dn.
|
IDirectoryPrincipal |
lookupPrincipalByID(String principalID)
Attempts to lookup a principal by their unique ID.
|
IDirectoryPrincipal |
lookupPrincipalByName(String principalName,
int type)
Attempts to lookup a principal by their name.
|
IDirectoryPrincipal |
lookupUserByUUID(String principalUUID,
String dirServiceName)
Attempts to lookup a user by their unique ID.
|
void |
modifyPrincipal(String principalID,
Map<String,? extends Object> attributes)
Sets attribute values for the principal.
|
void |
removePrincipalFromGroup(String principalID,
String groupID)
Removes a principal from a group.
|
void |
removePrincipalFromRole(String principalID,
String roleID)
Removes a principal from a role.
|
List<IDirectoryPrincipal> |
searchDirectory(String directoryServiceID,
int principalType,
DirectorySearchQuery query,
IDirectoryPagingCookie directoryPagingCookie)
Search principals in the given directory service.
|
List<IDirectoryRole> |
searchRoles(IDirectoryPagingCookie pagingCookie,
int maxResults)
Searches for roles defined in the system based on the pagingCookie and maxResults
values
|
IDirectoryService |
updateDirectoryService(String directoryServiceID,
Map<String,Object> properties)
Creates an instance of
IDirectoryService from the supplied parameters. |
void |
updateDirectoryServicesOrder(List<String> orderedDirServices)
Updates the search order of all registered
IDirectoryService s as defined in MWS
directory services administration. |
void |
updateGdprConfig(IGdprConfig config) |
default void |
updateTotpConfig(ITOTPConfiguration config) |
static final String CURRENT_USER
lookupPrincipalByID(String)
method.
Currently logged it user is only valid inside My webMethods Serverstatic final String ROLE_COOKIE_ID
List<IDirectoryService> listDirectoryServices() throws DirectoryException
IDirectoryService
s in the
search order as defined in MWS directory services administrationDirectoryException
List<IDirectoryService> listAllDirectoryServices() throws DirectoryException
IDirectoryService
s ( regardless of state ) in the
search order as defined in MWS directory services administrationDirectoryException
void updateDirectoryServicesOrder(List<String> orderedDirServices) throws DirectoryException
IDirectoryService
s as defined in MWS
directory services administration. All directory services must be supplied for this service.
Partial re-ordering is not supported.directoryServiceID
- - the new order for directory services. Supply the URI of each service in the list.DirectoryException
IDirectoryService getDirectoryService(String directoryServiceID) throws DirectoryException
IDirectoryService
by its ID.directoryServiceID
- DirectoryException
- if directory service ID is invalidIDirectoryService getDirectoryServiceByName(String directoryServiceID) throws DirectoryException
IDirectoryService
by its ID.directoryServiceID
- DirectoryException
- if directory service ID is invalidvoid deleteDirectoryService(String directoryServiceID) throws DirectoryException
IDirectoryService
by its ID.directoryServiceID
- DirectoryException
- if directory service ID is invalidIDirectoryService createDirectoryService(String name, IDirectoryService.DIRECTORY_XTYPES type, Map<String,Object> properties) throws DirectoryException
IDirectoryService
from the supplied parameters.name
- - name of the directory servicetype
- - type of the directory serviceproperties
- - all attributes of the directory service to be set.DirectoryException
- if directory service ID is invalidIDirectoryService updateDirectoryService(String directoryServiceID, Map<String,Object> properties) throws DirectoryException
IDirectoryService
from the supplied parameters.directoryServiceID
- - the id of the directory serviceproperties
- - all attributes of the directory service to be updated.DirectoryException
- if directory service ID is invalidMap<String,Object> getDirectoryServiceDefaultValues(IDirectoryService.DIRECTORY_XTYPES type, String dirSubType) throws DirectoryException
directoryServiceID
- - the id of the directory serviceproperties
- - all attributes of the directory service to be updated.DirectoryException
- if directory service ID is invalidIDirectoryPrincipal lookupPrincipalByName(String principalName, int type) throws DirectoryException
IDirectoryPrincipal.TYPE_GROUP
or
IDirectoryPrincipal.TYPE_USER
Lookup a role by its name if type
is IDirectoryPrincipal.TYPE_ROLE
principalName
- type
- principal type one of the
IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
IDirectoryPrincipal.TYPE_ROLE
DirectoryException
IDirectoryPrincipal lookupPrincipalByDN(String principalDN, int type) throws DirectoryException
IDirectoryPrincipal.TYPE_GROUP
or
IDirectoryPrincipal.TYPE_USER
Lookup a role by its DN if type is
IDirectoryPrincipal.TYPE_ROLE
principalDN
- type
- principal type one of the
IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
IDirectoryPrincipal.TYPE_ROLE
DirectoryException
IDirectoryPrincipal lookupPrincipalByDN(String principalDN, int type, String dirServiceName) throws DirectoryException
IDirectoryPrincipal.TYPE_GROUP
or
IDirectoryPrincipal.TYPE_USER
Lookup a role by its DN if type is
IDirectoryPrincipal.TYPE_ROLE
principalDN
- type
- principal type one of the
IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
DirectoryException
IDirectoryPrincipal lookupPrincipalByID(String principalID) throws DirectoryException
principalID
- unique principal IDDirectoryException
IDirectoryPrincipal lookupUserByUUID(String principalUUID, String dirServiceName) throws DirectoryException
principalUUID
- - unique principal UUIDdirServiceName
- - directory service within which to look forDirectoryException
IDirectoryPrincipal lookupPrincipalByAlias(String principalAlias) throws DirectoryException
principalAlias
- MWS defined principal aliasDirectoryException
IDirectoryPagingCookie createPagingCookie(String directoryServiceID) throws DirectoryException
searchDirectory(String, int, DirectorySearchQuery, IDirectoryPagingCookie)
method. All cookies created by this method will be destroyed when close()
is invoked.
If ROLE_COOKIE_ID
is provided as directoryServiceID, a role cookie will be createddirectoryServiceID
- - directoryID(URI) or ROLE_COOKIE_ID
DirectoryException
void destroyPagingCookie(IDirectoryPagingCookie directoryPagingCookie)
directoryPagingCookie
- List<IDirectoryPrincipal> searchDirectory(String directoryServiceID, int principalType, DirectorySearchQuery query, IDirectoryPagingCookie directoryPagingCookie) throws DirectoryException
listRoles()
API insteaddirectoryServiceID
- ID of the directory service to search.principalType
- principal type one of the
IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
query
- directory query. If null all principals will be returneddirectoryPagingCookie
- directory paging cookie used for paging/sorting of directory
search results.DirectoryException
List<IDirectoryRole> listRoles() throws DirectoryException
DirectoryException
int getUsersCount(IDirectoryService dirSvc) throws DirectoryException
dirSvc
- - the directory service for which to count existing(created in MWS) users, or ALL users if null provided.DirectoryException
List<IDirectoryRole> searchRoles(IDirectoryPagingCookie pagingCookie, int maxResults) throws DirectoryException
pagingCookie
- directory paging cookie used for paging/sorting of directory search results.
To create such a cookie, invoke createPagingCookie(java.lang.String)
with parameter ROLE_COOKIE_ID
,maxResults
- limits the result list to the maxResults valueDirectoryException
IDirectoryUser authenticateUser(String username, String password) throws DirectoryException
username
- password
- DirectoryException
- if there was a problem authenticating this userdefault IDirectoryUser authenticateUser(String username, String password, String oneTimePassword) throws DirectoryException
username
- password
- time-based
- one-time password for two-factor identificationDirectoryException
- if there was a problem authenticating this userList<IDirectoryPrincipalAttributeProvider> listAttributeProviders(int principalType) throws DirectoryException
IDirectoryPrincipalAttributeProvider
principalType
- one of the IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
IDirectoryPrincipal.TYPE_ROLE
DirectoryException
IDirectoryPrincipalAttributeProvider getAttributeProvider(String attributeProviderID) throws DirectoryException
IDirectoryPrincipalAttributeProvider
by its IDDirectoryException
List<String> getAttributeNames(String principalID, String principalAttributeProviderID) throws DirectoryException
principalID
- ID of the principalprincipalAttributeProviderID
- ID of the principal attribute providerDirectoryException
List<String> getAttributeTitles(String principalID, String principalAttributeProviderID, Locale locale) throws DirectoryException
principalID
- ID of the principalprincipalAttributeProviderID
- ID of the principal attribute providerlocale
- desired locale for attribute titlesDirectoryException
Map<String,Object> getAttributeExtendedInfo(String principalID, String principalAttributeProviderID, String attributeName) throws DirectoryException
principalID
- ID of the principalprincipalAttributeProviderID
- ID of the principal attribute providerattributeName
- attribute nameDirectoryException
IDirectoryPrincipal createPrincipal(String directoryServiceID, int principalType, String name, Map<String,? extends Object> properties) throws DirectoryException
directoryServiceID
- ID of the directory service to create principal ID.type
- of the principal to create one of the
IDirectoryPrincipal.TYPE_USER
,
IDirectoryPrincipal.TYPE_GROUP
name
- of the principal (UID)properties
- name-value pairsDirectoryException
@Deprecated IDirectoryRole createRole(int roleType, String name, Map<String,?> properties) throws DirectoryException
createRole(String, String, Map)
insteadroleType
- type of the role to create IDirectoryRole
name
- of the role (UID)properties
- name-value pairs of properties assigned to the new roleDirectoryException
IDirectoryRole createRole(String roleType, String name, Map<String,?> properties) throws DirectoryException
roleType
- type of the role to create IDirectoryRole
nameof
- the role (UID)properties
- name-value pairs of properties assigned to the new roleDirectoryException
void deletePrincipal(String principalID) throws DirectoryException
principalID
- DirectoryException
void addPrincipalToGroup(String principalID, String groupID) throws DirectoryException
IDirectoryService
principalID
- ID of the principal to be added to the groupgroupID
- ID of the group to add principal toDirectoryException
void addPrincipalToRole(String principalID, String roleID) throws DirectoryException
IDirectoryRole.ROLE_TYPE_STATIC
role supports this operationprincipalID
- ID of the principal to be added to the roleroleID
- ID of the role to add principal toDirectoryException
void removePrincipalFromGroup(String principalID, String groupID) throws DirectoryException
IDirectoryService
principalID
- ID of the principal to be removed from the groupgroupID
- ID of the group to remove principal fromDirectoryException
void removePrincipalFromRole(String principalID, String roleID) throws DirectoryException
IDirectoryRole.ROLE_TYPE_STATIC
role supports this operationprincipalID
- ID of the principal to be removed from the roleroleID
- ID of the role to remove principal fromDirectoryException
List<IDirectoryGroup> getGroupMembership(String principalID) throws DirectoryException
principalID
- ID of the principal to get group membership forIDirectoryGroup
principal is member ofDirectoryException
List<IDirectoryRole> getRoleMembership(String principalID) throws DirectoryException
principalID
- IF of the principal to get role membership forIDirectoryRole
principal is member ofDirectoryException
List<IDirectoryPrincipal> getMembers(String principalID) throws DirectoryException
IDirectoryRole.ROLE_TYPE_STATIC
role supports this
operationprincipalID
- role or group IDDirectoryException
void modifyPrincipal(String principalID, Map<String,? extends Object> attributes) throws DirectoryException
principalID
- ID of the principal to be updatedattributes
- attribute values to be setDirectoryException
ICertificateManager getCertificateManager()
void close()
close
in interface AutoCloseable
default void beginConversation()
#end()
is invoked.default void endConversation()
default boolean isConversation()
void updateGdprConfig(IGdprConfig config)
IGdprConfig getGdprConfig()
default void updateTotpConfig(ITOTPConfiguration config)
default ITOTPConfiguration getTotpConfig()
default Map<String,TypedAttribute> getTypedAttributes(String papID, String principalURI) throws DirectoryException
DirectoryException
default Object getAttribute(String principalID, String papID, String attrName) throws DirectoryException
DirectoryException