Class UserAccountControlValueTranscoder

  • All Implemented Interfaces:
    org.ldaptive.transcode.ValueTranscoder<Integer>

    public class UserAccountControlValueTranscoder
    extends org.ldaptive.transcode.AbstractStringValueTranscoder<Integer>
    The user account control value transcoder.
    Author:
    Christian Bremer
    • Field Detail

      • ATTRIBUTE_NAME

        public static final String ATTRIBUTE_NAME
        The attribute name in an active directory controller.
        See Also:
        Constant Field Values
      • ACCOUNT_DISABLED

        public static final int ACCOUNT_DISABLED
        The bit map value of a disabled account.
        See Also:
        Constant Field Values
      • NORMAL_ACCOUNT

        public static final int NORMAL_ACCOUNT
        The bit map value of a normal account.
        See Also:
        Constant Field Values
      • DONT_EXPIRE_PASSWORD

        public static final int DONT_EXPIRE_PASSWORD
        The bit map value a password that doesn't expire.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserAccountControlValueTranscoder

        public UserAccountControlValueTranscoder()
    • Method Detail

      • getUserAccountControlValue

        public static int getUserAccountControlValue​(Boolean enabled,
                                                     Integer existingValue)
        Gets user account control value.
        Parameters:
        enabled - the enabled
        existingValue - the existing value
        Returns:
        the user account control value
      • isUserAccountEnabled

        public static boolean isUserAccountEnabled​(Integer userAccountControlValue)
        Determines whether an account is enabled or not. If the user account control value is null, true will be returned (account is enabled).
        Parameters:
        userAccountControlValue - the user account control value (can be null)
        Returns:
        the boolean
      • isUserAccountEnabled

        public static boolean isUserAccountEnabled​(Integer userAccountControlValue,
                                                   boolean defaultValue)
        Determines whether an account is enabled or not.
        Parameters:
        userAccountControlValue - the user account control value (can be null)
        defaultValue - the default value (will be returned, if user account control value is null)
        Returns:
        the boolean
      • decodeStringValue

        public Integer decodeStringValue​(String value)
      • encodeStringValue

        public String encodeStringValue​(Integer value)