Source Code Cross Referenced for HardToken.java in  » Authentication-Authorization » ejbca » org » ejbca » core » model » hardtoken » types » 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 » Authentication Authorization » ejbca » org.ejbca.core.model.hardtoken.types 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*************************************************************************
002:         *                                                                       *
003:         *  EJBCA: The OpenSource Certificate Authority                          *
004:         *                                                                       *
005:         *  This software is free software; you can redistribute it and/or       *
006:         *  modify it under the terms of the GNU Lesser General Public           *
007:         *  License as published by the Free Software Foundation; either         *
008:         *  version 2.1 of the License, or any later version.                    *
009:         *                                                                       *
010:         *  See terms of license at gnu.org.                                     *
011:         *                                                                       *
012:         *************************************************************************/package org.ejbca.core.model.hardtoken.types;
013:
014:        import java.io.Serializable;
015:
016:        import org.ejbca.core.model.UpgradeableDataHashMap;
017:
018:        /**
019:         * HardToken is a base class that all HardToken classes is supposed to inherit.  It function is to
020:         * define the data the token is supposed contain.
021:         *
022:         * @author TomSelleck
023:         * @version $Id: HardToken.java,v 1.2 2007/04/13 06:15:20 herrvendil Exp $
024:         */
025:        public abstract class HardToken extends UpgradeableDataHashMap
026:                implements  Serializable, Cloneable {
027:            // Default Values
028:            public static final float LATEST_VERSION = 0;
029:            public static final String TOKENTYPE = "TOKENTYPE";
030:
031:            public static final String LABEL_REGULARCARD = "LABEL_REGULARCARD";
032:            public static final String LABEL_TEMPORARYCARD = "LABEL_TEMPORARYCARD";
033:            public static final String LABEL_PROJECTCARD = "LABEL_PROJECTCARD";
034:
035:            public static final String TOKENPROFILE = "TOKENPROFILE";
036:            public static final String LABEL = "LABEL";
037:
038:            protected boolean includePUK = true;
039:
040:            // Public Constants.
041:
042:            /* Constants used to define how the stored data should be represented in the web-gui.*/
043:            public static final int INTEGER = 0;
044:            public static final int LONG = 1;
045:            public static final int STRING = 2;
046:            public static final int BOOLEAN = 3;
047:            public static final int DATE = 4;
048:            public static final int EMPTYROW = 5;
049:            public static final String EMPTYROW_FIELD = "EMTPYROW";
050:
051:            public HardToken(boolean includePUK) {
052:                this .includePUK = includePUK;
053:            }
054:
055:            // Public Methods
056:            public Object getField(String field) {
057:                return data.get(field);
058:            }
059:
060:            public abstract String[] getFields(boolean includePUK);
061:
062:            public abstract int[] getDataTypes(boolean includePUK);
063:
064:            public abstract String[] getFieldTexts(boolean includePUK);
065:
066:            public int getNumberOfFields() {
067:                return getFields(includePUK).length;
068:            }
069:
070:            public String getFieldText(int index) {
071:                return getFieldTexts(includePUK)[index];
072:            }
073:
074:            public String getFieldPointer(int index) {
075:                return getFields(includePUK)[index];
076:            }
077:
078:            public int getFieldDataType(int index) {
079:                return getDataTypes(includePUK)[index];
080:            }
081:
082:            public void setField(String field, Object value) {
083:                data.put(field, value);
084:            }
085:
086:            public int getTokenProfileId() {
087:                if (data.get(HardToken.TOKENPROFILE) == null)
088:                    return 0;
089:
090:                return ((Integer) data.get(HardToken.TOKENPROFILE)).intValue();
091:            }
092:
093:            public void setTokenProfileId(int hardtokenprofileid) {
094:                data.put(HardToken.TOKENPROFILE,
095:                        new Integer(hardtokenprofileid));
096:            }
097:
098:            /**
099:             * 
100:             * @return one of the LABEL_ constants or null of no label is set.
101:             */
102:            public String getLabel() {
103:                return (String) data.get(HardToken.LABEL);
104:            }
105:
106:            /**
107:             * 
108:             * @param hardTokenLabel should be one of the LABEL_ constants
109:             */
110:            public void setLabel(String hardTokenLabel) {
111:                data.put(HardToken.LABEL, hardTokenLabel);
112:            }
113:
114:            /**
115:             * Implemtation of UpgradableDataHashMap function getLatestVersion
116:             *
117:             */
118:            public float getLatestVersion() {
119:                return LATEST_VERSION;
120:            }
121:
122:            /**
123:             * Implemtation of UpgradableDataHashMap function upgrade.
124:             */
125:            public void upgrade() {
126:            }
127:
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.