View Javadoc
1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  package org.apache.directory.api.ldap.extras.controls.ppolicy;
21  
22  
23  /**
24   * A PasswordPolicyResponse.
25   *
26   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
27   * @version $Rev$, $Date$
28   */
29  public class PasswordPolicyResponseImpl implements PasswordPolicyResponse
30  {
31      /** time before expiration of the password */
32      private int timeBeforeExpiration = -1;
33  
34      /** number of remaining grace authentications */
35      private int graceAuthNRemaining = -1;
36  
37      /** number representing the password policy error */
38      private PasswordPolicyErrorEnum ppolicyError;
39  
40  
41      /**
42       * {@inheritDoc}
43       */
44      @Override
45      public int getTimeBeforeExpiration()
46      {
47          return timeBeforeExpiration;
48      }
49  
50  
51      /**
52       * {@inheritDoc}
53       */
54      @Override
55      public void setTimeBeforeExpiration( int timeBeforeExpiration )
56      {
57          this.timeBeforeExpiration = timeBeforeExpiration;
58      }
59  
60  
61      /**
62       * {@inheritDoc}
63       */
64      @Override
65      public int getGraceAuthNRemaining()
66      {
67          return graceAuthNRemaining;
68      }
69  
70  
71      /**
72       * {@inheritDoc}
73       */
74      @Override
75      public void setGraceAuthNRemaining( int graceAuthNRemaining )
76      {
77          this.graceAuthNRemaining = graceAuthNRemaining;
78      }
79  
80  
81      /**
82       * {@inheritDoc}
83       */
84      @Override
85      public PasswordPolicyErrorEnum getPasswordPolicyError()
86      {
87          return ppolicyError;
88      }
89  
90  
91      /**
92       * {@inheritDoc}
93       */
94      @Override
95      public void setPasswordPolicyError( PasswordPolicyErrorEnum ppolicyError )
96      {
97          this.ppolicyError = ppolicyError;
98      }
99  
100 
101     @Override
102     public String toString()
103     {
104         return "PasswordPolicyResponse [timeBeforeExpiration=" + timeBeforeExpiration + ", graceAuthNRemaining="
105             + graceAuthNRemaining + ", ppolicyError=" + ppolicyError + "]";
106     }
107 }