/**
 * Copyright (c) 2000-2017 Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * pSubscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */

package com.liferay.portal.security.auth;

import com.liferay.portal.kernel.util.AutoResetThreadLocal;

/**
 * @author Michael C. Han
 */
public class PasswordModificationThreadLocal {

	public static String getPasswordUnencrypted() {
		return _passwordUnencrypted.get();
	}

	public static boolean isPasswordModified() {
		return _passwordModified.get();
	}

	public static void setPasswordModified(boolean passwordModified) {
		_passwordModified.set(passwordModified);
	}

	public static void setPasswordUnencrypted(String passwordUnencrypted) {
		_passwordUnencrypted.set(passwordUnencrypted);
	}

	private static final ThreadLocal<Boolean> _passwordModified =
		new AutoResetThreadLocal<Boolean>(
			PrincipalThreadLocal.class + "._passwordModified", false);
	private static final ThreadLocal<String> _passwordUnencrypted =
		new AutoResetThreadLocal<String>(
			PrincipalThreadLocal.class + "._passwordUnencrypted");

}