Interface IUserService
- All Superinterfaces:
IComponent
,IInitializable
,IMetaComponent
Allows manipulation of the local user/group/role list in the DB
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The DB ID of the admin user is 1static final int
the db ID of the everyone group is 4 -
Method Summary
Modifier and TypeMethodDescriptionif this user is from another service, return the corresponding user from this service throws exception if not foundget the admin userGet the ID of the admin userget the everyone groupGet the ID of the everyone groupgetGroupIDByURI
(IURI uri) Looks up a group by a given URI.Generates a list of groups for specified DN prefixgetRoleIDByURI
(IURI uri) Looks up a role by a given URI.getUserDNFromUserUUID
(String uuid) Get DN details for a given UUIDgetUserIDByURI
(IURI uri) Looks up a user by a given URI.Generates a list of users for specified directoryGenerates a list of groups for specified DN prefixdefault int
getUsersCount
(boolean includeInvalid) Returns the number of all initialized users in MWS or for a particular directoryServicedefault int
getUsersCount
(IThingID directoryID) Returns the number of all initialized users in MWS or for a particular directoryServicegetUserUUIDFromDN
(IURI uri) Get User UUID for a given URIEnters group metadata into the DB.Enters group metadata into the DB.initializeUser
(IInitializableUser dsuser) Whenever you need to translate user data from LDAP into a IUser, you must call this function.void
setAdminUserURI
(IURI uri) Set the stored URI for the admin user.void
setEveryoneGroupURI
(IURI uri) Set the stored URI for the everyone group.void
updateDirectoryName
(String oldDir, String newDir) Updates the directory name part of user/group/role dn's to a new name ex: updateDirectoryName("/directory/bellevue/", "/directory/usa/");void
updateDistinguishedName
(String oldDN, String newDN, int type) Updates the Distinguished name of user/groupdefault void
updateUserMemberships
(IInitializableUser dsuser, BigDecimal updateTime) void
updateUUID
(String UUID, String DN, int type) Updates the UUID attribute for a DNMethods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.service.meta2.IMetaComponent
getMetaContext, setMetaContext
-
Field Details
-
ADMIN_DBID
static final int ADMIN_DBIDThe DB ID of the admin user is 1- See Also:
-
EVERYONE_DBID
static final int EVERYONE_DBIDthe db ID of the everyone group is 4- See Also:
-
-
Method Details
-
getAdminUserID
IThingID getAdminUserID()Get the ID of the admin user -
getAdminUser
IUser getAdminUser()get the admin user -
getEveryoneGroupID
IThingID getEveryoneGroupID()Get the ID of the everyone group -
getEveryoneGroup
IGroup getEveryoneGroup()get the everyone group -
initializeUser
Whenever you need to translate user data from LDAP into a IUser, you must call this function. It will load the user's group information and other metadata into the database for access control.- Parameters:
dsuser
- User info from LDAP server- Returns:
- thingID of user.
- Throws:
MetaException
- on DB or LDAP error
-
initializeGroup
Enters group metadata into the DB.- Parameters:
group
- from LDAP- Returns:
- thingID of group
- Throws:
MetaException
- on DB or LDAP error
-
initializeRole
Enters group metadata into the DB.- Parameters:
role
- from LDAP- Returns:
- thingID of group
- Throws:
MetaException
- on DB or LDAP error
-
getUsers
Generates a list of groups for specified DN prefix- Parameters:
dnPrefix
- if null, returns all usersstartIndex
- index of first itemendIndex
- index of last, -1 for all- Returns:
- list of ID's that represent IUser
- Throws:
MetaException
- if invalid directory name or DB error
-
getUsers
Generates a list of users for specified directory- Parameters:
directoryID
- if 0, returns all usersstartIndex
- index of first itemendIndex
- index of last, -1 for all- Returns:
- list of ID's that represent IUser
- Throws:
MetaException
- if invalid directory name or DB error
-
getUsersCount
Returns the number of all initialized users in MWS or for a particular directoryService- Parameters:
directoryID
- - if null returns ALL users count, otherwise count for particular dirService only- Throws:
MetaException
- if invalid directory name or DB error
-
getUsersCount
Returns the number of all initialized users in MWS or for a particular directoryService- Parameters:
includeInvalid
- - if true, the service will include users which are not valid anymore(due to various reasons)- Throws:
MetaException
- if invalid directory name or DB error
-
getGroups
Generates a list of groups for specified DN prefix- Parameters:
dnPrefix
- if null, returns all usersstartIndex
- index of first itemendIndex
- index of last, -1 for all- Returns:
- list of ID's that represent IUser
- Throws:
MetaException
- if invalid directory name or DB error
-
getUserIDByURI
Looks up a user by a given URI. May throw exception if user never initialized- Parameters:
uri
- URI of user- Returns:
- thingID of user or null if not found
- Throws:
MetaException
- if DB error
-
getGroupIDByURI
Looks up a group by a given URI. May throw exception if user never initialized- Parameters:
uri
- URI of group- Returns:
- thingID of group of null if not found
- Throws:
MetaException
- if DB error
-
getRoleIDByURI
Looks up a role by a given URI. May throw exception if user never initialized- Parameters:
uri
- URI of role- Returns:
- thingID of role or null if not found
- Throws:
MetaException
- DB error
-
checkUser
if this user is from another service, return the corresponding user from this service throws exception if not found- Parameters:
userID
- of user to check- Returns:
- new ID
- Throws:
MetaException
-
setAdminUserURI
Set the stored URI for the admin user.- Parameters:
uri
-- Throws:
MetaException
-
setEveryoneGroupURI
Set the stored URI for the everyone group.- Parameters:
uri
-- Throws:
MetaException
-
updateDirectoryName
Updates the directory name part of user/group/role dn's to a new name ex: updateDirectoryName("/directory/bellevue/", "/directory/usa/");- Parameters:
oldDir
-newDir
-- Throws:
MetaException
-
updateDistinguishedName
Updates the Distinguished name of user/group- Parameters:
oldDN
-newDN
-type
-- Throws:
MetaException
-
updateUUID
Updates the UUID attribute for a DN- Parameters:
uuid
-DN
-type
-- Throws:
MetaException
-
getUserUUIDFromDN
Get User UUID for a given URI- Parameters:
uri
-- Throws:
MetaException
-
getUserDNFromUserUUID
Get DN details for a given UUID- Parameters:
uuid
-- Throws:
MetaException
-
updateUserMemberships
default void updateUserMemberships(IInitializableUser dsuser, BigDecimal updateTime) throws PortalException - Throws:
PortalException
-