Class UserInfo


  • public class UserInfo
    extends java.lang.Object
    The UserInfo class represents Windows User's data structure and encapsulates methods that import and export that data to an Entry object.
    • Field Detail

      • LOGON_HOURS_ARRAY_LENGTH

        public static final int LOGON_HOURS_ARRAY_LENGTH
        The size of the array for the log on hours.
        See Also:
        Constant Field Values
      • DEFAULT_FLAGS_VALUE

        public static final java.lang.Integer DEFAULT_FLAGS_VALUE
        the following bits are set: UF_SCRIPT, UF_DONT_EXPIRE_PASSWD, UF_NORMAL_ACCOUNT
      • ACC_NEVER_EXPIRES

        public static final java.util.Date ACC_NEVER_EXPIRES
        "-1000" milliseconds presents "-1" second which is the "account never expires" value
      • USER_ATTR_USER_NAME

        public static final java.lang.String USER_ATTR_USER_NAME
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_ACCOUNT_COMMENT

        public static final java.lang.String USER_ATTR_ACCOUNT_COMMENT
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_FULL_NAME

        public static final java.lang.String USER_ATTR_FULL_NAME
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_USER_COMMENT

        public static final java.lang.String USER_ATTR_USER_COMMENT
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PASSWORD

        public static final java.lang.String USER_ATTR_PASSWORD
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PASSWORD_AGE

        public static final java.lang.String USER_ATTR_PASSWORD_AGE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PRIVILEGE_LEVEL

        public static final java.lang.String USER_ATTR_PRIVILEGE_LEVEL
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_HOME_DIRECTORY

        public static final java.lang.String USER_ATTR_HOME_DIRECTORY
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_FLAGS

        public static final java.lang.String USER_ATTR_FLAGS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_SCRIPTH_PATH

        public static final java.lang.String USER_ATTR_SCRIPTH_PATH
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_AUTH_FLAGS

        public static final java.lang.String USER_ATTR_AUTH_FLAGS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_APPLICATIONS_PARAMS

        public static final java.lang.String USER_ATTR_APPLICATIONS_PARAMS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LOGON_WORKSTATIONS

        public static final java.lang.String USER_ATTR_LOGON_WORKSTATIONS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LAST_LOGON

        public static final java.lang.String USER_ATTR_LAST_LOGON
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LAST_LOGOFF

        public static final java.lang.String USER_ATTR_LAST_LOGOFF
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_ACCOUNT_EXP_DATE

        public static final java.lang.String USER_ATTR_ACCOUNT_EXP_DATE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_MAX_ACC_DISK_SPACE

        public static final java.lang.String USER_ATTR_MAX_ACC_DISK_SPACE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_UNITS_PER_WEEK

        public static final java.lang.String USER_ATTR_UNITS_PER_WEEK
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LOGON_HOURS

        public static final java.lang.String USER_ATTR_LOGON_HOURS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_BAD_PASSWORD_CNT

        public static final java.lang.String USER_ATTR_BAD_PASSWORD_CNT
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LOGONS_NUM

        public static final java.lang.String USER_ATTR_LOGONS_NUM
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LOGON_SERVER

        public static final java.lang.String USER_ATTR_LOGON_SERVER
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_COUNTRY_CODE

        public static final java.lang.String USER_ATTR_COUNTRY_CODE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_CODE_PAGE

        public static final java.lang.String USER_ATTR_CODE_PAGE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_RELATIVE_USER_ID

        public static final java.lang.String USER_ATTR_RELATIVE_USER_ID
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PRIMARY_GROUP_ID

        public static final java.lang.String USER_ATTR_PRIMARY_GROUP_ID
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PROFILE_PATH

        public static final java.lang.String USER_ATTR_PROFILE_PATH
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_HOME_DIRECTORY_DRIVE

        public static final java.lang.String USER_ATTR_HOME_DIRECTORY_DRIVE
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PASSWORD_EXPIRED

        public static final java.lang.String USER_ATTR_PASSWORD_EXPIRED
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_LOCAL_GROUPS

        public static final java.lang.String USER_ATTR_LOCAL_GROUPS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_GLOBAL_GROUPS

        public static final java.lang.String USER_ATTR_GLOBAL_GROUPS
        User entry attribute's name
        See Also:
        Constant Field Values
      • USER_ATTR_PRIMARY_GROUP

        public static final java.lang.String USER_ATTR_PRIMARY_GROUP
        User entry attribute's name
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserInfo

        public UserInfo()
        Default constructor.
      • UserInfo

        protected UserInfo​(Entry aUserEntry)
        Constructs the UserInfo object and populates its members with User data from the given Entry parameter.
        Parameters:
        aUserEntry - The User Entry object containing data to initialize the new UserInfo object with.
    • Method Detail

      • getUserName

        public java.lang.String getUserName()
        Retrieves user defined value for the field
        Returns:
        String
      • getAccountComment

        public java.lang.String getAccountComment()
        Retrieves user defined value for the field
        Returns:
        String
      • getFullName

        public java.lang.String getFullName()
        Retrieves user defined value for the field
        Returns:
        String
      • getUserComment

        public java.lang.String getUserComment()
        Retrieves user defined value for the field
        Returns:
        String
      • getPassword

        public java.lang.String getPassword()
        Retrieves user defined value for the field
        Returns:
        String
      • getPasswordAge

        public java.lang.Long getPasswordAge()
        Retrieves user defined value for the field
        Returns:
        Long
      • getPrivilegeLevel

        public java.lang.Integer getPrivilegeLevel()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getHomeDirectory

        public java.lang.String getHomeDirectory()
        Retrieves user defined value for the field
        Returns:
        String
      • getFlags

        public java.lang.Integer getFlags()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getScriptPath

        public java.lang.String getScriptPath()
        Retrieves user defined value for the field
        Returns:
        String
      • getAuthFlags

        public java.lang.Integer getAuthFlags()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getApplicationsParams

        public java.lang.String getApplicationsParams()
        Retrieves user defined value for the field
        Returns:
        String
      • getLogonWorkstations

        public java.lang.String getLogonWorkstations()
        Retrieves user defined value for the field
        Returns:
        String
      • getLastLogon

        public java.util.Date getLastLogon()
        Retrieves user defined value for the field
        Returns:
        Date
      • getLastLogoff

        public java.util.Date getLastLogoff()
        Retrieves user defined value for the field
        Returns:
        Date
      • getAccountExpDate

        public java.util.Date getAccountExpDate()
        Retrieves user defined value for the field
        Returns:
        Date
      • getMaxAccDiskSpace

        public java.lang.Long getMaxAccDiskSpace()
        Retrieves user defined value for the field
        Returns:
        Long
      • getUnitsPerWeek

        public java.lang.Integer getUnitsPerWeek()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getLogonHours

        public byte[] getLogonHours()
        Retrieves user defined value for the field
        Returns:
        Byte array
      • getBadPasswordCnt

        public java.lang.Integer getBadPasswordCnt()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getLogonsNum

        public java.lang.Integer getLogonsNum()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getLogonServer

        public java.lang.String getLogonServer()
        Retrieves user defined value for the field
        Returns:
        String
      • getCountryCode

        public java.lang.Integer getCountryCode()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getCodePage

        public java.lang.Integer getCodePage()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getRelativeUserID

        public java.lang.Integer getRelativeUserID()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getPrimaryGroupID

        public java.lang.Integer getPrimaryGroupID()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getProfilePath

        public java.lang.String getProfilePath()
        Retrieves user defined value for the field
        Returns:
        String
      • getHomeDirectoryDrive

        public java.lang.String getHomeDirectoryDrive()
        Retrieves user defined value for the field
        Returns:
        String
      • getPasswordExpired

        public java.lang.Integer getPasswordExpired()
        Retrieves user defined value for the field
        Returns:
        Integer
      • getPrimaryGroup

        public java.lang.String getPrimaryGroup()
        Retrieves user defined value for the field
        Returns:
        String
      • setUserName

        public void setUserName​(java.lang.String aUserName)
        Sets user defined value for the field
        Parameters:
        aUserName - String
      • setAccountComment

        public void setAccountComment​(java.lang.String aAccountComment)
        Sets user defined value for the field
        Parameters:
        aAccountComment - String
      • setFullName

        public void setFullName​(java.lang.String aFullName)
        Sets user defined value for the field
        Parameters:
        aFullName - String
      • setUserComment

        public void setUserComment​(java.lang.String aUserComment)
        Sets user defined value for the field
        Parameters:
        aUserComment - String
      • setPassword

        public void setPassword​(java.lang.String aPassword)
        Sets user defined value for the field
        Parameters:
        aPassword - String
      • setPasswordAge

        public void setPasswordAge​(java.lang.Long aPasswordAge)
        Sets user defined value for the field
        Parameters:
        aPasswordAge - Long
      • setPrivilegeLevel

        public void setPrivilegeLevel​(java.lang.Integer aPrivilegeLevel)
        Sets user defined value for the field
        Parameters:
        aPrivilegeLevel - Integer
      • setHomeDirectory

        public void setHomeDirectory​(java.lang.String aHomeDirectory)
        Sets user defined value for the field
        Parameters:
        aHomeDirectory - String
      • setFlags

        public void setFlags​(java.lang.Integer aFlags)
        Sets user defined value for the field
        Parameters:
        aFlags - Integer
      • setScriptPath

        public void setScriptPath​(java.lang.String aScriptParh)
        Sets user defined value for the field
        Parameters:
        aScriptParh - String
      • setAuthFlags

        public void setAuthFlags​(java.lang.Integer aAuthFlags)
        Sets user defined value for the field
        Parameters:
        aAuthFlags - Integer
      • setApplicationsParams

        public void setApplicationsParams​(java.lang.String aApplicationsParams)
        Sets user defined value for the field
        Parameters:
        aApplicationsParams - String
      • setLogonWorkstations

        public void setLogonWorkstations​(java.lang.String aLogonWorkstations)
        Sets user defined value for the field
        Parameters:
        aLogonWorkstations - String
      • setLastLogon

        public void setLastLogon​(java.util.Date aLastLogon)
        Sets user defined value for the field
        Parameters:
        aLastLogon - Date
      • setLastLogoff

        public void setLastLogoff​(java.util.Date aLastLogoff)
        Sets user defined value for the field
        Parameters:
        aLastLogoff - Date
      • setAccountExpDate

        public void setAccountExpDate​(java.util.Date aAccountExpDate)
        Sets user defined value for the field
        Parameters:
        aAccountExpDate - Date
      • setMaxAccDiskSpace

        public void setMaxAccDiskSpace​(java.lang.Long aMaxAccDiskSpace)
        Sets user defined value for the field
        Parameters:
        aMaxAccDiskSpace - Long
      • setUnitsPerWeek

        public void setUnitsPerWeek​(java.lang.Integer aUnitsPerWeek)
        Sets user defined value for the field
        Parameters:
        aUnitsPerWeek - Integer
      • setLogonHours

        public void setLogonHours​(byte[] aLogonHours)
        Sets user defined value for the field
        Parameters:
        aLogonHours - byte[]
      • setBadPasswordCnt

        public void setBadPasswordCnt​(java.lang.Integer aBadPasswordCnt)
        Sets user defined value for the field
        Parameters:
        aBadPasswordCnt - Integer
      • setLogonsNum

        public void setLogonsNum​(java.lang.Integer aLogonsNum)
        Sets user defined value for the field
        Parameters:
        aLogonsNum - Integer
      • setLogonServer

        public void setLogonServer​(java.lang.String aLogonServer)
        Sets user defined value for the field
        Parameters:
        aLogonServer - String
      • setCountryCode

        public void setCountryCode​(java.lang.Integer aCountryCode)
        Sets user defined value for the field
        Parameters:
        aCountryCode - Integer
      • setCodePage

        public void setCodePage​(java.lang.Integer aCodePage)
        Sets user defined value for the field
        Parameters:
        aCodePage - Integer
      • setRelativeUserID

        public void setRelativeUserID​(java.lang.Integer aRelativeUserID)
        Sets user defined value for the field
        Parameters:
        aRelativeUserID - Integer
      • setPrimaryGroupID

        public void setPrimaryGroupID​(java.lang.Integer aPrimaryGroupID)
        Sets user defined value for the field
        Parameters:
        aPrimaryGroupID - Integer
      • setProfilePath

        public void setProfilePath​(java.lang.String aProfilePath)
        Sets user defined value for the field
        Parameters:
        aProfilePath - String
      • setHomeDirectoryDrive

        public void setHomeDirectoryDrive​(java.lang.String aHomeDirectoryDrive)
        Sets user defined value for the field
        Parameters:
        aHomeDirectoryDrive - String
      • setPasswordExpired

        public void setPasswordExpired​(java.lang.Integer aPasswordExpired)
        Sets user defined value for the field
        Parameters:
        aPasswordExpired - Integer
      • setPrimaryGroup

        public void setPrimaryGroup​(java.lang.String aPrimaryGroup)
        Sets user defined value for the field
        Parameters:
        aPrimaryGroup - String
      • copyDataFromUserEntry

        protected void copyDataFromUserEntry​(Entry aUserEntry)
        Copies data from a user entry.
        Parameters:
        aUserEntry - The user entry to copy from.
      • completeUserData

        protected void completeUserData​(UserInfo aUserInfo)
        All "null" data members are assigned the values of the corresponding aUserInfo's data members.
        Parameters:
        aUserInfo - The UserInfo instance which data members' data will be copied.
      • createAndAddUserBasicAttributes

        protected static void createAndAddUserBasicAttributes​(Entry aUserEntry,
                                                              UserInfo aUserInfo)
        Creates and adds basic Windows user's attributes to the given Entry object.
        Parameters:
        aUserEntry - The entry object that is going to be populated with attributes.
        aUserInfo - The UserInfo structure containing user's attributes values.
      • createAndAddUserLocalGroupAttribute

        protected static void createAndAddUserLocalGroupAttribute​(Entry aUserEntry,
                                                                  java.util.Vector aGroupNames)
        Creates and adds user's LocalGroup attribute to the given Entry object. The LocalGroup attribute is a Vector of local group names.
        Parameters:
        aUserEntry - The entry object that the LocalGroup attribute will be added to.
        aGroupNames - The vector containing the names of the user's local groups.
      • createAndAddUserGlobalGroupAttribute

        protected static void createAndAddUserGlobalGroupAttribute​(Entry aUserEntry,
                                                                   java.util.Vector aGroupNames)
        Creates and adds user's GlobalGroup attribute to the given Entry object. The GlobalGroup attribute is a Vector of global group names.
        Parameters:
        aUserEntry - The entry object that the GlobalGroup attribute will be added to.
        aGroupNames - The vector containing the names of the user's global groups.
      • queryUserSchema

        protected static java.util.Vector queryUserSchema()
        Retrieves connector user entry's structure.
        Returns:
        Vector of elements of type Entry describing each user's attribute structure.