com.ibm.as400.access

Class User

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    UserGroup


    public class User
    extends Object
    implements Serializable
    Represents a user profile object on the system.

    Note: User attribute information is cached internally in the User object, after the first retrieval. To force an update of the cached information, call refresh().

    Note: Calling any of the attribute getters for the first time (for a given User instance) will result in an implicit call to refresh(). If any exceptions are thrown by the implicit refresh(), they are logged under trace category Trace.ERROR and ignored. However, if an exception occurs during an explicit call to refresh(), it will be thrown to the caller.

    Implementation note: This class internally calls the Retrieve User Information (QSYRUSRI) API for the methods that retrieve user profile information. In order to use those methods, the caller must have *READ authority to the user profile object. This class internally calls the Change User Profile (CHGUSRPRF) command for the methods that change user profile information. In order to use those methods, the caller must have security administrator (*SECADM) special authority, and object management (*OBJMGT) and use (*USE) authorities to the user profile being changed.

    See Also:
    DirectoryEntry, UserList, UserGroup, Serialized Form

    • Method Detail

      • getAccountingCode

        public String getAccountingCode()
        Retrieves the accounting code that is associated with this user.
        Returns:
        The accounting code that is associated with this user. If the user does not have an accounting code, an empty string ("") is returned.
        See Also:
        setAccountingCode(java.lang.String)
      • getAssistanceLevel

        public String getAssistanceLevel()
        Retrieves the user interface that the user will use.
        Returns:
        The user interface that the user will use. Possible values are:
        • "*SYSVAL" - The system value QASTLVL determines which user interface the user is using.
        • "*BASIC" - The Operational Assistant user interface.
        • "*INTERMED" - The system user interface.
        • "*ADVANCED" - The expert system user interface.
      • getAttentionKeyHandlingProgram

        public String getAttentionKeyHandlingProgram()
        Retrieves the attention key handling program for this user.
        Returns:
        The attention key handling program for this user. Possible values are:
        • "*SYSVAL" - The system value QATNPGM determines the user's attention key handling program.
        • NONE - No attention key handling program is used.
        • The fully qualified integrated file system path name of the attention key handling program.
        See Also:
        QSYSObjectPathName
      • getCCSID

        public int getCCSID()
        Retrieves the character code set ID to be used by the system for this user.
        Returns:
        The character code set ID to be used by the system for this user. Possible values are:
        • -2 - The system value QCCSID is used to determine the user's character code set ID.
        • A character code set ID.
      • getCHRIDControl

        public String getCHRIDControl()
        Retrieves the character identifier control for the user.
        Returns:
        The character identifier control for this user. Possible values are:
        • "*SYSVAL" - The system value QCHRIDCTL will be used to determine the CHRID control for this user.
        • "*DEVD" - The *DEVD special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
        • "*JOBCCSID" - The *JOBCCSID special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
        See Also:
        setCHRIDControl(java.lang.String)
      • getCountryID

        public String getCountryID()
        Retrieves the country or region ID used by the system for this user.
        Returns:
        The country or region ID used by the system for this user. Possible values are:
        • "*SYSVAL" - The system value QCNTRYID is used to determine the user's country or region ID.
        • A country or region ID.
        See Also:
        setCountryID(java.lang.String)
      • getCurrentLibraryName

        public String getCurrentLibraryName()
        Retrieves the name of the user's current library.
        Returns:
        The name of the user's current library. Possible values are:
        • "*CRTDFT" - The user does not have a current library.
        • A library name.
        See Also:
        setCurrentLibraryName(java.lang.String)
      • getDaysUntilPasswordExpire

        public int getDaysUntilPasswordExpire()
        Retrieves the number of days until the password will expire.
        Returns:
        The number of days until the password will expire. Possible values are:
        • 0 - The password is expired.
        • 1-7 - The number of days until the password expires.
        • -1 - The password will not expire in the next 7 days.
      • getDescription

        public String getDescription()
        Retrieves the descriptive text for the user profile. This value is pre-loaded into any User objects generated from a UserList object so that a call to the system is not required to retrieve this value. In the event that this User object was not constructed by a UserList, the description will need to be retrieved from the system via an implicit call to refresh().
        Returns:
        The descriptive text for the user profile.
        See Also:
        setDescription(java.lang.String)
      • getDisplaySignOnInformation

        public String getDisplaySignOnInformation()
        Retrieves whether the sign-on information display is shown when the user signs on.
        Returns:
        Whether the sign-on information display is shown when the user signs on. Possible values are:
        • "*SYSVAL" - The system value QDSPSGNINF determines if the sign-on information display is shown when the user signs on.
        • "*YES" - The sign-on information display is shown when the user signs on.
        • "*NO" - The sign-on information display is not shown when the user signs on.
        See Also:
        setDisplaySignOnInformation(java.lang.String)
      • getGroupAuthority

        public String getGroupAuthority()
        Retrieves the authority the user's group profile has to objects the user creates.
        Returns:
        The authority the user's group profile has to objects the user creates. Possible values are:
        • NONE - The group profile has no authority to the objects the user creates, or the user does not have a group profile.
        • "*ALL" - The group profile has all authority to the objects the user creates.
        • "*CHANGE" - The group profile has change authority to the objects the user creates.
        • "*USE" - The group profile has use authority to the objects the user creates.
        • "*EXCLUDE" - The group profile has exclude authority to the objects the user creates.
        See Also:
        setGroupAuthority(java.lang.String)
      • getGroupAuthorityType

        public String getGroupAuthorityType()
        Retrieves the type of authority the user's group has to objects the user creates.
        Returns:
        The type of authority the user's group has to objects the user creates. Possible values are:
        • "*PRIVATE" - The group profile has a private authority to the objects the user creates, or the user does not have a group profile.
        • "*PGP" - The group profile will be the primary group for objects the user creates.
        See Also:
        setGroupAuthorityType(java.lang.String)
      • getGroupID

        public long getGroupID()
        Retrieves the group ID number for the user profile. The group ID number is used to identify the user when it is a group and a member of the group is using the integrated file system.
        Returns:
        The group ID number for the user profile. Possible values are:
        • 0 - user does not have a group ID (*NONE).
        • A GID.
        See Also:
        setGroupID(long), setGroupID(String)
      • getGroupIDNumber

        public int getGroupIDNumber()
        Deprecated. This method has been replaced by getGroupID() which returns a long.
        Retrieves the group ID number for the user profile. The group ID number is used to identify the user when it is a group and a member of the group is using the integrated file system.
        Returns:
        The group ID number for the user profile. Possible values are:
        • 0 - user does not have a group ID (*NONE).
        • A GID.
      • getGroupProfileName

        public String getGroupProfileName()
        Retrieves the name of the group profile.
        Returns:
        The name of the group profile. Possible values are:
        • NONE - The user does not have a group profile.
        • The group profile name.
        See Also:
        setGroupProfileName(java.lang.String)
      • getHighestSchedulingPriority

        public int getHighestSchedulingPriority()
        Retrieves the highest scheduling priority the user is allowed to have for each job submitted to the system.
        Returns:
        The highest scheduling priority the user is allowed to have for each job submitted to the system. The priority is a value from 0 to 9, with 0 being the highest priority.
        See Also:
        setHighestSchedulingPriority(int)
      • getHomeDirectory

        public String getHomeDirectory()
        Retrieves the home directory for this user profile. The home directory is the user's initial working directory. The working directory, associated with a process, is used in path name resolution in the directory file system for path names that do not begin with a slash (/).
        Returns:
        The home directory for this user profile.
        See Also:
        setHomeDirectory(java.lang.String)
      • getIASPStorageAllowed

        public int getIASPStorageAllowed(String iaspName)
        Retrieves the maximum amount of auxiliary storage in kilobytes that can be assigned to store permanent object owned by this user on the given independant ASP.
        Returns:
        The maximum amount of auxiliary storage in kilobytes that can be assigned to store permanent object owned by this user on the given independant ASP. If the user does not have a maximum amount of allowed storage on the given independent ASP, -1 for *NOMAX is returned. If the system operating system is not release V5R1M0 or higher, or if the given IASP name is not listed for this user, -2 is returned.
        See Also:
        getIASPNames(), getIASPStorageUsed(java.lang.String)
      • getIASPStorageUsed

        public int getIASPStorageUsed(String iaspName)
        Retrieves the amount of auxiliary storage in kilobytes occupied by this user's owned objects on the given independent ASP.
        Returns:
        The amount of auxiliary storage in kilobytes occupied by this user's owned objects on the given independent ASP. If the system operating system is not release V5R1M0 or higher, or if the given IASP name is not listed for this user, -2 is returned.
        See Also:
        getIASPNames(), getIASPStorageAllowed(java.lang.String)
      • getInitialMenu

        public String getInitialMenu()
        Retrieves the initial menu for the user.
        Returns:
        The initial menu for the user. Possible values are:
        • "*SIGNOFF" - The user is limited to running the initial program specified in this profile.
        • The fully qualified integrated file system path name of the initial menu name.
        See Also:
        QSYSObjectPathName, setInitialMenu(java.lang.String)
      • getInitialProgram

        public String getInitialProgram()
        Retrieves the initial program for the user.
        Returns:
        The initial program for the user. Possible values are:
        • NONE - The user does not have an initial program.
        • The fully qualified integrated file system path name of the initial program name.
        See Also:
        QSYSObjectPathName, setInitialProgram(java.lang.String)
      • getJobDescription

        public String getJobDescription()
        Retrieves the fully qualified integrated file system path name of the job description used for jobs that start through subsystem work station entries.
        Returns:
        The fully qualified integrated file system path name of the job description used for jobs that start through subsystem work station entries.
        See Also:
        QSYSObjectPathName, setJobDescription(java.lang.String)
      • getKeyboardBuffering

        public String getKeyboardBuffering()
        Retrieves the keyboard buffering value that is used when a job is initialized for this user.
        Returns:
        The keyboard buffering value that is used when a job is initialized for this user. Possible values are:
        • "*SYSVAL" - The system value QKBDBUF determines the keyboard buffering value for this user.
        • "*YES" - The type-ahead and attention-key buffering options are both on.
        • "*NO" - The type-ahead and attention-key buffering options are not on.
        • "*TYPEAHEAD" - The type-ahead option is on, but the attention-key buffering option is not.
        See Also:
        setKeyboardBuffering(java.lang.String)
      • getLanguageID

        public String getLanguageID()
        Retrieves the language ID used by the system for this user.
        Returns:
        The language ID used by the system for this user. Possible values are:
        • "*SYSVAL" - The system value QLANGID will be used to determine the language ID.
        • The language ID.
        See Also:
        setLanguageID(java.lang.String)
      • getLimitCapabilities

        public String getLimitCapabilities()
        Retrieves whether the user has limited capabilites.
        Returns:
        Whether the user has limited capabilites. Possible values are:
        • "*PARTIAL" - The user cannot change the initial program or current library.
        • "*YES" - The user cannot change the initial menu, initial program, or current library. The user cannot run commands from the command line.
        • "*NO" - The user is not limited.
        See Also:
        setLimitCapabilities(java.lang.String)
      • getLimitDeviceSessions

        public String getLimitDeviceSessions()
        Retrieves whether the user is limited to one device session. Note: Values "0-9" are only valid when running to IBM i 6.1 or higher.
        Returns:
        Whether the user is limited to one device session. Possible values are:
        • "*SYSVAL" - The system value QLMTDEVSSN determines if the user is limited to one device session.
        • "*YES" - The user is limited to one session.
        • "*NO" - The user is not limited to one device session.
        • "0" - The user is not limited to a specific number of device session. The value has the same meaning as *NO.
        • "1" - The user is limited to a single device session. The value has the same meaning as *YES.
        • "2-9" - The user is limited to the specified number of device sessions.
        See Also:
        setLimitDeviceSessions(java.lang.String)
      • getLocaleJobAttributes

        public String[] getLocaleJobAttributes()
        Retrieves a list of the job attributes which are set from the user's locale path name.
        Returns:
        A list of the job attributes which are set from the user's locale path name. Possible values for the elements of this array are:
        • NONE - No job attributes are used from the locale path name at the time a job is started for this user profile.
        • "*SYSVAL" - The job attributes assigned from the locale path name are determined by the system value QSETJOBATR at the time a job is started for this user profile.
        • "*CCSID" - The coded character set identifier is set from the locale path name at the time a job is started for this user profile.
        • "*DATFMT" - The date format is set from the locale path name at the time a job is started for this user profile.
        • "*DATSEP" - The date separator is set from the locale path name at the time a job is started for this user profile.
        • "*SRTSEQ" - The sort sequence is set from the locale path name at the time a job is started for this user profile.
        • "*TIMSEP" - The time separator is set from the locale path name at the time a job is started for this user profile.
        • "*DECFMT" - The decimal format is set from the locale path name at the time a job is started for this user profile.
        See Also:
        setLocaleJobAttributes(java.lang.String[])
      • getLocalePathName

        public String getLocalePathName()
        Retrieves the locale path name that is assigned to the user profile when a job is started.
        Returns:
        The locale path name that is assigned to the user profile when a job is started. Possible values are:
        • "*C" - The C locale path name is assigned.
        • NONE - No locale path name is assigned.
        • "*POSIX" - The POSIX locale path name is assigned.
        • "*SYSVAL" - The QLOCALE system value is used to determine the locale path name.
        • A locale path name.
        See Also:
        setLocalePathName(java.lang.String)
      • getMaximumStorageAllowed

        public int getMaximumStorageAllowed()
        Retrieves the maximum amount of auxiliary storage (in kilobytes) that can be assigned to store permanant objects owned by the user.
        Returns:
        The maximum amount of auxiliary storage (in kilobytes) that can be assigned to store permanant objects owned by the user. Possible values are:
        • -1 - The user does not have a maximum amount of allowed storage (*NOMAX).
        • -2 - The maximum amount cannot be represent in an int value.
        • The maximum amount of auxiliary storage (in kilobytes).
        See Also:
        setMaximumStorageAllowed(int), setMaximumStorageAllowed(String)
      • getMaximumStorageAllowedInLong

        public long getMaximumStorageAllowedInLong()
      • getMessageQueue

        public String getMessageQueue()
        Retrieves the fully qualified integrated file system path name of the message queue that is used by this user.
        Returns:
        The fully qualified integrated file system path name of the message queue that is used by this user.
        See Also:
        QSYSObjectPathName, setMessageQueue(java.lang.String)
      • getMessageQueueDeliveryMethod

        public String getMessageQueueDeliveryMethod()
        Retrieves how the messages are delivered to the message queue used by the user.
        Returns:
        How the messages are delivered to the message queue used by the user. Possible values are:
        • "*BREAK" - The job to which the message queue is assigned is interrupted when a message arrives on the message queue.
        • "*DFT" - Messages requiring replies are answered with their default reply.
        • "*HOLD" - The messages are held in the message queue until they are requested by the user or program.
        • "*NOTIFY" - The job to which the message queue is assigned is notified when a message arrives on the message queue.
        See Also:
        setMessageQueueDeliveryMethod(java.lang.String)
      • getMessageQueueSeverity

        public int getMessageQueueSeverity()
        Retrieves the lowest severity that a message can have and still be delivered to a user in break or notify mode.
        Returns:
        The lowest severity that a message can have and still be delivered to a user in break or notify mode. The severity is a value in the range 0 through 99.
        See Also:
        setMessageQueueSeverity(int)
      • getObjectAuditingValue

        public String getObjectAuditingValue()
        Retrieves the user's object auditing value.
        Returns:
        The user's object auditing value. Possible values are:
        • NONE - No additional object auditing is done for the user.
        • "*CHANGE" - Object changes are audited for the user if the object's auditing value is *USRPRF.
        • "*ALL" - Object read and change operations are audited for the user if the object's auditing value is *USRPRF.
        See Also:
        setObjectAuditingValue(java.lang.String)
      • getObjectsOwned

        public UserObjectsOwnedList getObjectsOwned()
        Return an object representing the objects that this user owns.
        Returns:
        UserObjectsOwnedList object constructed with default selection criteria.
      • getOutputQueue

        public String getOutputQueue()
        Retrieves the output queue used by this user.
        Returns:
        The output queue used by this user. Possible values are:
        • "*WRKSTN" - The output queue assigned to the user's work station is used.
        • "*DEV" - An output queue with the same name as the device specified in the printer device parameter is used.
        • The fully qualified integrated file system path name of the output queue.
        See Also:
        QSYSObjectPathName, setOutputQueue(java.lang.String)
      • getOwner

        public String getOwner()
        Retrieves who is to own objects created by this user.
        Returns:
        Who is to own objects created by this user. Possible values are:
        • "*USRPRF" - The user owns any objects the user creates. If the user does not have a group profile, the field contains this value.
        • "*GRPPRF" - The user's group profile owns any objects the user creates.
        See Also:
        setOwner(java.lang.String)
      • getPasswordExpireDate

        public Date getPasswordExpireDate()
        Retrieves the date the user's password expires.
        Returns:
        The date the user's password expires. Possible values are:
        • A date object containing the date the user's password expires.
        • null - The user's password will not expire (password expiration interval of *NOMAX) or the user's password is set to expired.
      • getPasswordChangeBlock

        public String getPasswordChangeBlock()
        Retrieves the time period during which a password is blocked from being changed following the prior successful password change operation.

        Note: This method should not be used when running to IBM i 5.4 or earlier releases.

        Returns:
        The time period during which a password is blocked from being changed. Possible values are:
        • "*SYSVAL" - The system value QPWDCHGBLK is used to determine the block password change value.
        • NONE - The password can be changed at any time.
        • 1-99 - Indicates the number of hours a user must wait after the prior successful password change operation before they are able to change the password again.
        See Also:
        setPasswordChangeBlock(java.lang.String)
      • getPasswordExpirationInterval

        public int getPasswordExpirationInterval()
        Retrieves the number of days the user's password can remain active before it must be changed.
        Returns:
        The number of days the user's password can remain active before it must be changed. Possible values are:
        • 0 - The system value QPWDEXPITV is used to determine the user's password expiration interval.
        • -1 - The user's password does not expire (*NOMAX).
        • 1-366 - The number of days the user's password can remain active before it must be changed.
        See Also:
        setPasswordExpirationInterval(int), setPasswordExpirationInterval(String)
      • getPasswordLastChangedDate

        public Date getPasswordLastChangedDate()
        Retrieves the date the user's password was last changed.
        Returns:
        The date the user's password was last changed.
      • getPreviousSignedOnDate

        public Date getPreviousSignedOnDate()
        Retrieves the date and time the user last signed on.
        Returns:
        The date and time the user last signed on. Possible values are:
        • A date object containing the date and time the user last signed on.
        • null - The user has never signed on the system.
      • getPrintDevice

        public String getPrintDevice()
        Retrieves the printer used to print for this user.
        Returns:
        The printer used to print for this user. Possible values are:
        • "*WRKSTN" - The printer assigned to the user's work station is used.
        • "*SYSVAL" - The default system printer specified in the system value QPRTDEV is used.
        • The print device.
        See Also:
        setPrintDevice(java.lang.String)
      • getSignedOnAttemptsNotValid

        public int getSignedOnAttemptsNotValid()
        Retrieves the number of sign-on attempts that were not valid since the last successful sign-on.
        Returns:
        The number of sign-on attempts that were not valid since the last successful sign-on.
      • getSortSequenceTable

        public String getSortSequenceTable()
        Retrieves the name of the sort sequence table used for string comparisons.
        Returns:
        The name of the sort sequence table used for string comparisons. Possible values are:
        • "*HEX" - The hexadecimal values of the characters are used to determine the sort sequence.
        • "*LANGIDUNQ" - A unique-weight sort table associated with the language specified.
        • "*LANGIDSHR" - A shared-weight sort table associated with the language specified.
        • "*SYSVAL" - The system value QSRTSEQ.
        • The fully qualified integrated file system path name of the sort sequence table name.
        See Also:
        QSYSObjectPathName, setSortSequenceTable(java.lang.String)
      • getSpecialEnvironment

        public String getSpecialEnvironment()
        Retrieves the special environment the user operates in after signing on.
        Returns:
        The special environment the user operates in after signing on. Possible values are:
        • "*SYSVAL" - The system value QSPCENV is used to determine the user's special environment.
        • NONE - The user operates in the IBM i system environment.
        • "*S36" - The user operates in the System/36 environment.
        See Also:
        setSpecialEnvironment(java.lang.String)
      • getStatus

        public String getStatus()
        Retrieves the status of the user profile.
        Returns:
        The status of the user profile. Possible values are:
        • "*ENABLED" - The user profile is enabled; therefor, the user is able to sign on.
        • "*DISABLED" - The user profile is not enabled; therefor, the user cannot sign on.
        See Also:
        setStatus(java.lang.String)
      • getStorageUsed

        public int getStorageUsed()
        Retrieves the amount of auxiliary storage (in kilobytes) occupied by this user's owned objects.
        Returns:
        The amount of auxiliary storage (in kilobytes) occupied by this user's owned objects.
      • getStorageUsedInLong

        public long getStorageUsedInLong()
        Retrieves the amount of auxiliary storage (in kilobytes) occupied by this user's owned objects.
        Returns:
        The amount of auxiliary storage (in kilobytes) occupied by this user's owned objects.
      • getSupplementalGroups

        public String[] getSupplementalGroups()
        Retrieves the supplemental groups for the user profile.
        Returns:
        The array of supplemental groups for the user profile, or an array of length 0 if there are no supplemental groups.
        See Also:
        setSupplementalGroups(java.lang.String[])
      • getSupplementalGroupsNumber

        public int getSupplementalGroupsNumber()
        Retrieves the number of supplemental groups for the user profile.

        This method simply returns getSupplementalGroups().length.

        Returns:
        The number of supplemental groups for the user profile.
        See Also:
        getSupplementalGroups()
      • getSystem

        public AS400 getSystem()
        Returns the system object representing the system on which the user profile exists.
        Returns:
        The system object representing the system on which the user profile exists. If the system has not been set, null is returned.
        See Also:
        setSystem(com.ibm.as400.access.AS400)
      • getUserActionAuditLevel

        public String[] getUserActionAuditLevel()
        Retrieves a list of action audit levels for the user.
        Returns:
        A list of action audit levels for the user. Possible values for the elements of this array are:
        • "*CMD" - The user has the *CMD audit value specified in the user profile.
        • "*CREATE" - The user has the *CREATE audit value specified in the user profile.
        • "*DELETE" - The user has the *DELETE audit value specified in the user profile.
        • "*JOBDTA" - The user has the *JOBDTA audit value specified in the user profile.
        • "*OBJMGT" - The user has the *OBJMGT audit value specified in the user profile.
        • "*OFCSRV" - The user has the *OFCSRV audit value specified in the user profile.
        • "*OPTICAL" - The user has the *OPTICAL audit value specified in the user profile.
        • "*PGMADP" - The user has the *PGMADP audit value specified in the user profile.
        • "*SAVRST" - The user has the *SAVRST audit value specified in the user profile.
        • "*SECURITY" - The user has the *SECURITY audit value specified in the user profile.
        • "*SERVICE" - The user has the *SERVICE audit value specified in the user profile.
        • "*SPLFDTA" - The user has the *SPLFDTA audit value specified in the user profile.
        • "*SYSMGT" - The user has the *SYSMGT audit value specified in the user profile.
        See Also:
        setUserActionAuditLevel(java.lang.String[])
      • getUserClassName

        public String getUserClassName()
        Retrieves the user class name.
        Returns:
        The user class name. Possible values are:
        • "*SECOFR" - The user has a class of security officer.
        • "*SECADM" - The user has a class of security administrator.
        • "*PGMR" - The user has a class of programmer.
        • "*SYSOPR" - The user has a class of system operator.
        • "*USER" - The user has a class of end user.
        See Also:
        setUserClassName(java.lang.String)
      • getUserExpirationAction

        public String getUserExpirationAction()
        Retrieves the action that will occur when the user profile has expired.

        Note: This method should not be used when running to IBM i 6.1 or earlier releases.

        Returns:
        The action that will occur when the user profile has expired. Possible values include:
        • NONE - The user profile will not expire.
        • "*DISABLE" - The user profile will be disabled.
        • "*DELETE" - The user profile will be deleted. If the user profile cannot be deleted, it will be disabled.
      • getUserExpirationDate

        public Date getUserExpirationDate()
        Retrieves the date when the user profile expires and is automatically disabled.

        Note: This method should not be used when running to IBM i 6.1 or earlier releases.

        Returns:
        The date when the user profile expires. null is returned if the user profile does not have an expiration date.
        See Also:
        setUserExpirationDate(java.util.Date)
      • getUserExpirationInterval

        public int getUserExpirationInterval()
        Retrieves the number of days before the user profile is automatically disabled.

        Note: This method should not be used when running to IBM i 6.1 or earlier releases.

        Returns:
        The number of days until the user profile expires, starting from when the profile was created or last re-enabled. 0 is returned if the user profile does not have a user expiration interval.
        See Also:
        setUserExpirationInterval(int)
      • getUserID

        public long getUserID()
        Retrieves the user ID (UID) number for the user profile. The UID is used to identify the user when using the integrated file system.
        Returns:
        The user ID (UID) number for the user profile.
        See Also:
        setUserID(long)
      • getUserIDNumber

        public int getUserIDNumber()
        Deprecated. This method has been replaced by getUserID() which returns a long.
        Retrieves the user ID (UID) number for the user profile. The UID is used to identify the user when using the integrated file system.
        Returns:
        The user ID (UID) number for the user profile.
      • getUserOptions

        public String[] getUserOptions()
        Retrieves a list of options for users to customize their environment.
        Returns:
        The list of options for users to customize their environment. Possible values include:
        • "*CLKWD" - The keywords are shown when a CL command is displayed.
        • "*EXPERT" - More detailed information is shown when the user is defining or changing the system using edit or display object authority. This is independent of the ASTLVL parameter that is available on the user profile and other commands.
        • "*HLPFULL" - UIM online help is to be displayed full screen instead of in a window.
        • "*STSMSG" - Status messages sent to the user are shown.
        • "*NOSTSMSG" - Status messages sent to the user are not shown.
        • "*ROLLKEY" - The opposite action from the system default for roll keys is taken.
        • "*PRTMSG" - A message is sent to the user when a spooled file is printed.
        See Also:
        setUserOptions(java.lang.String[])
      • getUserProfileName

        public String getUserProfileName()
        Retrieves the name of the user profile for which the information is returned. Note this is the name that is returned by the system, not the name that was set into this User object by the constructor or by a call to setUser().
        Returns:
        The name of the user profile for which the information is returned.
      • isAuthCollectionActive

        public boolean isAuthCollectionActive()
      • isAuthCollectionRepositoryExist

        public boolean isAuthCollectionRepositoryExist()
      • isAuthCollectionDeleted

        public boolean isAuthCollectionDeleted()
      • getDetailInSTRAUTCOL

        public String getDetailInSTRAUTCOL()
      • getLibNameInSTRAUTCOL

        public String[] getLibNameInSTRAUTCOL()
      • getObjectNamesInSTRAUTCOL

        public String[] getObjectNamesInSTRAUTCOL()
      • getObjectTypesInSTRAUTCOL

        public String[] getObjectTypesInSTRAUTCOL()
      • getDLOObjectTypesInSTRAUTCOL

        public String[] getDLOObjectTypesInSTRAUTCOL()
      • getFileSystemObjectTypesInSTRAUTCOL

        public String[] getFileSystemObjectTypesInSTRAUTCOL()
      • getOmitLibNamesInSTRAUTCOL

        public String[] getOmitLibNamesInSTRAUTCOL()
      • hasSpecialAuthority

        public boolean hasSpecialAuthority(String authority)
        Retrieves if this user profile has been granted the specified authority, or belongs to a group profile that has been granted the specified authority.
        Parameters:
        authority - The authority to check. It must be one of the following special authority values:
        • *ALLOBJ - All object.
        • *SECADM - Security administrator.
        • *JOBCTL - Job control.
        • *SPLCTL - Spool control.
        • *SAVSYS - Save system.
        • *SERVICE - Service.
        • *AUDIT - Audit.
        • *IOSYSCFG - Input/output system configuration.
        Returns:
        true if this user has the authority or belongs to a group that has the authority; false if it does not have authority or an error occurs.
        See Also:
        getSpecialAuthority(), setSpecialAuthority(java.lang.String[])
      • isGroupHasMember

        public boolean isGroupHasMember()
        Retrieves whether this user is a group that has members.

        For User objects, this should always return false. For UserGroup objects, this should return true if the group profile has members.

        Returns:
        true if the user is a group that has members, false otherwise.
        See Also:
        UserGroup
      • isLocalPasswordManagement

        public boolean isLocalPasswordManagement()
        Retrieves whether the password is managed locally.
        Returns:
        true if the password is managed locally, false otherwise.
        See Also:
        setLocalPasswordManagement(boolean)
      • isNoPassword

        public boolean isNoPassword()
        Retrieves whether *NONE is specified for the password in the user profile.
        Returns:
        true if *NONE is specified for the password in the user profile, false otherwise.
      • isPasswordSetExpire

        public boolean isPasswordSetExpire()
        Retrieves whether the user's password is set to expired, requiring the user to change the password when signing on.
        Returns:
        true if the password is set to expired, false otherwise.
        See Also:
        setPasswordSetExpire(boolean)
      • isUserEntitlementRequired

        public boolean isUserEntitlementRequired()
        Retrieves whether a user entitlement is required for this user profile. This property should be ignored on systems that do not have feature 5052 installed. Note: This method is valid only when running to IBM i 6.1 or higher.
        Returns:
        true if a user entitlement is required for this user profile; false otherwise.
      • isWithDigitalCertificates

        public boolean isWithDigitalCertificates()
        Retrieves whether there are digital certificates associated with this user.
        Returns:
        true if there are digital certificates associated with this user; false otherwise.
      • removePropertyChangeListener

        public void removePropertyChangeListener(PropertyChangeListener listener)
        Removes the PropertyChangeListener. If the PropertyChangeListener is not on the list, nothing is done.
        Parameters:
        listener - The listener object.
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(VetoableChangeListener listener)
        Removes the VetoableChangeListener. If the VetoableChangeListener is not on the list, nothing is done.
        Parameters:
        listener - The listener object.
      • setAttentionKeyHandlingProgram

        public void setAttentionKeyHandlingProgram(String attentionKeyHandlingProgram)
                                            throws AS400SecurityException,
                                                   ErrorCompletingRequestException,
                                                   InterruptedException,
                                                   IOException
        Sets the program to be used as the Attention (ATTN) key handling program for this user. The ATTN key handling program is called when the ATTN key is pressed during an interactive job. The program is active only when the user routes to the system-supplied QCMD processor. The ATTN key handling program is set on before the initial program (if any) is called and it is active for both program and menu. If the program changes the ATNPGM (by using the SETATNPGM command), the new program remains active only for the duration of the program. When contol returns and QCMD call the menu, the original ATTN key handling program becomes active again. If the SETATNPGM command is run from the menues or an application is called from the menues, the new ATTN key handling program that is specified overrides the original ATTN key handling program. If *YES or *PARTIAL is specified for the Limit capabilites (LMTCPB) parameter on the Create User Profile (CRTUSRPRF) or Change User Profile (CHGUSRPRF) command, the ATTN key handling program cannot be changed. The caller must have *USE authority to the specified program.
        Parameters:
        attentionKeyHandlingProgram - The program to be used as the Attention (ATTN) key handling program for this user. Possible values are:
        • "*SYSVAL" - The system value QATNPGM is used.
        • NONE - No ATTN key handling program is used by this user.
        • "*ASSIST" - The Operational Assistant ATTN key handling program, QEZMAIN, is used.
        • The fully qualified integrated file system path name of the attention key handling program.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        QSYSObjectPathName
      • setCCSID

        public void setCCSID(int ccsid)
                      throws AS400SecurityException,
                             ErrorCompletingRequestException,
                             InterruptedException,
                             IOException
        Sets the character code set identifier (CCSID) to be used for this user.

        A CCSID is a 16-bit number identifying a specific set of encoding scheme identifiers, character set identifiers, code page identifiers, and additional coding-related information that uniquely identifies the coded graphic representation used.

        Note: If the value for CCSID is changed, the change does not affect job that are currently running.

        Parameters:
        ccsid - The character code set identifier (CCSID) to be used for this user. Possible values are:
        • -2 - The system value QCCSID is used to determine the user's character code set ID.
        • A character code set ID.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
      • setCCSID

        public void setCCSID(String ccsid)
                      throws AS400SecurityException,
                             ErrorCompletingRequestException,
                             InterruptedException,
                             IOException
        Sets the character code set identifier (CCSID) to be used for this user.

        A CCSID is a 16-bit number identifying a specific set of encoding scheme identifiers, character set identifiers, code page identifiers, and additional coding-related information that uniquely identifies the coded graphic representation used.

        Note: If the value for CCSID is changed, the change does not affect job that are currently running.

        Parameters:
        ccsid - The character code set identifier (CCSID) to be used for this user. Possible values are:
        • "*SYSVAL" - The system value QCCSID is used to determine the user's character code set ID.
        • "*HEX" - The CCSID 65535 is used.
        • A character code set ID.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
      • setCHRIDControl

        public void setCHRIDControl(String chridControl)
                             throws AS400SecurityException,
                                    ErrorCompletingRequestException,
                                    InterruptedException,
                                    IOException
        Sets the character identifier control (CHRIDCTL) for the job. This attribute controls the type of coded character set identifier (CCSID) conversion that occurs for display files, printer files and panel groups. The *CHRIDCTL special value must be specified for the Character identifier (CHRID) parameter an the create, change, or override commands for display files, printer files, and panel groups before this attribute will be used.
        Parameters:
        chridControl - The character identifier control (CHRIDCTL) for the job. Possible values are:
        • "*SYSVAL" - The system value QCHRIDCTL is used.
        • "*DEVD" - The *DEVD special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
        • "*JOBCCSID" - The *JOBCCSID special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getCHRIDControl()
      • setCurrentLibraryName

        public void setCurrentLibraryName(String currentLibraryName)
                                   throws AS400SecurityException,
                                          ErrorCompletingRequestException,
                                          InterruptedException,
                                          IOException
        Sets the name of the current library associated with the job being run.

        Specifies the name of the library to be used as the current library for this user. If *PARTIAL or *YES is specified for the Limit capabilities (LMTCPB) parameter of the Create User Profile (CRTUSRPRF) or Change User Profile (CHGUSRPRF) command, the user cannot change the current library at sign-on or with the Change Profile (CHGPRF) command.

        The caller must have *USE authority to the specified library.

        Parameters:
        currentLibraryName - The name of the current library associated with the job being run. Possible values are:
        • "*CRTDFT" - The user has no current library. The library QGPL is used as the default current library.
        • A library name.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getCurrentLibraryName()
      • setGroupAuthority

        public void setGroupAuthority(String groupAuthority)
                               throws AS400SecurityException,
                                      ErrorCompletingRequestException,
                                      InterruptedException,
                                      IOException
        Sets the specific authority given to the group profile for newly created objects. If *GRPPRF is specified for the Owner (OWNER) parameter, specification of this parameter is not allowed.
        Parameters:
        groupAuthority - The specific authority given to the group profile for newly created objects. Possible values are:
        • NONE - No group authority is given.
        • "*ALL" - The user can perform all operations execept those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user can also change ownership of the object.
        • "*CHANGE" - The user can perform all operations execept those limited to the owner or controlled by the object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
        • "*USE" - The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. User (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
        • "*EXCLUDE" - The user cannot access the object.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getGroupAuthority()
      • setGroupAuthorityType

        public void setGroupAuthorityType(String groupAuthorityType)
                                   throws AS400SecurityException,
                                          ErrorCompletingRequestException,
                                          InterruptedException,
                                          IOException
        Sets the type of authority to be granted to the group profile for newly-created objects. If NONE is specified for the Group Authority (GRPAUT) parameter, specification of this parameter is ignored.
        Parameters:
        groupAuthorityType - The type of authority to be granted to the group profile for newly-created objects. Possible values are:
        • "*PRIVATE" - The group profile is granted private authority to newly-created objects, with the authority value determined by the GRPAUT parameter. If the authority value in the GRPAUT parameter is NONE, this value is ignored.
        • "*PGP" - The group profile is the primary group for newly-created objects, with the authority value determined by the GRPAUT parameter. If the authority value in the GRPAUT parameter is NONE, this value is ignored.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getGroupAuthorityType()
      • setGroupID

        public void setGroupID(long groupID)
                        throws AS400SecurityException,
                               ErrorCompletingRequestException,
                               InterruptedException,
                               IOException
        Sets the group ID number (gid number) for this user profile. The gid number is used to identify the group profile when a member of the group is using the directory file system. The gid number for a user may not be changed if:
        • The user profile is the primary group of an object in a directory.
        • There are one or more active jobs for the user.
        Parameters:
        groupID - The group ID number (gid number) for this user profile. Possible values are:
        • 0 - The user does not have a gid number or an existing gid number is removed.

          Note: This value cannot be specified if the user is a group profile or the primary group of an object.

        • 1-4294967294 - The gid number to be assigned to the user profile. The gid number assigned must not already be assigned to another user profile.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getGroupID()
      • setGroupID

        public void setGroupID(String groupID)
                        throws AS400SecurityException,
                               ErrorCompletingRequestException,
                               InterruptedException,
                               IOException
        Sets the group ID number (gid number) for this user profile. The gid number is used to identify the group profile when a member of the group is using the directory file system. The gid number for a user may not be changed if:
        • The user profile is the primary group of an object in a directory.
        • There are one or more active jobs for the user.
        Parameters:
        groupID - The group ID number (gid number) for this user profile. Possible values are:
        • NONE - The user does not have a gid number or an existing gid number is removed.

          Note: This value cannot be specified if the user is a group profile or the primary group of an object.

        • "*GEN" - The gid number will be generated for the user. The system generates a gid number that is not already assigned to another user. The gid number generated is greater than 100.
        • 1-4294967294 - The gid number to be assigned to the user profile. The gid number assigned must not already be assigned to another user profile.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getGroupID()
      • setHomeDirectory

        public void setHomeDirectory(String homeDirectory)
                              throws AS400SecurityException,
                                     ErrorCompletingRequestException,
                                     InterruptedException,
                                     IOException
        Sets the path name of the home directory for this user profile. The home directory is the user's initial working directory. The working directory, associated with a process, is used during path name resolution in the directory file system for path names that do not begin with a slash (/). If the home directory specified does not exist when the user signs on, the user's initial working directory is the root (/) directory.
        Parameters:
        homeDirectory - The path name of the home directory for this user profile. Possible values are:
        • "*USRPRF" - The home directory assigned to the user will be /home/USRPRF, where USRPRF is the name of the user profile.
        • The path name of the home directory to be assigned to this user.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getHomeDirectory()
      • setInitialMenu

        public void setInitialMenu(String initialMenu)
                            throws AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   InterruptedException,
                                   IOException
        Sets the initial menu displayed when the user signs on the system if the user's routing program is the command processor. If *YES is specified for the Limit capabilities (LMTCPB) parameter, the user cannot change the menu either at sign-on or with the Change Profile (CHGPRF) command.

        A System/36 environment menu can be specified as the initial menu if either of the following conditions are true:

        • *S36 is specified for the Special environments (SPCENV) parameter.
        • *SYSVAL is specified on the SPCENV parameter and the system value, QSPCENV, is *S36.

        The caller must have *USE authority to the specified menu.

        Parameters:
        initialMenu - The initial menu displayed when the user signs on the system if the user's routing program is the command processor. Possible values are:
        • "*SIGNOFF" - The system signs off the user when the program completes. This is intended for users authorized only to run the program.
        • The fully qualified integrated file system path name of the initial menu.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        QSYSObjectPathName, getInitialMenu()
      • setInitialProgram

        public void setInitialProgram(String initialProgram)
                               throws AS400SecurityException,
                                      ErrorCompletingRequestException,
                                      InterruptedException,
                                      IOException
        Sets, for an interactive job, the program called whenever a new routing step is started that has QCMD as the request processing program. If *PARTIAL or *YES is specified for the Limit capabilities parameter, the program value cannot be changed at sign on or by using the Change Profile (CHGPRF) command. No parameters can be passed to the program.

        A System/36 environment procedure name can be specified as the initial program if the procedure is a member of the file QS36PRC (in the library list or specified library) and if either of the following conditions are true:

        • *36 is specified on the SPCENV parameter.
        • *SYSVAL is specified on the SPCENV parameter and the system value, QSPCENV is *S36.

        The caller must have *USE authority to the specified program.

        Parameters:
        initialProgram - The initial program for the user. Possible values are:
        • NONE - No program is called when the user signs on. If a menu name is specified in the Initial menu (INLMNU) parameter, that menu is displayed.
        • The fully qualified integrated file system path name of the initial program for the user.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        QSYSObjectPathName, getInitialProgram()
      • setKeyboardBuffering

        public void setKeyboardBuffering(String keyboardBuffering)
                                  throws AS400SecurityException,
                                         ErrorCompletingRequestException,
                                         InterruptedException,
                                         IOException
        Sets the keyboard buffering value to be used when a job is initialized for this user profile. If the type-ahead feature is active, you can buffer your keyboard strokes. If the attention key buffering option is active, the attention key is buffered as any other key. If it is not active, the attention key is not buffered and is sent to the system even if the display station is input-inhibited. This value can alse be set by a user application.
        Parameters:
        keyboardBuffering - The keyboard buffering value to be used when a job is initialized for this user profile. Possible values are:
        • "*SYSVAL" - The system value, QKBDBUF, is used to determine the keyboard buffering value.
        • "*NO" - The type-ahead and attention-key buffering options are not active.
        • "*TYPEAHEAD" - The type-ahead option is active, but the attention key buffering option is not.
        • "*YES" - The type-ahead and attention key buffering options are active.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getKeyboardBuffering()
      • setLimitCapabilities

        public void setLimitCapabilities(String limitCapabilities)
                                  throws AS400SecurityException,
                                         ErrorCompletingRequestException,
                                         InterruptedException,
                                         IOException
        Sets the limit to which the user can control the program, menu, current library, and the ATTN key handling program values. It alse determines whether the user can run commands from the command line. This parameter is ignored when the security level is 10.

        Note: When creating or changing other users' user profile, you cannot specify values on this parameter that grant greater capabilities to other users than your own user profile grants to you. For example, if *PARTIAL is specified for the Limit capabilities (LMTCPB) parameter in your user profile, you can specify *PARTIAL or *YES for anther user. You cannot specify *NO for another user.

        Parameters:
        limitCapabilities - The limit to which the user can control the program, menu, current library, and the ATTN key handling program values. Possible values are:
        • "*NO" - The program, menu, and current library values can be changed when the usre signs on the system. User may change the program, menu, current library, or ATTN key handling program values is the own user profiles with the Change Profile (CHGPRF) command. Commands can be run from a command line.
        • "*PARTIAL" - The program and current library cannot be changed on the sign-on display. The menu can be changed and comands can be run from a command line. A user can change the menu value with the Change profile (CHGPRF) command. The program, current library, and the ATTN key handling program cannot be changed using the CHGPRF command.
        • "*YES" - The program, menu, and current library values cannot be changed on the sign-on display. Commands cannot be run when issued from a command line or by selecting an option from a command grouping menu such as CMDADD, but can still be run from a command entry screen. The user cannot change the program, menu, current library, or the ATTN key program handling values by using the CHGPRF command.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getLimitCapabilities()
      • setLimitDeviceSessions

        public void setLimitDeviceSessions(String limitDeviceSessions)
                                    throws AS400SecurityException,
                                           ErrorCompletingRequestException,
                                           InterruptedException,
                                           IOException
        Sets if the number of device sessions allowed for a user is limited to 1. This does not limit SYSREQ and second sign-on. Note: Values "0-9" are only valid when running to IBM i 6.1 or higher.
        Parameters:
        limitDeviceSessions - If the number of device sessions allowed for a user is limited to 1. Possible values are:
        • "*SYSVAL" - The system value QLMTDEVSSN is used to determine whether the user is limited to a single device session.
        • "*NO" - The user is not limited to one device session.
        • "*YES" - The user is limited to one session.
        • "0" - The user is not limited to a specific number of device session. The value has the same meaning as *NO.
        • "1" - The user is limited to a single device session. The value has the same meaning as *YES.
        • "2-9" - The user is limited to the specified number of device sessions.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getLimitDeviceSessions()
      • setLocaleJobAttributes

        public void setLocaleJobAttributes(String[] localeJobAttributes)
                                    throws AS400SecurityException,
                                           ErrorCompletingRequestException,
                                           InterruptedException,
                                           IOException
        Sets which job attributes are to be taken from the locale specified for the Locale (LOCALE) parameter when the job is initiated.
        Parameters:
        localeJobAttributes - A list of attributes which are set from the locale path name at the time a job is started for this user. Possible values for the elements of this array are:
        • "*SYSVAL" - The system value, QSETJOBATR, is used to determine which job attributes are taken from the locale.
        • NONE - No job attributes are taken from the locale.
        • "*CCSID" - The coded character set identifier from the locale is used. The CCSID value from the locale overrides the user profile CCSID.
        • "*DATFMT" - The date format from the locale is used.
        • "*DATSEP" - The date separator from the locale is used.
        • "*DECFMT" - The decimal format from the locale is used.
        • "*SRTSEQ" - The sort sequence from the locale is used. The sort sequence from the locale overrides the user profile sort sequence.
        • "*TIMSEP" - The time separator from the locale is used.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getLocaleJobAttributes()
      • setMaximumStorageAllowed

        public void setMaximumStorageAllowed(int maximumStorageAllowed)
                                      throws AS400SecurityException,
                                             ErrorCompletingRequestException,
                                             InterruptedException,
                                             IOException
        Sets the maximum amount of auxiliary storage (in kilobytes) assigned to store permanant objects owned by this user profile (1 kilobyte equals 1024 bytes). If the maximum is exceeded, when an interactive user tries to create an object, an error message is displayed, and the object is not created. If the maximum is exceeded when an object is created in a batch job, an error message is sent to the job log (depending on the logging level of the job), and the object is not created.

        Storage is allocated in 4K increments. Therefore, if you specify MAXSTG (9), the profile is allocated 12K of storage.

        When planning maximum storage for user profiles, consider the following system actions:

        • A restore operation assigns the storage to the user doing the restore, and then transfers the object to the owner. For a large restore, specify MAXSTG(*NOMAX).
        • The user profile that creates a journal receiver is assigned the required storage as the receiver size grows. If new receivers are created using JRNRCV(*GEN), the storage continues to be assigned to the user profile that wons the active journal receiver. If a very active journal receiver is owned, specify MAXSTG(*NOMAX).
        • User profiles that transfer created objects to their group profile must have adequate storage in the user profiles to contain created objects before the objects are transferred to the group profile.
        • The owner of the library is assigned the storage for the descriptions of objects which are stored in a library, even when the objects are owned by another user profile. Examples of such objects are text and program references.
        Parameters:
        maximumStorageAllowed - The maximum amount of auxiliary storage (in kilobytes) assigned to store permanant objects owned by this user profile. Possible values are:
        • -1 - As much storage as is required is assigned to this profile (*NOMAX).
        • The maximum amount of storage for the user, in kilobytes (1 kilobyte equals 1024 bytes).
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getMaximumStorageAllowed()
      • setMaximumStorageAllowed

        public void setMaximumStorageAllowed(String maximumStorageAllowed)
                                      throws AS400SecurityException,
                                             ErrorCompletingRequestException,
                                             InterruptedException,
                                             IOException
        Sets the maximum amount of auxiliary storage (in kilobytes) assigned to store permanant objects owned by this user profile (1 kilobyte equals 1024 bytes). If the maximum is exceeded, when an interactive user tries to create an object, an error message is displayed, and the object is not created. If the maximum is exceeded when an object is created in a batch job, an error message is sent to the job log (depending on the logging level of the job), and the object is not created.

        Storage is allocated in 4K increments. Therefore, if you specify MAXSTG (9), the profile is allocated 12K of storage.

        When planning maximum storage for user profiles, consider the following system actions:

        • A restore operation assigns the storage to the user doing the restore, and then transfers the object to the owner. For a large restore, specify MAXSTG(*NOMAX).
        • The user profile that creates a journal receiver is assigned the required storage as the receiver size grows. If new receivers are created using JRNRCV(*GEN), the storage continues to be assigned to the user profile that wons the active journal receiver. If a very active journal receiver is owned, specify MAXSTG(*NOMAX).
        • User profiles that transfer created objects to their group profile must have adequate storage in the user profiles to contain created objects before the objects are transferred to the group profile.
        • The owner of the library is assigned the storage for the descriptions of objects which are stored in a library, even when the objects are owned by another user profile. Examples of such objects are text and program references.
        Parameters:
        maximumStorageAllowed - The maximum amount of auxiliary storage (in kilobytes) assigned to store permanant objects owned by this user profile. Possible values are:
        • "*NOMAX" - As much storage as is required is assigned to this profile.
        • The maximum amount of storage for the user, in kilobytes (1 kilobyte equals 1024 bytes).
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getMaximumStorageAllowed()
      • setMessageQueueDeliveryMethod

        public void setMessageQueueDeliveryMethod(String messageQueueDeliveryMethod)
                                           throws AS400SecurityException,
                                                  ErrorCompletingRequestException,
                                                  InterruptedException,
                                                  IOException
        Sets how the messages are sent to the message queue for this user are to be delivered.
        Parameters:
        messageQueueDeliveryMethod - How the messages are sent to the message queue for this user are to be delivered. Possible values are:
        • "*NOTIFY" - The job to which the message queue is assigned is notified when a message arrives on the message queue. For interactive jobs at a work station, the audible alarm is sounded (if the alarm feature is set) and the Message Waiting light is turned on. The delivery mode cannot be changed to *NOTIFY if the message queue is also being used by another job.
        • "*HOLD" - The messages are held in the message queue until they are requested by the user or program.
        • "*BREAK" - The job to which the message queue is assigned is interrupted when a message arrives at the message queue. If the job is an interactive job, the autdible alarm is sounded (if the alarm feature is set). The delivery mode cannot be changed to *BREAK if the message queue is also being used by another job.
        • "*DFT" - The default reply to the inquiry message is sent. If no default reply is specified in the message description of the inquiry message, the system default reply, *N, is used.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        setMessageQueueDeliveryMethod(java.lang.String)
      • setMessageQueueSeverity

        public void setMessageQueueSeverity(int messageQueueSeverity)
                                     throws AS400SecurityException,
                                            ErrorCompletingRequestException,
                                            InterruptedException,
                                            IOException
        Sets the lowest severity code that a message can have and still be delivered to a user in break or notify mode. Messages arriving at the message queue whose severities are lower than the the severity code specified for this parameter do not interrupt the job or turn on the audible alarm or the message-waiting light; they are held in the queue until they are requested by using the Display Message (DSPMSG) command. If *BREAK or *NOTIFY is specidied for the Delivery (DLVRY) parameter, and is in effect when a message arrives at the queue, the message is delivered if the severity code associated with the message is equal or greater then the value specified here. Otherwiese, the message is held in the queue until it is requested.
        Parameters:
        messageQueueSeverity - A severity code ranging from 00 through 99.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getMessageQueueSeverity()
      • setName

        public void setName(String name)
                     throws PropertyVetoException
        Sets the user profile name. This does not change the name of the user profile on the system. Instead, it changes the user profile to which this User object references. This property cannot be changed if the object has established a connection to the system.
        Parameters:
        name - The user profile name.
        Throws:
        PropertyVetoException - If any of the registered listeners vetos the property change.
        See Also:
        getName()
      • setObjectAuditingValue

        public void setObjectAuditingValue(String objectAuditingValue)
                                    throws AS400SecurityException,
                                           ErrorCompletingRequestException,
                                           InterruptedException,
                                           IOException
        Sets the object auditing value for the user. This value only takes effect if the object auditing (OBJAUD) value for the object being accessed has the value *USRPRF.

        Implementation note: The method internally calls the Change User Auditing (CHGUSRAUD) command and not the Change User Profile (CHGUSRPRF) command. The caller must have audit (*AUDIT) special authority. Changes take effect the next time a job is started for this user.

        Parameters:
        objectAuditingValue - The object auditing value for the user. Possible values are:
        • NONE - The auditing value for the object determines when auditing is performed.
        • "*CHANGE" - All changes accesses by this user on all objects with the *USRPRF audit value are logged.
        • "*ALL" - All change and read accesses by this use on all objects with the *USRPRF audit value are logged.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getObjectAuditingValue()
      • setOutputQueue

        public void setOutputQueue(String outputQueue)
                            throws AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   InterruptedException,
                                   IOException
        Sets the output queue to be used by this user profile. The output queue must already exist when this command is run. The caller must have *USE authority to the specified output queue.
        Parameters:
        outputQueue - The output queue to be used by this user profile. Possible values are:
        • "*WRKSTN" - The output queue assigned to the user's work station is used.
        • "*DEV" - The output queue associated with the printer specified for the Print device (PRTDEV) parameter is used. The output queue has the same name as the printer. (The pringer file DEV parameter is determined by the CRTPRTF, CHGPRTF, or the OVRPRTF command).

          Note: This assumes the defaults are specified for the Output queue (OUTQ) parameter for the printer file, job description, user profile, and workstation.

        • The fully qualified integrated file system path name of the output queue to be used by this user profile.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        QSYSObjectPathName, getOutputQueue()
      • setPrintDevice

        public void setPrintDevice(String printDevice)
                            throws AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   InterruptedException,
                                   IOException
        Sets the default printer device for this user. If the pringer file used to create printed output specifies to spool the data, the spooled file is placed on the device's output queue, which is named the same as the device.

        Note: This assumes the defaults are specified for the Output queue (OUTQ) parameter for the printer file, job description, user profile, and workstation.

        The caller must have *USE authority to the specified print device.

        Parameters:
        printDevice - The default printer device for this user. Possible values are:
        • "*WRKSTN" - The printer assigned to the user's work station is used.
        • "*SYSVAL" - The value specified in the system value QPRTDEV is used.
        • The name of a printer that is to be used to print the output for this user.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getPrintDevice()
      • setSpecialAuthority

        public void setSpecialAuthority(String[] specialAuthority)
                                 throws AS400SecurityException,
                                        ErrorCompletingRequestException,
                                        InterruptedException,
                                        IOException
        Sets the special authorities given to a user. Special authorities are required to perform certain functions on the system. Special authorities cannot be removed from many of the system-supplied user profiles, including QSECOFR and QSYS.

        The following special authorities are usually given:

        • Save system (*SAVSYS) special authority to users who need to operate the system.
        • Input/output system configuration (*IOSYSCFG) special authority to users who need to change system I/O configurations.
        • Job control (*JOBCTL) special authority is given to the user. The user is given the authority to change, display, hold, release, cancel, and clear all jobs that are running on the system or that are on a job queue or output queue that has OPRCTL (*YES) specified. The user also has the authority to load the system, to start writers, and to stop active subsystems.
        • Security administrator (*SECADM) special authority to users who need to create, change, or delete user profiles.
        • All object (*ALLOBJ) special authority to users who need to work with system resources.
        • Service (*SERVICE) special authority to users who need to perform service functions.
        • Spool control (*SPLCTL) special authority to users who need to perform all spool-related functions.
        • Audit (*AUDIT) special authority to users who need to perform auditing functions.

        Restrictions:

        • The user profile creating or changing another user profile must have all of the special authorities being given. All special authorities are needed to give all special authorities to another user profile.
        • A user must have *ALLOBJ and *SECADM special authorities to give a user *SECADM special authority when using the CHGUSRPRF command.
        • The user must have *ALLOBJ, *SECADM, and *AUDIT special authorities to give a user *AUDIT special authority when using the CHGUSRPRF command.
        Parameters:
        specialAuthority - The special authorities given to a user. Possible values for the elements of this array are:
        • "*USRCLS" - Special authorities are granted to this user based on the value specified on User class (USRCLS) parameter.
        • NONE - No special authorities are granted to this user.
        • SPECIAL_AUTHORITY_ALL_OBJECT - All object authority is given to the user. The user can access any system resource with or without private user authorizations.
        • SPECIAL_AUTHORITY_AUDIT - Audit authority is granted to this user. The user is given the authority to perform auditing functions. Auditing functions include turning auditing on or off for the system and controlling the level of auditing on an object or user.
        • SPECIAL_AUTHORITY_JOB_CONTROL - Job control authority is given to the user. The user has authority to change, display, hold, release, cancel, and clear all jobs that are running on the system or that are on a job queue or output queue that has OPRCTL (*YES) specified. The user also has the authority to start writers and to stop active subsystems.
        • SPECIAL_AUTHORITY_SAVE_SYSTEM - Save system authority is given to the user profile. This user has the authority to save, restore, and free storage for all objects on the system, with or without object management authority.
        • SPECIAL_AUTHORITY_IO_SYSTEM_CONFIGURATION - Input/output (I/O) system configuration authority is given to the user. The user has authority to change system I/O configurations.
        • SPECIAL_AUTHORITY_SECURITY_ADMINISTRATOR - Security administrator authority is given to the user. The user can create, change, or delete user profiles if authorized to the Create User Profile (CRTUSRPRF), Change User Profile (CHGUSRPRF), or Delete User Profile (DLTUSRPRF) commands and is authorized to the user profile. This authority does not allow giving special authorities that this user profile does not have. To give *SECADM special authority to another user, a user must have both *ALLOBJ and *SECADM special authorities.
        • SPECIAL_AUTHORITY_SERVICE - Service authority is given to this user. The user can perform service functions.
        • SPECIAL_AUTHORITY_SPOOL_CONTROL - Spool control authority is given to this user. The user can perform all spool functions.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getSpecialAuthority(), hasSpecialAuthority(java.lang.String)
      • setSupplementalGroups

        public void setSupplementalGroups(String[] supplementalGroups)
                                   throws AS400SecurityException,
                                          ErrorCompletingRequestException,
                                          InterruptedException,
                                          IOException
        Sets the user's supplemental group profiles. The profiles specified here, along with the group profile specified for the Group profile (GRPPRF) parameter, are used to determine what authority the user has if no specific user authority is given for the job. If profiles are specified for this parameter, a group profile name must be specified on the GRPPRF parameter for this user profile (either on this command or on a previous Create User Profile (CRTUSRPRF) or Change User Profile (CHGUSRPRF) command. The current user of this command must have object management (*OBJMGT) and change (*CHANGE) authority to the profiles specified for this. The required *OBJMGT authority cannot be given by a program adopt operation.

        Notes:

        • When a group profile is specified, the user is automatically granted *CHANGE and *OBJMGT authority to the group profile.
        • The following IBM-supplied user profiles are not valid for this parameter:

          QAUTPROF, QCLUMGT, QCLUSTER, QCOLSRV, QDBSHR, QDBSHRDO, QDFTOWN, QDIRSRV, QDLFM, QDOC, QDSNX, QEJB, QFNC, QGATE, QIPP, QLPAUTO, QLPINSTALL, QMGTC, QMSF, QNETSPLF, QNFSANON, QNTP, QPEX, QPM400, QRJE, QSNADS, QSPL, QSPLJOB, QSRV, QSRVAGT, QSRVBAS, QSYS, QTCM, QTCP, QTFTP, QTSTRQS, QYCMCIMOM, QYPSJSVR

        Parameters:
        supplementalGroups - The user's supplemental group profiles. Possible values for the elements of this array are:
        • NONE - No supplemental group profiles are used with this user profile.
        • The group profile names to be used with this user profile and the group profile specified on the GRPPRF parameter to determine a job's eligibility for getting access to existing objects and special authority. A maximum of 15 group profile names may be specified.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getSupplementalGroups()
      • setSystem

        public void setSystem(AS400 system)
                       throws PropertyVetoException
        Sets the system object representing the system on which the user profile exists. This property cannot be changed if the object has established a connection to the system.
        Parameters:
        system - The system object representing the system on which the user profile exists.
        Throws:
        PropertyVetoException - If any of the registered listeners vetos the property change.
        See Also:
        getSystem()
      • setUserActionAuditLevel

        public void setUserActionAuditLevel(String[] userActionAuditLevel)
                                     throws AS400SecurityException,
                                            ErrorCompletingRequestException,
                                            InterruptedException,
                                            IOException
        Sets the level of activity that is audited for this user profile. Note: The system values QAUDLVL and QAUDLVL2 are used in conjunction with this parameter. Example: If QAUDLVL is set to *DELETE and AUDLVL is set to *CREATE, then both *DELETE and *CREATE would be audited for this user. The default value for the QAUDLVL and QAUDLVL2 system values is NONE.

        Implementation note: The method internally calls the Change User Auditing (CHGUSRAUD) command and not the Change User Profile (CHGUSRPRF) command. The caller must have audit (*AUDIT) special authority. Changes take effect the next time a job is started for this user.

        Parameters:
        userActionAuditLevel - The level of activity that is audited for this user profile. Possible values for the elements of this array are:
        • NONE - No auditing level is specified. The auditing level for this user is taken from system values QAUDLVL and QAUDLVL2.
        • "*CMD" - CL command strings, System/36 environment operator control commands, and System/36 enviromnent procedures are logged for this user.
        • "*CREATE" - Auditing entries are sent when objects are created by this user.
        • "*DELETE" - Auditing entries are sent when objects are deleteed by this user.
        • "*JOBDTA" - The following actions taken by this user that affect a job are audited:
          • Job start and stop data.
          • Hold, release, stop, continue, change, disconnect, end, end abnormal.
          • Program start request (PSR) is attached to a prestart job.
        • "*OBJMGT" - Object management changes made by this user, such as move or rename, are audited.
        • "*OFCSRV" - Office services changes made by this user, such as changes to the system directory and use of OfficeVision, are audited.
        • "*OPTICAL" - The following optical functions are audited:
          • Add or remove optical cartridge.
          • Change the authorization list used to secure an optical volume.
          • Open optical file or directory.
          • Create or delete optical directory.
          • Change or retrieve optical directory attributes.
          • Copy, move, or rename optical file.
          • Copy optical directory.
          • Back up optical volume.
          • Initialize or rename optical volume.
          • Convert backup optical volume to a primary volume.
          • Save or release help optical file.
          • Absolute read of an optical volume.
        • "*PGMADP" - Authority obtained through program adoption is audited for this user.
        • "*SAVRST" - Save and restore actions performed by this user are audited.
        • "*SECURITY" - Security changes made by this user are audited.
        • "*SERVICE" - User of the system service tools by this user is audited.
        • "*SPLFDTA" - Spooled file operations made by this user are audited.
        • "*SYSMGT" - Use of system management functions by this user are audited.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getUserActionAuditLevel()
      • setUserClassName

        public void setUserClassName(String userClassName)
                              throws AS400SecurityException,
                                     ErrorCompletingRequestException,
                                     InterruptedException,
                                     IOException
        Sets the type of user associated with this user profile: security officer, security administrator, programmer, system operator, or user. The user class controls the options that are shown on a menu. Special authorities are given only if *USRCLS is specified for the Special authority (SPCAUT) parameter. If SPCAUT(*USRCLS) is specified, the special authorities granted will differ depending on the QSECURITY value.
        Parameters:
        userClassName - The type of user associated with this user profile. Possible values are:
        • "*USER" - At QSECURITY level 10 or 20, the user has *ALLOBJ and *SAVSYS authority. At QSECURITY level 30 or above, the user has no special authorities.
        • "*SECOFR" - At all levels of security, the security officer is granted the following special authorities:
          • *ALLOBJ
          • *SAVSYS
          • *JOBCTL
          • *SERVICE
          • *SPLCTL
          • *SECADM
          • *AUDIT
          • *IOSYSCFG
        • "*SECADM" - At QSECURITY level 10 or 20, the security administrator has *ALLOBJ, *SAVSYS, *SECADM, and *JOBCTL special authorities. At QSECURITY level 30 or above, the user has *SECADM special authority.
        • "*PGMR" - At QSECURITY level 10 or 20, the programmer has *ALLOBJ, *SAVSYS, and *JOBCTL special authorities. At QSECURITY level 30 or above, the user has no special authorities.
        • "*SYSOPR" - At QSECURITY level 10 or 20, the system operator has *ALLOBJ, *SAVSYS, and *JOBCTL special authorities. At QSECURITY level 30 or above, the user has *SAVSYS and *JOBCTL special authorities.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getUserClassName()
      • setUserOptions

        public void setUserOptions(String[] userOptions)
                            throws AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   InterruptedException,
                                   IOException
        Sets the level of help information detail to be shown and the function of the Page Up and Page Down keys by default. The system shows several displays that are suitable for the inexperienced user. More experienced users must perform an extra action to see detailed information. When values are specified for this parameter, the system presents detailed information without further action by the experienced user.
        Parameters:
        userOptions - The level of help information detail to be shown and the function of the Page Up and Page Down keys by default. Possible values include:
        • NONE - Detailed information is not shown.
        • "*CLKWD" - Parameter keywords are shown instead of the possible parameter values when a control language (CL) command is prompted.
        • "*EXPERT" - More detailed information is shown when the user is performing display and edit options to define or change the system (such as edit or display object authority).
        • "*ROLLKEY" - The actions of the Page Up and Page Down keys are reversed.
        • "*NOSTSMSG" - Status messages are not displayed when sent to the user.
        • "*STSMSG" - Status messages are displayed when sent to the user.
        • "*HLPFULL" - Help text is shown on a full display rather than in a window.
        • "*PRTMSG" - A message is sent to this user's message queue when a spooled file for this user is printed or held by the printer writer.
        Throws:
        AS400SecurityException
        ErrorCompletingRequestException
        InterruptedException
        IOException
        See Also:
        getUserOptions()
      • toString

        public String toString()
        Sets the string representation of this User object.
        Overrides:
        toString in class Object
        Returns:
        The user profile name.