Class PWResetModelImpl

    • Field Detail

      • debug

        public static Debug debug
        Debug object
      • ssoToken

        protected SSOToken ssoToken
        SSO token object
      • resBundle

        protected ResourceBundle resBundle
        Resource bundle object
      • userId

        protected String userId
        User distinguished name
      • errorMsg

        protected String errorMsg
        Error message stored in the model
      • informationMsg

        protected String informationMsg
        Info message stored in the model
      • passwordResetMsg

        protected String passwordResetMsg
        Reset password message stored in the model
      • pwResetLockoutAttrName

        public String pwResetLockoutAttrName
      • pwResetLockoutAttrValue

        public String pwResetLockoutAttrValue
    • Constructor Detail

      • PWResetModelImpl

        public PWResetModelImpl()
        Creates a base model for password reset.
    • Method Detail

      • getLocalizedString

        public String getLocalizedString​(String key)
        Returns localized string.
        Specified by:
        getLocalizedString in interface PWResetModel
        Parameters:
        key - resource string key.
        Returns:
        localized string.
      • getUserLocaleContext

        public ISLocaleContext getUserLocaleContext()
        Returns locale of user.
        Returns:
        user's locale.
      • debugError

        public void debugError​(String message)
        Prints a message to the console debug file. The message will only be written if the the debug level is set to Error.
        Specified by:
        debugError in interface PWResetModel
        Parameters:
        message - to be sent to the debug file.
      • debugError

        public void debugError​(String message,
                               Exception e)
        Prints a message to the console debug file. The message will only be written if the the debug level is set to Error.
        Specified by:
        debugError in interface PWResetModel
        Parameters:
        message - to be printed. If message is null it is ignored.
        e - printStackTrace will be invoked to print the stack trace.
      • warningEnabled

        public boolean warningEnabled()
        true if warning message is enabled.
        Specified by:
        warningEnabled in interface PWResetModel
        Returns:
        true if warning message is enabled.
      • debugWarning

        public void debugWarning​(String message)
        Prints a message to the console debug file. The message will only be written if the the debug level is set greater than Error.
        Specified by:
        debugWarning in interface PWResetModel
        Parameters:
        message - to be printed. If message is null it is ignored.
      • debugWarning

        public void debugWarning​(String message,
                                 Exception e)
        Prints a message to the console debug file. The message will only be written if the the debug level is set greater than Error.
        Specified by:
        debugWarning in interface PWResetModel
        Parameters:
        message - to be printed. If message is null it is ignored.
        e - printStackTrace will be invoked to print the stack trace.
      • messageEnabled

        public boolean messageEnabled()
        Returns true if message debugging is enabled.
        Specified by:
        messageEnabled in interface PWResetModel
        Returns:
        true if message debugging is enabled.
        See Also:
        com.iplanet.am.util.Debug#messageEnabled
      • debugMessage

        public void debugMessage​(String message)
        Prints a message to the console debug file. The message will only be written if the the debug level is set greater than Error.
        Specified by:
        debugMessage in interface PWResetModel
        Parameters:
        message - to be printed. If message is null it is ignored.
      • debugMessage

        public void debugMessage​(String message,
                                 Exception e)
        Prints a message to the console debug file. The message will only be written if the the debug level is set greater than Error.
        Specified by:
        debugMessage in interface PWResetModel
        Parameters:
        message - to be printed. If message is null it is ignored.
        e - printStackTrace will be invoked to print the stack trace.
      • isPasswordResetEnabled

        public boolean isPasswordResetEnabled()
        Returns true if the password service is available.
        Specified by:
        isPasswordResetEnabled in interface PWResetModel
        Returns:
        true if the password service is available.
      • getUserId

        public String getUserId()
        Returns the user distinguished name.
        Specified by:
        getUserId in interface PWResetModel
        Returns:
        user distinguished name.
      • setUserDN

        public void setUserDN​(String value)
        Set the user distinguished name.
        Specified by:
        setUserDN in interface PWResetModel
        Parameters:
        value - user distinguished name.
      • getErrorTitle

        public String getErrorTitle()
        Returns title for error message.
        Specified by:
        getErrorTitle in interface PWResetModel
        Returns:
        title for error message.
      • isError

        public boolean isError()
        Returns true if there is an error while processing request.
        Specified by:
        isError in interface PWResetModel
        Returns:
        true if there is an error while processing request.
      • getErrorString

        public String getErrorString​(Exception ex)
        Returns a localized error message from an exception. If the exception is of type AMException the error code and any possible arguments will be extracted from the exception and the message will be generated from the code and arguments. All other exception types will return the message from Exception.getMessage.
        Specified by:
        getErrorString in interface PWResetModel
        Parameters:
        ex - exception
        Returns:
        Error message localized to users locale.
      • getL10NAttributeName

        protected String getL10NAttributeName​(ServiceSchemaManager mgr,
                                              String key)
        Returns localized string of an attribute in a service
        Parameters:
        mgr - Service schema manager.
        key - localization key of the attribute.
        Returns:
        localized string of an attribute in a service.
      • getL10NAttributeName

        public String getL10NAttributeName​(String serviceName,
                                           String key)
        Returns localized string of an attribute in a service.
        Parameters:
        serviceName - Name of service.
        key - Localization key of the attribute.
        Returns:
        localized string of an attribute in a service.
      • readPWResetProfile

        public void readPWResetProfile​(String realm)
        Sets the password reset enabled flag depending what is set in the password service for a given realm.
        Specified by:
        readPWResetProfile in interface PWResetModel
        Parameters:
        realm - Realm
      • getFirstElement

        public static String getFirstElement​(Set set)
        Returns the first String element from the given set. If the set is empty, or null, an empty string will be returned.
        Parameters:
        set - where element resides
        Returns:
        first String element from the set.
      • writeLog

        public void writeLog​(String msgId,
                             String userDN)
        Writes to the log file formatted message.
        Parameters:
        msgId - Id of the message to be written
        userDN - user distinguished name
      • writeLog

        public void writeLog​(String msgId,
                             String msg,
                             String userDN)
        Writes to the log file formatted message.
        Parameters:
        msgId - Id of the message to be written
        msg - additional message to be written
        userDN - user distinguished name
      • isPasswordResetFailureLockoutEnabled

        public boolean isPasswordResetFailureLockoutEnabled()
        Returns true if the password reset lockout feature is enabled.
        Returns:
        true if the password reset lockout feature is enabled.
      • getPasswordResetFailureLockoutDuration

        public long getPasswordResetFailureLockoutDuration()
        Returns lockout duration for password reset.
        Returns:
        lockout duration for password reset
      • getPasswordResetFailureLockoutMultiplier

        public int getPasswordResetFailureLockoutMultiplier()
        Returns lockout multiplier for password reset.
        Returns:
        lockout multiplier for password reset
      • getPasswordResetFailureLockoutTime

        public long getPasswordResetFailureLockoutTime()
        Returns failure lockout time interval for password reset.
        Returns:
        failure duration interval for password reset
      • getPasswordResetFailureLockoutCount

        public int getPasswordResetFailureLockoutCount()
        Returns failure lockout count for password reset.
        Returns:
        failure lockout count for password reset
      • getPasswordResetLockoutNotification

        public String getPasswordResetLockoutNotification()
        Returns lockout notification email address for password reset.
        Returns:
        lockout notification email address for password reset
      • getPasswordResetLockoutUserWarningCount

        public int getPasswordResetLockoutUserWarningCount()
        Returns lockout warn user count for password reset.
        Returns:
        lockout warn user count for password reset
      • populateLockoutValues

        public void populateLockoutValues​(String orgDN)
        Populates the password reset lockout attributes for a given organization distinguished name and stored them in the model.
        Parameters:
        orgDN - organization distinguished name
      • isUserLockout

        public boolean isUserLockout​(String userDN,
                                     String orgDN)
        Returns true if the user is locked out from resetting password.
        Specified by:
        isUserLockout in interface PWResetModel
        Parameters:
        userDN - user distinguished name
        orgDN - organization distinguished name
        Returns:
        true if the user is locked out
      • sendEmailToUser

        public void sendEmailToUser​(String from,
                                    String[] to,
                                    String subject,
                                    String msg,
                                    String charset)
        Sents email to the user(s).
        Parameters:
        from - sender email address
        to - user to which email is send to
        subject - email subject
        msg - email message
        charset - charset value
      • getPasswordResetLockoutAttributeName

        public String getPasswordResetLockoutAttributeName()
        Returns password reset lockout attribute name.
        Returns:
        password reset lockout attribute name
      • getPasswordResetLockoutAttributeValue

        public String getPasswordResetLockoutAttributeValue()
        Returns password reset lockout attribute value.
        Returns:
        password reset lockout attribute value
      • getSunLogoLabel

        public String getSunLogoLabel()
        Returns label for SUN logo.
        Specified by:
        getSunLogoLabel in interface PWResetModel
        Returns:
        label for SUN logo.
      • getProductLabel

        public String getProductLabel()
        Returns label for product logo.
        Specified by:
        getProductLabel in interface PWResetModel
        Returns:
        label for product logo.
      • getJavaLogoLabel

        public String getJavaLogoLabel()
        Returns label for Java logo.
        Specified by:
        getJavaLogoLabel in interface PWResetModel
        Returns:
        label for Java logo.
      • getSSOToken

        protected SSOToken getSSOToken()
      • setUserLocale

        public void setUserLocale​(String localeString)
        Sets the user locale.
        Specified by:
        setUserLocale in interface PWResetModel
        Parameters:
        localeString - localeString.
      • getMailAttribute

        public String getMailAttribute​(String realm)
        Returns the name of the mail attribute.
        Specified by:
        getMailAttribute in interface PWResetModel
        Parameters:
        realm - The realm the user belongs to.
        Returns:
        The name of the mail attribute in the provided realm.