Source Code Cross Referenced for SSLEngine.java in  » Apache-Harmony-Java-SE » javax-package » javax » net » ssl » 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 » Apache Harmony Java SE » javax package » javax.net.ssl 
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:
018:        /**
019:         * @author Vera Y. Petrashkova
020:         * @version $Revision$
021:         */package javax.net.ssl;
022:
023:        import java.nio.ByteBuffer;
024:        import java.nio.ReadOnlyBufferException;
025:
026:        /**
027:         * 
028:         * @com.intel.drl.spec_ref
029:         * 
030:         *  
031:         */
032:        public abstract class SSLEngine {
033:            // Store host value
034:            private final String host;
035:
036:            // Store port value
037:            private final int port;
038:
039:            /**
040:             * @com.intel.drl.spec_ref
041:             *  
042:             */
043:            protected SSLEngine() {
044:                host = null;
045:                port = -1;
046:            }
047:
048:            /**
049:             * @com.intel.drl.spec_ref
050:             *  
051:             */
052:            protected SSLEngine(String host, int port) {
053:                this .host = host;
054:                this .port = port;
055:            }
056:
057:            /**
058:             * @com.intel.drl.spec_ref
059:             *  
060:             */
061:            public abstract void beginHandshake() throws SSLException;
062:
063:            /**
064:             * @com.intel.drl.spec_ref
065:             *  
066:             */
067:            public abstract void closeInbound() throws SSLException;
068:
069:            /**
070:             * @com.intel.drl.spec_ref
071:             *  
072:             */
073:            public abstract void closeOutbound();
074:
075:            /**
076:             * @com.intel.drl.spec_ref
077:             *  
078:             */
079:            public abstract Runnable getDelegatedTask();
080:
081:            /**
082:             * @com.intel.drl.spec_ref
083:             *  
084:             */
085:            public abstract String[] getEnabledCipherSuites();
086:
087:            /**
088:             * @com.intel.drl.spec_ref
089:             *  
090:             */
091:            public abstract String[] getEnabledProtocols();
092:
093:            /**
094:             * @com.intel.drl.spec_ref
095:             *  
096:             */
097:            public abstract boolean getEnableSessionCreation();
098:
099:            /**
100:             * @com.intel.drl.spec_ref
101:             *  
102:             */
103:            public abstract SSLEngineResult.HandshakeStatus getHandshakeStatus();
104:
105:            /**
106:             * @com.intel.drl.spec_ref
107:             *  
108:             */
109:            public abstract boolean getNeedClientAuth();
110:
111:            /**
112:             * @com.intel.drl.spec_ref
113:             *  
114:             */
115:            public String getPeerHost() {
116:                return host;
117:            }
118:
119:            /**
120:             * @com.intel.drl.spec_ref
121:             *  
122:             */
123:            public int getPeerPort() {
124:                return port;
125:            }
126:
127:            /**
128:             * @com.intel.drl.spec_ref
129:             *  
130:             */
131:            public abstract SSLSession getSession();
132:
133:            /**
134:             * @com.intel.drl.spec_ref
135:             *  
136:             */
137:            public abstract String[] getSupportedCipherSuites();
138:
139:            /**
140:             * @com.intel.drl.spec_ref
141:             *  
142:             */
143:            public abstract String[] getSupportedProtocols();
144:
145:            /**
146:             * @com.intel.drl.spec_ref
147:             *  
148:             */
149:            public abstract boolean getUseClientMode();
150:
151:            /**
152:             * @com.intel.drl.spec_ref
153:             *  
154:             */
155:            public abstract boolean getWantClientAuth();
156:
157:            /**
158:             * @com.intel.drl.spec_ref
159:             *  
160:             */
161:            public abstract boolean isInboundDone();
162:
163:            /**
164:             * @com.intel.drl.spec_ref
165:             *  
166:             */
167:            public abstract boolean isOutboundDone();
168:
169:            /**
170:             * @com.intel.drl.spec_ref
171:             *  
172:             */
173:            public abstract void setEnabledCipherSuites(String[] suites);
174:
175:            /**
176:             * @com.intel.drl.spec_ref
177:             *  
178:             */
179:            public abstract void setEnabledProtocols(String[] protocols);
180:
181:            /**
182:             * @com.intel.drl.spec_ref
183:             *  
184:             */
185:            public abstract void setEnableSessionCreation(boolean flag);
186:
187:            /**
188:             * @com.intel.drl.spec_ref
189:             *  
190:             */
191:            public abstract void setNeedClientAuth(boolean need);
192:
193:            /**
194:             * @com.intel.drl.spec_ref
195:             *  
196:             */
197:            public abstract void setUseClientMode(boolean mode);
198:
199:            /**
200:             * @com.intel.drl.spec_ref
201:             *  
202:             */
203:            public abstract void setWantClientAuth(boolean want);
204:
205:            /**
206:             * @com.intel.drl.spec_ref
207:             *  
208:             */
209:            public abstract SSLEngineResult unwrap(ByteBuffer src,
210:                    ByteBuffer[] dsts, int offset, int length)
211:                    throws SSLException;
212:
213:            /**
214:             * @com.intel.drl.spec_ref
215:             *  
216:             */
217:            public abstract SSLEngineResult wrap(ByteBuffer[] srcs, int offset,
218:                    int length, ByteBuffer dst) throws SSLException;
219:
220:            /**
221:             * implementation behavior follows RI:
222:             * jdk 1.5 does not throw IllegalArgumentException when parameters are null
223:             * and does not throw ReadOnlyBufferException if dst is read only byte buffer
224:             *  
225:             */
226:            public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst)
227:                    throws SSLException {
228:                //        if (src == null) {
229:                //            throw new IllegalArgumentException("Byte buffer src is null");
230:                //        }
231:                //        if (dst == null) {
232:                //            throw new IllegalArgumentException("Byte buffer dst is null");
233:                //        }
234:                //        if (dst.isReadOnly()) {
235:                //            throw new ReadOnlyBufferException();
236:                //        }
237:                return unwrap(src, new ByteBuffer[] { dst }, 0, 1);
238:            }
239:
240:            /**
241:             * implementation behavior follows RI:
242:             * jdk 1.5 does not throw IllegalArgumentException when src is null or if
243:             * dsts contains null elements
244:             * It does not throw ReadOnlyBufferException when dsts contains read only elements
245:             */
246:            public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts)
247:                    throws SSLException {
248:                //        if (src == null) {
249:                //            throw new IllegalArgumentException("Byte buffer src is null");
250:                //        }
251:                if (dsts == null) {
252:                    throw new IllegalArgumentException(
253:                            "Byte buffer array dsts is null");
254:                }
255:                //        for (int i = 0; i < dsts.length; i++) {
256:                //            if (dsts[i] == null) {
257:                //                throw new IllegalArgumentException("Byte buffer dsts[" + i
258:                //                        + "]  is null");
259:                //            }
260:                //            if (dsts[i].isReadOnly()) {
261:                //                throw new ReadOnlyBufferException();
262:                //            }
263:                //        }
264:                return unwrap(src, dsts, 0, dsts.length);
265:            }
266:
267:            /**
268:             * implementation behavior follows RI: jdk 1.5 does not throw
269:             * IllegalArgumentException when dst is null or if srcs contains null
270:             * elements It does not throw ReadOnlyBufferException for read only dst
271:             *  
272:             */
273:            public SSLEngineResult wrap(ByteBuffer[] srcs, ByteBuffer dst)
274:                    throws SSLException {
275:                if (srcs == null) {
276:                    throw new IllegalArgumentException(
277:                            "Byte buffer array srcs is null");
278:                }
279:                //        for (int i = 0; i < srcs.length; i++) {
280:                //            if (srcs[i] == null) {
281:                //                throw new IllegalArgumentException("Byte buffer srcs[" + i
282:                //                        + "]  is null");
283:                //            }
284:                //        }
285:                //        if (dst == null) {
286:                //            throw new IllegalArgumentException("Byte buffer array dst is null");
287:                //        }
288:                //        if (dst.isReadOnly()) {
289:                //            throw new ReadOnlyBufferException();
290:                //        }
291:                return wrap(srcs, 0, srcs.length, dst);
292:            }
293:
294:            /**
295:             * implementation behavior follows RI:
296:             * jdk 1.5 does not throw IllegalArgumentException when parameters are null
297:             * and does not throw ReadOnlyBufferException if dst is read only byte buffer
298:             *  
299:             */
300:            public SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst)
301:                    throws SSLException {
302:                //        if (src == null) {
303:                //            throw new IllegalArgumentException("Byte buffer src is null");
304:                //        }
305:                //        if (dst == null) {
306:                //            throw new IllegalArgumentException("Byte buffer dst is null");
307:                //        }
308:                //        if (dst.isReadOnly()) {
309:                //            throw new ReadOnlyBufferException();
310:                //        }
311:                return wrap(new ByteBuffer[] { src }, 0, 1, dst);
312:            }
313:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.