001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.api.ldap.extras.controls.ppolicy; 021 022 023/** 024 * The PasswordPolicy response. It contains information about the error if we 025 * had one when injecting a bad password into the server. 026 * 027 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 028 * @version $Rev$, $Date$ 029 */ 030public interface PasswordPolicyResponse 031{ 032 /** 033 * Returns the time before expiration. Will return -1 if this warning 034 * was not present in the response. 035 * 036 * @return The time before expiration of the password, or -1 if not set 037 */ 038 int getTimeBeforeExpiration(); 039 040 041 /** 042 * Set a date of expiration for the password. 043 * 044 * @param timeBeforeExpiration The time before the password will expire 045 */ 046 void setTimeBeforeExpiration( int timeBeforeExpiration ); 047 048 049 /** 050 * Returns the number of possible attempts on the password before it's 051 * locked. Will return -1 if this warning was not present in the 052 * response. 053 * 054 * @return The number of possible attempts on the password before it's locked 055 */ 056 int getGraceAuthNRemaining(); 057 058 059 /** 060 * Sets the number of remaining wrong authentication for this password. 061 * 062 * @param graceAuthNRemaining The number of remaining attempts 063 */ 064 void setGraceAuthNRemaining( int graceAuthNRemaining ); 065 066 067 /** 068 * Returns the password policy error. 069 * 070 * @return The PasswordPolicyErrorEnum representing the error 071 */ 072 PasswordPolicyErrorEnum getPasswordPolicyError(); 073 074 075 /** 076 * Sets the PasswordPolicy error. 077 * 078 * @param ppolicyError The PasswordPolicyErrorEnum representing the error 079 */ 080 void setPasswordPolicyError( PasswordPolicyErrorEnum ppolicyError ); 081}