com.ibm.as400.access

Class UserList

    • Field Detail

      • ALL

        public static final String ALL
        Selection value indicating that the list contains all user profiles and group profiles.
        See Also:
        Constant Field Values
      • USER

        public static final String USER
        Selection value indicating that the list contains only user profiles that are not group profiles. These are user profiles that do not have a group identifier specified.
        See Also:
        Constant Field Values
      • GROUP

        public static final String GROUP
        Selection value indicating that the list contains only user profiles that are group profiles. These are user profiles that have a group identifier specified.
        See Also:
        Constant Field Values
      • MEMBER

        public static final String MEMBER
        Selection value indicating that the list contains only user profiles that are members of a specified group.
        See Also:
        Constant Field Values
      • NOGROUP

        public static final String NOGROUP
        Selection value indicating that the list contains only user profiles that are not group profiles. These are user profiles that do not have a group identifier specified.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserList

        public UserList()
        Constructs a UserList object. The system must be set before calling any of the methods that connect to the system. The userInfo parameter defaults to ALL, the groupInfo parameter defaults to NONE, and the userProfile parameter defaults to ALL.
      • UserList

        public UserList(AS400 system)
        Constructs a UserList object. The userInfo parameter defaults to ALL, the groupInfo parameter defaults to NONE, and the userProfile parameter defaults to ALL.
        Parameters:
        system - The system object representing the system on which the users exists.
      • UserList

        public UserList(AS400 system,
                String userInfo,
                String groupInfo)
        Constructs a UserList object. The userProfile parameter defaults to ALL.
        Parameters:
        system - The system object representing the system on which the users exists.
        userInfo - The users to be returned. Possible values are:
        • ALL - All user profiles and group profiles are returned.
        • USER - Only user profiles that are not group profiles are returned. These are user profiles that do not have a group identifier specified.
        • GROUP - Only user profiles that are group profiles are returned. These are user profiles that have a group identifier specified.
        • MEMBER - User profiles that are members of the group specified for groupInfo are returned.
        groupInfo - The group profile whose members are to be returned. Possible values are:
        • NONE - No group profile is specified.
        • NOGROUP - Users who are not a member of any group are returned.
        • The group profile name - Users who are a member of this group are returned.
      • UserList

        public UserList(AS400 system,
                String userInfo,
                String groupInfo,
                String userProfile)
        Constructs a UserList object.
        Parameters:
        system - The system object representing the system on which the users exists.
        userInfo - The users to be returned. Possible values are:
        • ALL - All user profiles and group profiles are returned.
        • USER - Only user profiles that are not group profiles are returned. These are user profiles that do not have a group identifier specified.
        • GROUP - Only user profiles that are group profiles are returned. These are user profiles that have a group identifier specified.
        • MEMBER - User profiles that are members of the group specified for groupInfo are returned.
        groupInfo - The group profile whose members are to be returned. Possible values are:
        • NONE - No group profile is specified.
        • NOGROUP - Users who are not a member of any group are returned.
        • The group profile name - Users who are a member of this group are returned.
        userProfile - The profile names to include in the list. Possible values are:
        • ALL - All profiles are returned.
        • The user profile name - If a generic profile name is specifed, the profiles that match the the generic name are returned. If a simple profile name is specified, only that profile is returned.

    • Method Detail

      • getGroupInfo

        public String getGroupInfo()
        Returns the group profile whose members are to be returned.
        Returns:
        The group profile whose members are to be returned. Possible values are:
        • NONE - No group profile is specified.
        • NOGROUP - Users who are not a member of any group are returned.
        • The group profile name - Users who are a member of this group are returned.
      • getLength

        public int getLength()
        Returns the number of users in the user list. This method implicitly calls load().
        Returns:
        The number of users, or 0 if no list was retrieved.
        See Also:
        load()
      • getSystem

        public AS400 getSystem()
        Returns the system object representing the system on which the users exist.
        Returns:
        The system object representing the system on which the users exist. If the system has not been set, null is returned.
      • getUserInfo

        public String getUserInfo()
        Returns the description of which users are returned.
        Returns:
        The description of which users are returned. Possible values are:
        • ALL - All user profiles and group profiles are returned.
        • USER - Only user profiles that are not group profiles are returned. These are user profiles that do not have a group identifier specified.
        • GROUP - Only user profiles that are group profiles are returned. These are user profiles that have a group identifier specified.
        • MEMBER - User profiles that are members of the group specified for the group info are returned.
      • getUserProfile

        public String getUserProfile()
        Returns the user profile names of which users are returned.
        Returns:
        The profile names of which users are returned. Possible values are:
        • ALL - All profiles are returned.
        • The user profile name - If a generic profile name is specifed, the profiles that match the the generic name are returned. If a simple profile name is specified, only that profile is returned.
      • getUsers

        public User[] getUsers(int listOffset,
                      int number)
                        throws AS400SecurityException,
                               ErrorCompletingRequestException,
                               InterruptedException,
                               IOException,
                               ObjectDoesNotExistException
        Returns a subset of the list of users. This method allows the user to retrieve the user list from the system in pieces. If a call to load() is made (either implicitly or explicitly), then the users at a given list offset will change, so a subsequent call to getUsers() with the same listOffset and number will most likely not return the same Users as the previous call.
        Parameters:
        listOffset - The offset in the list of users (0-based). This value must be greater than or equal to 0 and less than the list length; or specify -1 to retrieve all of the users. Note: Prior to JTOpen 7.2, this parameter was incorrectly described.
        number - The number of users to retrieve out of the list, starting at the specified listOffset. This value must be greater than or equal to 0 and less than or equal to the list length. If the listOffset is -1, this parameter is ignored.
        Returns:
        The array of retrieved User and/or UserGroup objects. The length of this array may not necessarily be equal to number, depending upon the size of the list on the system, and the specified listOffset.
        Throws:
        AS400SecurityException - If a security or authority error occurs.
        ErrorCompletingRequestException - If an error occurs before the request is completed.
        InterruptedException - If this thread is interrupted.
        IOException - If an error occurs while communicating with the system.
        ObjectDoesNotExistException - If the object does not exist on the system.
        See Also:
        Job, close(), load()
      • 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.
      • setGroupInfo

        public void setGroupInfo(String groupInfo)
                          throws PropertyVetoException
        Sets the group profile whose members are to be returned.

        This must be set to a group profile name or NOGROUP if group info is set to MEMBER. This must be set to NONE if group info is not set to MEMBER.

        Parameters:
        groupInfo - The group profile whose members are to be returned. Possible values are:
        • NONE - No group profile is specified.
        • NOGROUP - Users who are not a member of any group are returned.
        • The group profile name - Users who are a member of this group are returned.
        Throws:
        PropertyVetoException - If any of the registered listeners vetos the property change.
      • setSystem

        public void setSystem(AS400 system)
                       throws PropertyVetoException
        Sets the system object representing the system on which the users exist. The system cannot be changed once a connection to the system has been established.
        Parameters:
        system - The system object representing the system on which the users exists.
        Throws:
        PropertyVetoException - If any of the registered listeners vetos the property change.
      • setUserInfo

        public void setUserInfo(String userInfo)
                         throws PropertyVetoException
        Sets which users are returned.
        Parameters:
        userInfo - A description of which users are returned. Possible values are:
        • ALL - All user profiles and group profiles are returned.
        • USER - Only user profiles that are not group profiles are returned. These are user profiles that do not have a group identifier specified.
        • GROUP - Only user profiles that are group profiles are returned. These are user profiles that have a group identifier specified.
        • MEMBER - User profiles that are members of the group specified for the group info are returned.
        Throws:
        PropertyVetoException - If any of the registered listeners vetos the property change.
      • setUserProfile

        public void setUserProfile(String userProfile)
        Sets which profile names to include in the list.
        Parameters:
        userProfile - The profile names to include in the list. Possible values are:
        • ALL - All profiles are returned.
        • The user profile name - If a generic profile name is specifed, the profiles that match the the generic name are returned. If a simple profile name is specified, only that profile is returned.
      • finalize

        protected void finalize()
                         throws Throwable
        Closes the list on the system when this object is garbage collected.
        Overrides:
        finalize in class Object
        Throws:
        Throwable