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. |
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 void |
beginConversation()
Mark the current transient conversation long-running.
|
void |
close()
Release any resources
|
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 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 |
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.
|
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. |
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 boolean |
isConversation()
Returns if the conversation is marked transient or long-running
|
List<IDirectoryPrincipalAttributeProvider> |
listAttributeProviders(int principalType)
Gets all registered principal attribute providers
IDirectoryPrincipalAttributeProvider |
List<IDirectoryService> |
listDirectoryServices()
Retrieves the list of all 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 |
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.
|
void |
modifyPrincipal(String principalID,
Map 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.
|
static final String CURRENT_USER
lookupPrincipalByID(String)
method.
Currently logged it user is only valid inside My webMethods ServerList<IDirectoryService> listDirectoryServices() throws DirectoryException
IDirectoryService
s in the
search order as defined in MWS directory services administrationDirectoryException
IDirectoryService getDirectoryService(String directoryServiceID) throws DirectoryException
IDirectoryService
by its ID.directoryServiceID
- 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 lookupPrincipalByID(String principalID) throws DirectoryException
principalID
- unique principal IDDirectoryException
IDirectoryPrincipal lookupPrincipalByAlias(String principalAlias) throws DirectoryException
principalAlias
- MWS defined principal aliasDirectoryException
IDirectoryPagingCookie createPagingCookie(String directoryServiceID) throws DirectoryException
searchDirectory(String, int, DirectorySearchQuery, IDirectoryPagingCookie)
method. Each session may maintain only a single cookie at a time, this
method will destroy any previously created cookieDirectoryException
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
IDirectoryUser authenticateUser(String username, String password) throws DirectoryException
username
- password
- DirectoryException
- 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 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 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()