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.server.kerberos.shared.store;
21  
22  
23  import java.util.Map;
24  
25  import javax.security.auth.kerberos.KerberosPrincipal;
26  
27  import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
28  import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
29  import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
30  import org.apache.directory.server.kerberos.shared.messages.value.SamType;
31  
32  
33  /**
34   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
35   * @version $Rev: 544729 $, $Date: 2007-06-06 07:01:24 +0200 (Mi, 06 Jun 2007) $
36   */
37  public class PrincipalStoreEntry
38  {
39      // principal
40      private String distinguishedName;
41      private String commonName;
42      private KerberosPrincipal principal;
43      private String realmName;
44  
45      // uidObject
46      private String userId;
47  
48      // KDCEntry
49      private KerberosTime validStart;
50      private KerberosTime validEnd;
51      private KerberosTime passwordEnd;
52      private int keyVersionNumber;
53      private int maxLife;
54      private int maxRenew;
55      private int kdcFlags;
56      private SamType samType;
57  
58      private boolean disabled;
59      private boolean lockedOut;
60      private KerberosTime expiration;
61  
62      private Map<EncryptionType, EncryptionKey> keyMap;
63  
64  
65      PrincipalStoreEntry( String distinguishedName, String commonName, String userId, KerberosPrincipal principal,
66          int keyVersionNumber, KerberosTime validStart, KerberosTime validEnd, KerberosTime passwordEnd, int maxLife,
67          int maxRenew, int kdcFlags, Map<EncryptionType, EncryptionKey> keyMap, String realmName, SamType samType,
68          boolean disabled, boolean lockedOut, KerberosTime expiration )
69      {
70          this.distinguishedName = distinguishedName;
71          this.commonName = commonName;
72          this.userId = userId;
73          this.principal = principal;
74          this.validStart = validStart;
75          this.validEnd = validEnd;
76          this.passwordEnd = passwordEnd;
77          this.keyVersionNumber = keyVersionNumber;
78          this.maxLife = maxLife;
79          this.maxRenew = maxRenew;
80          this.kdcFlags = kdcFlags;
81          this.realmName = realmName;
82          this.disabled = disabled;
83          this.lockedOut = lockedOut;
84          this.expiration = expiration;
85          this.samType = samType;
86          this.keyMap = keyMap;
87      }
88  
89  
90      /**
91       * Returns whether this account is disabled.
92       *
93       * @return Whether this account is disabled.
94       */
95      public boolean isDisabled()
96      {
97          return disabled;
98      }
99  
100 
101     /**
102      * Returns whether this account is locked-out.
103      *
104      * @return Whether this account is locked-out.
105      */
106     public boolean isLockedOut()
107     {
108         return lockedOut;
109     }
110 
111 
112     /**
113      * Returns the expiration time.
114      *
115      * @return The expiration time.
116      */
117     public KerberosTime getExpiration()
118     {
119         return expiration;
120     }
121 
122 
123     /**
124      * Returns the distinguished name.
125      *
126      * @return The distinguished name.
127      */
128     public String getDistinguishedName()
129     {
130         return distinguishedName;
131     }
132 
133 
134     /**
135      * Returns the common name.
136      *
137      * @return The common name.
138      */
139     public String getCommonName()
140     {
141         return commonName;
142     }
143 
144 
145     /**
146      * Returns the user ID.
147      *
148      * @return The user ID.
149      */
150     public String getUserId()
151     {
152         return userId;
153     }
154 
155 
156     /**
157      * Returns the key map.
158      *
159      * @return The key map.
160      */
161     public Map<EncryptionType, EncryptionKey> getKeyMap()
162     {
163         return keyMap;
164     }
165 
166 
167     /**
168      * Returns the KDC flags.
169      *
170      * @return The KDC flags.
171      */
172     public int getKDCFlags()
173     {
174         return kdcFlags;
175     }
176 
177 
178     /**
179      * Returns the key version number (kvno).
180      *
181      * @return The key version number (kvno).
182      */
183     public int getKeyVersionNumber()
184     {
185         return keyVersionNumber;
186     }
187 
188 
189     /**
190      * Returns the max life.
191      *
192      * @return The max life.
193      */
194     public int getMaxLife()
195     {
196         return maxLife;
197     }
198 
199 
200     /**
201      * Returns the maximum renew time.
202      *
203      * @return The maximum renew time.
204      */
205     public int getMaxRenew()
206     {
207         return maxRenew;
208     }
209 
210 
211     /**
212      * Returns the expiration time for the password.
213      *
214      * @return The expiration time for the password.
215      */
216     public KerberosTime getPasswordEnd()
217     {
218         return passwordEnd;
219     }
220 
221 
222     /**
223      * Returns the principal.
224      *
225      * @return The principal.
226      */
227     public KerberosPrincipal getPrincipal()
228     {
229         return principal;
230     }
231 
232 
233     /**
234      * Returns the realm name.
235      *
236      * @return The realm name.
237      */
238     public String getRealmName()
239     {
240         return realmName;
241     }
242 
243 
244     /**
245      * Returns the end of validity.
246      *
247      * @return The end of validity.
248      */
249     public KerberosTime getValidEnd()
250     {
251         return validEnd;
252     }
253 
254 
255     /**
256      * Returns the start of validity.
257      *
258      * @return The start of validity.
259      */
260     public KerberosTime getValidStart()
261     {
262         return validStart;
263     }
264 
265 
266     /**
267      * Returns the single-use authentication (SAM) type.
268      *
269      * @return The single-use authentication (SAM) type.
270      */
271     public SamType getSamType()
272     {
273         return samType;
274     }
275 }