Source Code Cross Referenced for InternalCredentialImpl.java in  » Portal » jetspeed-2.1.3 » org » apache » jetspeed » security » om » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » jetspeed 2.1.3 » org.apache.jetspeed.security.om.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.jetspeed.security.om.impl;
018:
019:        import java.sql.Date;
020:        import java.sql.Timestamp;
021:
022:        import org.apache.jetspeed.security.om.InternalCredential;
023:
024:        /**
025:         * <p>{@link InternalCredential} interface implementation.</p>
026:         * 
027:         * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
028:         * @version $Id: InternalCredentialImpl.java 516448 2007-03-09 16:25:47Z ate $
029:         */
030:        public class InternalCredentialImpl implements  InternalCredential {
031:            /** The serial version uid. */
032:            private static final long serialVersionUID = -8064404995292602590L;
033:
034:            /**
035:             * <p>InternalCredential implementation default constructor.</p>
036:             */
037:            public InternalCredentialImpl() {
038:            }
039:
040:            /**
041:             * <p>InternalCredentialImpl constructor given a value, type and classname.</p>
042:             * @param principalId The principal id.
043:             * @param value The value.
044:             * @param type The type.
045:             * @param classname The classname.
046:             */
047:            public InternalCredentialImpl(long principalId, String value,
048:                    int type, String classname) {
049:                this .principalId = principalId;
050:                this .value = value;
051:                this .type = type;
052:                this .classname = classname;
053:                this .creationDate = new Timestamp(new java.util.Date()
054:                        .getTime());
055:                this .modifiedDate = this .creationDate;
056:            }
057:
058:            /**
059:             * <p>InternalCredentialImpl copy constructor given another InternalCredential and overriding classname</p>
060:             * @param credential The credential to copy from
061:             * @param classname The classname for the new credential
062:             */
063:            public InternalCredentialImpl(InternalCredential credential,
064:                    String classname) {
065:                this .authenticationFailures = credential
066:                        .getAuthenticationFailures();
067:                this .classname = classname;
068:                this .creationDate = credential.getCreationDate();
069:                this .enabled = credential.isEnabled();
070:                this .encoded = credential.isEncoded();
071:                this .expirationDate = credential.getExpirationDate();
072:                this .expired = credential.isExpired();
073:                this .previousAuthenticationDate = credential
074:                        .getPreviousAuthenticationDate();
075:                this .lastAuthenticationDate = credential
076:                        .getLastAuthenticationDate();
077:                this .modifiedDate = credential.getModifiedDate();
078:                this .principalId = credential.getPrincipalId();
079:                this .type = credential.getType();
080:                this .updateRequired = credential.isUpdateRequired();
081:                this .value = credential.getValue();
082:            }
083:
084:            private long credentialId;
085:
086:            /**
087:             * @see org.apache.jetspeed.security.om.InternalCredential#getCredentialId()
088:             */
089:            public long getCredentialId() {
090:                return this .credentialId;
091:            }
092:
093:            /**
094:             * @see org.apache.jetspeed.security.om.InternalCredential#setCredentialId(long)
095:             */
096:            public void setCredentialId(long credentialId) {
097:                this .credentialId = credentialId;
098:            }
099:
100:            private long principalId;
101:
102:            /**
103:             * @see org.apache.jetspeed.security.om.InternalCredential#getPrincipalId()
104:             */
105:            public long getPrincipalId() {
106:                return this .principalId;
107:            }
108:
109:            /**
110:             * @see org.apache.jetspeed.security.om.InternalCredential#setPrincipalId(long)
111:             */
112:            public void setPrincipalId(long principalId) {
113:                this .principalId = principalId;
114:            }
115:
116:            private String value;
117:
118:            /**
119:             * @see org.apache.jetspeed.security.om.InternalCredential#getValue()
120:             */
121:            public String getValue() {
122:                return this .value;
123:            }
124:
125:            /**
126:             * @see org.apache.jetspeed.security.om.InternalCredential#setValue(java.lang.String)
127:             */
128:            public void setValue(String value) {
129:                this .value = value;
130:            }
131:
132:            private boolean updateRequired;
133:
134:            /**
135:             * @see org.apache.jetspeed.security.om.InternalCredential#isUpdateRequired()
136:             */
137:            public boolean isUpdateRequired() {
138:                return updateRequired;
139:            }
140:
141:            /*
142:             * @see org.apache.jetspeed.security.om.InternalCredential#setUpdateRequired(boolean)
143:             */
144:            public void setUpdateRequired(boolean updateRequired) {
145:                this .updateRequired = updateRequired;
146:            }
147:
148:            private boolean encoded;
149:
150:            /** 
151:             * @see org.apache.jetspeed.security.om.InternalCredential#isEncoded()
152:             */
153:            public boolean isEncoded() {
154:                return encoded;
155:            }
156:
157:            /** 
158:             * @see org.apache.jetspeed.security.om.InternalCredential#setEncoded(boolean)
159:             */
160:            public void setEncoded(boolean encoded) {
161:                this .encoded = encoded;
162:            }
163:
164:            private boolean enabled = true;
165:
166:            /** 
167:             * @see org.apache.jetspeed.security.om.InternalCredential#isEnabled()
168:             */
169:            public boolean isEnabled() {
170:                return enabled;
171:            }
172:
173:            /** 
174:             * @see org.apache.jetspeed.security.om.InternalCredential#setEnabled(boolean)
175:             */
176:            public void setEnabled(boolean enabled) {
177:                this .enabled = enabled;
178:            }
179:
180:            private int authenticationFailures;
181:
182:            /** 
183:             * @see org.apache.jetspeed.security.om.InternalCredential#getAuthenticationFailures()
184:             */
185:            public int getAuthenticationFailures() {
186:                return authenticationFailures;
187:            }
188:
189:            /**
190:             * @see org.apache.jetspeed.security.om.InternalCredential#setAuthenticationFailures(int)
191:             */
192:            public void setAuthenticationFailures(int authenticationFailures) {
193:                this .authenticationFailures = authenticationFailures;
194:            }
195:
196:            private boolean expired;
197:
198:            /**
199:             * @see org.apache.jetspeed.security.om.InternalCredential#isExpired()
200:             */
201:            public boolean isExpired() {
202:                return expired;
203:            }
204:
205:            /**
206:             * @see org.apache.jetspeed.security.om.InternalCredential#setExpired(boolean)
207:             */
208:            public void setExpired(boolean expired) {
209:                this .expired = expired;
210:            }
211:
212:            private Date expirationDate;
213:
214:            /**
215:             * @see org.apache.jetspeed.security.om.InternalCredential#getExpirationDate()
216:             */
217:            public Date getExpirationDate() {
218:                return expirationDate;
219:            }
220:
221:            /**
222:             * @see org.apache.jetspeed.security.om.InternalCredential#setExpirationDate(java.sql.Date)
223:             */
224:            public void setExpirationDate(Date expirationDate) {
225:                this .expirationDate = expirationDate;
226:            }
227:
228:            private int type;
229:
230:            /**
231:             * @see org.apache.jetspeed.security.om.InternalCredential#getType()
232:             */
233:            public int getType() {
234:                return this .type;
235:            }
236:
237:            /**
238:             * @see org.apache.jetspeed.security.om.InternalCredential#setType(int)
239:             */
240:            public void setType(int type) {
241:                this .type = type;
242:            }
243:
244:            private String classname;
245:
246:            /**
247:             * @see org.apache.jetspeed.security.om.InternalCredential#getClassname()
248:             */
249:            public String getClassname() {
250:                return this .classname;
251:            }
252:
253:            /**
254:             * @see org.apache.jetspeed.security.om.InternalCredential#setClassname(java.lang.String)
255:             */
256:            public void setClassname(String classname) {
257:                this .classname = classname;
258:            }
259:
260:            private Timestamp creationDate;
261:
262:            /**
263:             * @see org.apache.jetspeed.security.om.InternalCredential#getCreationDate()
264:             */
265:            public Timestamp getCreationDate() {
266:                return this .creationDate;
267:            }
268:
269:            /**
270:             * @see org.apache.jetspeed.security.om.InternalCredential#setCreationDate(java.sql.Timestamp)
271:             */
272:            public void setCreationDate(Timestamp creationDate) {
273:                this .creationDate = creationDate;
274:            }
275:
276:            private Timestamp modifiedDate;
277:
278:            /**
279:             * @see org.apache.jetspeed.security.om.InternalCredential#getModifiedDate()
280:             */
281:            public Timestamp getModifiedDate() {
282:                return this .modifiedDate;
283:            }
284:
285:            /**
286:             * @see org.apache.jetspeed.security.om.InternalCredential#setModifiedDate(java.sql.Timestamp)
287:             */
288:            public void setModifiedDate(Timestamp modifiedDate) {
289:                this .modifiedDate = modifiedDate;
290:            }
291:
292:            private Timestamp previousAuthenticationDate;
293:
294:            /**
295:             * @see org.apache.jetspeed.security.om.InternalCredential#getPreviousAuthenticationDate()
296:             */
297:            public Timestamp getPreviousAuthenticationDate() {
298:                return previousAuthenticationDate;
299:            }
300:
301:            /**
302:             * @see org.apache.jetspeed.security.om.InternalCredential#setPreviousAuthenticationDate(java.sql.Timestamp)
303:             */
304:            public void setPreviousAuthenticationDate(
305:                    Timestamp previousAuthenticationDate) {
306:                this .previousAuthenticationDate = previousAuthenticationDate;
307:            }
308:
309:            private Timestamp lastAuthenticationDate;
310:
311:            /**
312:             * @see org.apache.jetspeed.security.om.InternalCredential#getLastAuthenticationDate()
313:             */
314:            public Timestamp getLastAuthenticationDate() {
315:                return lastAuthenticationDate;
316:            }
317:
318:            /**
319:             * @see org.apache.jetspeed.security.om.InternalCredential#setLastAuthenticationDate(java.sql.Timestamp)
320:             */
321:            public void setLastAuthenticationDate(
322:                    Timestamp lastAuthenticationDate) {
323:                this .lastAuthenticationDate = lastAuthenticationDate;
324:            }
325:
326:            /**
327:             * <p>Compares this {@link InternalCredential} to the provided credential
328:             * and check if they are equal.</p>
329:             * return Whether the {@link InternalCredential} are equal.
330:             */
331:            public boolean equals(Object object) {
332:                if (!(object instanceof  InternalCredential))
333:                    return false;
334:
335:                InternalCredential c = (InternalCredential) object;
336:                boolean isEqual = (((null == c.getClassname()) || (c
337:                        .getClassname().equals(this .getClassname())))
338:                        && (c.getValue().equals(this .getValue())) && (c
339:                        .getType() == this .getType()));
340:                return isEqual;
341:            }
342:
343:            /**
344:             * <p>Convert <code>Node</code> to string.</p>
345:             * @return The Node string value.
346:             */
347:            public String toString() {
348:                String toStringCredential = "[[principalId, "
349:                        + this .principalId
350:                        + "], "
351:                        + "[value, "
352:                        + this .value
353:                        + "], "
354:                        + "[updateRequired, "
355:                        + this .updateRequired
356:                        + "], "
357:                        + "[encoded, "
358:                        + this .encoded
359:                        + "], "
360:                        + "[enabled, "
361:                        + this .enabled
362:                        + "], "
363:                        + "[authenticationFailures, "
364:                        + this .authenticationFailures
365:                        + "], "
366:                        + "[expired, "
367:                        + this .expired
368:                        + "], "
369:                        + "[type, "
370:                        + this .type
371:                        + "], "
372:                        + "[classname, "
373:                        + this .classname
374:                        + "], "
375:                        + "[creationDate, "
376:                        + this .creationDate
377:                        + "], "
378:                        + "[modifiedDate, "
379:                        + this .modifiedDate
380:                        + "], "
381:                        + "[previousAuthenticationDate, "
382:                        + this .previousAuthenticationDate
383:                        + "]"
384:                        + "[lastAuthenticationDate, "
385:                        + this .lastAuthenticationDate
386:                        + "]"
387:                        + (expirationDate != null ? (", [expirationDate, "
388:                                + this .expirationDate + "]]") : "]");
389:                return toStringCredential;
390:            }
391:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.