public final class UserManager extends Object
Creating an iFS user involves creating a CredentialManager user, DirectoryUser, a home folder, a content quota, a primary user profile, and associated objects. Values for the various options can be specified in a Hashtable. These Hashtable values would override the defaults found in the PropertyBundle, IFS.ADK.CreateUserDefinitions. If the values are not specified, the defaults are used.
Deleting an iFS user involves freeing the home folder, the CredentialManager user, DirectoryUser. There exists the option of freeing objects owned by the user or changing the ownership to a specified valid user. Values for the various options would be specifed in a Hashtable.
The Hashtable default values are specified in the below.
Constructor and Description |
---|
UserManager(LibrarySession sess)
Construct UserManager object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearCreatedObjects()
Resets objects to null.
|
protected void |
createContentQuota()
Creates an iFS ContentQuota object that would hold quota
related information.
|
protected void |
createDirectoryServiceUser()
Create DS User.
|
protected void |
createDirectoryUser()
Creates an iFS DirectoryUser.
|
protected void |
createHomeFolder()
Creates an iFS Folder that would serve as the home folder
for DirectoryUser being created.
|
protected void |
createPrimaryUserProfile()
Creates an iFS PrimaryUserProfile that would hold profile
information for DirectoryUser being created.
|
DirectoryUser |
createUser(String username,
String password,
Hashtable options)
Creates a new iFS user.
|
void |
deleteUser(String username,
Hashtable options)
Deletes an iFS user.
|
protected void |
determineCreateUserSettings(PropertyBundle pb,
Hashtable options)
Determines the settings for user creation, first using
the values int the options Hashtable, second using the
values in the PropertyBundle holding the default values.
|
protected void |
freeCredentialManagerUser(String credentialManager,
String distinguishedName)
Frees the CredentialManager user.
|
protected void |
freeDirectoryUser(DirectoryUser user)
Frees the iFS DirectoryUser and changes ownership of
existing objects if desired.
|
protected void |
freeHomeFolder(DirectoryUser user)
Frees the home folder.
|
protected AccessControlList |
getAclFromHashtable(Hashtable ht,
String key)
Allows for multiple specs of a Acl in the specified HT
|
protected Hashtable |
getAclHashtableProperty(PropertyBundle pb,
Hashtable options,
String key)
If a hashtable is specified explicitly, then life is easy;
otherwise, we have to lookup the PropertyBundle from the
specified key, and convert that PB to a Hashtable of Acls
|
protected AccessControlList |
getAclProperty(PropertyBundle pb,
Hashtable options,
String key)
Gets the ACL value from the options Hashtable
if specified, otherwise from the PropertyBundle.
|
protected Boolean |
getBooleanFromHashtable(Hashtable ht,
String key)
Allows for multiple specs of a Boolean in the specified HT
|
protected Boolean |
getBooleanProperty(PropertyBundle pb,
Hashtable options,
String key)
Gets the boolean value from the options Hashtable
if specified, or PropertyBundle, otherwise uses
the default value passed in as a parameter.
|
protected boolean |
getBooleanProperty(PropertyBundle pb,
Hashtable options,
String key,
boolean defaultValue)
Gets the boolean value from the options Hashtable
if specified, otherwise from the PropertyBundle.
|
protected Integer |
getIntegerFromHashtable(Hashtable ht,
String key)
Allows for multiple specs of a Integer in the specified HT
|
protected Integer |
getIntegerProperty(PropertyBundle pb,
Hashtable options,
String key)
Gets the int value from the options Hashtable
if specified, or PropertyBundle, otherwise uses
the default value passed in as a parameter.
|
protected int |
getIntegerProperty(PropertyBundle pb,
Hashtable options,
String key,
int defaultValue)
Gets the int value from the options Hashtable
if specified, otherwise from the PropertyBundle.
|
protected Long |
getLongFromHashtable(Hashtable ht,
String key)
Allows for multiple specs of a Long in the specified HT
|
protected Long |
getLongProperty(PropertyBundle pb,
Hashtable options,
String key)
Gets the long value from the options Hashtable
if specified, or PropertyBundle, otherwise uses
the default value passed in as a parameter.
|
protected long |
getLongProperty(PropertyBundle pb,
Hashtable options,
String key,
long defaultValue)
Gets the long value from the options Hashtable
if specified, otherwise from the PropertyBundle.
|
protected String |
getStringFromHashtable(Hashtable ht,
String key)
Allows for multiple specs of a String in the specified HT
|
protected String |
getStringProperty(PropertyBundle pb,
Hashtable options,
String key)
Gets the String value from the options Hashtable
if specified, otherwise from the PropertyBundle.
|
protected String |
getStringProperty(PropertyBundle pb,
Hashtable options,
String key,
String defaultValue)
Gets the String value from the options Hashtable
if specified, or PropertyBundle, otherwise uses
the default value passed in as a parameter.
|
protected boolean |
isDefinedInHashtable(Hashtable options,
String key)
Checks whether this key is defined int he Hashtable already.
|
boolean |
isValidCreateUserOption(String optionName)
Checks if valid option.
|
ClassDomain |
lookupCreateUserOptionClassDomain(String optionName)
Returns ClassDomain (if any; null if none) for the option
|
int |
lookupCreateUserOptionDatatype(String optionName)
Returns Attribute.ATTRIBUTEDATATYPE_UNKNOWN if no such option;
else returns datatypes defined in beans.Attribute
|
protected DirectoryUser |
lookupUser(String username)
Looks up an iFS DirectoryUser, and throw an exception if not found.
|
Hashtable |
normalizeOptionsHashtable(Hashtable oldTable)
Normalizes the options Hashtable so that the keys
are all uppercase.
|
protected void |
registerCreateUserOption(String optionName,
int datatype,
ClassDomain domain)
Register one option.
|
protected void |
registerCreateUserOptions()
Registers the options for user creation.
|
protected void |
replaceDirectoryServicePassword()
Replaces DS password.
|
protected String |
resolveName(String wholeName,
String prefix,
String suffix)
Concatenates the prefix, name, suffix.
|
protected void |
rollbackDirectoryServiceUserCreation()
Deletes DS user.
|
public static final String USERNAME
public static final String PASSWORD
public static final String USER_CLASSNAME
public static final String SHOULD_CREATE_CREDENTIAL_MANAGER_USER
public static final String REPLACE_CREDENTIAL_MANAGER_PASSWORD
public static final String CREDENTIAL_MANAGER
public static final String CAN_CHANGE_PASSWORD
public static final String ADMIN_ENABLED
public static final String SYSTEM_ADMIN_ENABLED
public static final String HAS_PRIMARY_USER_PROFILE
public static final String HAS_HOME_FOLDER
public static final String HOME_FOLDER_ROOT
public static final String HOME_FOLDER_HAS_POLICY_BUNDLE
public static final String HAS_CONTENT_QUOTA
public static final String CONTENT_QUOTA_ENABLED
public static final String CONTENT_QUOTA_ALLOCATED_STORAGE
public static final String READ_INDICATION_ENABLED
public static final String EMAIL_ADDRESS
public static final String DISTINGUISHED_NAME
public static final String PRIMARY_USER_PROFILE_NAME
public static final String CONTENT_QUOTA_NAME
public static final String HOME_FOLDER_NAME
public static final String HOME_FOLDER_DESCRIPTION
public static final String DEFAULT_ACLS_BUNDLE_NAME
public static final String HOME_FOLDER_POLICY_BUNDLE_NAME
public static final String PRIMARY_USER_PROFILE_LANGUAGE
public static final String PRIMARY_USER_PROFILE_CHARACTERSET
public static final String PRIMARY_USER_PROFILE_LOCALE
public static final String PRIMARY_USER_PROFILE_TIMEZONE
public static final String PRIMARY_USER_PROFILE_DISPLAYNAME
public static final String PRIMARY_USER_PROFILE_NAME_PREFIX
public static final String CONTENT_QUOTA_NAME_PREFIX
public static final String HOME_FOLDER_NAME_PREFIX
public static final String HOME_FOLDER_DESCRIPTION_PREFIX
public static final String DEFAULT_ACLS_BUNDLE_NAME_PREFIX
public static final String HOME_FOLDER_POLICY_BUNDLE_NAME_PREFIX
public static final String PRIMARY_USER_PROFILE_NAME_SUFFIX
public static final String CONTENT_QUOTA_NAME_SUFFIX
public static final String HOME_FOLDER_NAME_SUFFIX
public static final String HOME_FOLDER_DESCRIPTION_SUFFIX
public static final String DEFAULT_ACLS_BUNDLE_NAME_SUFFIX
public static final String HOME_FOLDER_POLICY_BUNDLE_NAME_SUFFIX
public static final String DIRECTORY_USER_DESCRIPTION
public static final String DIRECTORY_USER_ACL
public static final String HOME_FOLDER_POLICY_BUNDLE_ACL
public static final String HOME_FOLDER_ACL
public static final String DEFAULT_ACLS_BUNDLE_ACL
public static final String CONTENT_QUOTA_ACL
public static final String PRIMARY_USER_PROFILE_ACL
public static final String DEFAULT_ACLS
public static final String FREE_DIRECTORY_USER
public static final String FREE_CREDENTIAL_MANAGER_USER
public static final String FREE_HOME_FOLDER
public static final String FREE_POLICY_BUNDLE
public static final String CHANGE_OWNER
public static final String NEW_OWNER_USER_NAME
public static final String ACL_BUNDLE_ALL_PUBLISHED
public static final String ACL_BUNDLE_FOR_ADMIN
protected LibrarySession m_Session
protected static Hashtable m_CreateUserOptionRegistry
protected String m_UserName
protected String m_Password
protected String m_UserClassName
protected String m_CredentialManager
protected boolean m_ShouldCreateCredentialManagerUser
protected boolean m_ReplaceCredentialManagerPassword
protected boolean m_AdminEnabled
protected boolean m_SystemAdminEnabled
protected boolean m_CanChangePassword
protected boolean m_HasPrimaryUserProfile
protected boolean m_HasHomeFolder
protected boolean m_HasContentQuota
protected boolean m_ContentQuotaEnabled
protected boolean m_ReadIndicationEnabled
protected boolean m_HomeFolderHasPolicyBundle
protected long m_ContentQuotaAllocatedStorage
protected String m_HomeFolderRoot
protected AccessControlList m_DirectoryUserAcl
protected AccessControlList m_HomeFolderPolicyBundleAcl
protected AccessControlList m_HomeFolderAcl
protected AccessControlList m_DefaultAclsBundleAcl
protected AccessControlList m_ContentQuotaAcl
protected AccessControlList m_PrimaryUserProfileAcl
protected String m_DistinguishedName
protected String m_DirectoryUserDescription
protected String m_PrimaryUserProfileName
protected String m_ContentQuotaName
protected String m_HomeFolderName
protected String m_HomeFolderDescription
protected String m_DefaultAclsBundleName
protected String m_HomeFolderPolicyBundleName
protected String m_EmailAddress
protected String m_PrimaryUserProfileNamePrefix
protected String m_ContentQuotaNamePrefix
protected String m_HomeFolderNamePrefix
protected String m_HomeFolderDescriptionPrefix
protected String m_DefaultAclsBundleNamePrefix
protected String m_HomeFolderPolicyBundleNamePrefix
protected String m_PrimaryUserProfileNameSuffix
protected String m_ContentQuotaNameSuffix
protected String m_HomeFolderNameSuffix
protected String m_HomeFolderDescriptionSuffix
protected String m_DefaultAclsBundleNameSuffix
protected String m_HomeFolderPolicyBundleNameSuffix
protected String m_DefaultAcls
protected Hashtable m_DefaultAclsTable
protected DirectoryUser m_CreatedDirectoryUser
protected Folder m_CreatedHomeFolder
protected ContentQuota m_CreatedContentQuota
protected PrimaryUserProfile m_CreatedPrimaryUserProfile
protected PolicyPropertyBundle m_CreatedPolicyPropertyBundle
protected PropertyBundle m_CreatedDefaultAclsPropertyBundle
protected FolderPathResolver m_Resolver
protected boolean m_ChangeOwner
protected String m_NewOwnerUserName
protected boolean m_FreeDirectoryUser
protected boolean m_FreeCredentialManagerUser
protected boolean m_FreeHomeFolder
protected boolean m_FreePolicyBundle
protected String m_PrimaryUserProfileLanguage
protected String m_PrimaryUserProfileCharacterSet
protected String m_PrimaryUserProfileTimeZone
protected String m_PrimaryUserProfileLocale
protected String m_PrimaryUserProfileDisplayName
public UserManager(LibrarySession sess) throws IfsException
sess
- LibrarySession on which to manage users.IfsException
public DirectoryUser createUser(String username, String password, Hashtable options) throws IfsException
username
- user name; can also be specified
in the Hashtable as option UserNamepassword
- password; can also be specified
in the Hashtable as option Passwordoptions
- Hashtable of options which override
the options contained in the named
PropertyBundle IFS.ADK.CreateUserDefinitions.IfsException
- if the operation failsprotected void clearCreatedObjects()
protected void createDirectoryServiceUser() throws IfsException
IfsException
- if the operation fails.protected void replaceDirectoryServicePassword() throws IfsException
IfsException
- if the operation fails.protected void rollbackDirectoryServiceUserCreation()
protected void createDirectoryUser() throws IfsException
IfsException
- if the operation fails.protected void createHomeFolder() throws IfsException
IfsException
- if the operation fails.protected void createContentQuota() throws IfsException
IfsException
- if the operation fails.protected void createPrimaryUserProfile() throws IfsException
IfsException
- if the operation fails.protected void determineCreateUserSettings(PropertyBundle pb, Hashtable options) throws IfsException
IfsException
- if the operation fails.protected void registerCreateUserOptions() throws IfsException
IfsException
- if the operation fails.protected void registerCreateUserOption(String optionName, int datatype, ClassDomain domain) throws IfsException
IfsException
- if the operation fails.public boolean isValidCreateUserOption(String optionName) throws IfsException
IfsException
- if the operation fails.public int lookupCreateUserOptionDatatype(String optionName) throws IfsException
IfsException
- if the operation fails.public ClassDomain lookupCreateUserOptionClassDomain(String optionName) throws IfsException
IfsException
- if the operation fails.protected String resolveName(String wholeName, String prefix, String suffix)
protected String getStringProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected String getStringProperty(PropertyBundle pb, Hashtable options, String key, String defaultValue) throws IfsException
IfsException
- if the operation fails.protected boolean getBooleanProperty(PropertyBundle pb, Hashtable options, String key, boolean defaultValue) throws IfsException
IfsException
- if the operation fails.protected Boolean getBooleanProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected int getIntegerProperty(PropertyBundle pb, Hashtable options, String key, int defaultValue) throws IfsException
IfsException
- if the operation fails.protected Integer getIntegerProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected long getLongProperty(PropertyBundle pb, Hashtable options, String key, long defaultValue) throws IfsException
IfsException
- if the operation fails.protected Long getLongProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected AccessControlList getAclProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected Hashtable getAclHashtableProperty(PropertyBundle pb, Hashtable options, String key) throws IfsException
IfsException
- if the operation fails.protected String getStringFromHashtable(Hashtable ht, String key) throws IfsException
IfsException
- if the operation fails.protected Boolean getBooleanFromHashtable(Hashtable ht, String key) throws IfsException
IfsException
- if the operation fails.protected Integer getIntegerFromHashtable(Hashtable ht, String key) throws IfsException
IfsException
- if the operation fails.protected Long getLongFromHashtable(Hashtable ht, String key) throws IfsException
IfsException
- if the operation fails.protected AccessControlList getAclFromHashtable(Hashtable ht, String key) throws IfsException
IfsException
- if the operation fails.protected boolean isDefinedInHashtable(Hashtable options, String key)
public void deleteUser(String username, Hashtable options) throws IfsException
username
- user name; can also be specified
in the Hashtable as option UserNameoptions
- Hashtable of options which override
the options contained in the named
PropertyBundle IFS.ADK.CreateUserDefinitions.IfsException
- if invalid args are specifiedprotected void freeHomeFolder(DirectoryUser user) throws IfsException
user
- the user to processIfsException
- if the operation fails.protected void freeCredentialManagerUser(String credentialManager, String distinguishedName) throws IfsException
credentialManager
- the CredentialManager to usedistinguishedName
- the distinguished name of the user to freeIfsException
- if the operation fails.protected void freeDirectoryUser(DirectoryUser user) throws IfsException
user
- the user to freeIfsException
- if the operation fails.protected DirectoryUser lookupUser(String username) throws IfsException
IfsException
- if the operation fails.public Hashtable normalizeOptionsHashtable(Hashtable oldTable) throws IfsException
oldTable
- original mixed-case keys HashtableIfsException
- if the operation failsCopyright © 2023. All rights reserved.