01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Boris V. Kuznetsov
20: * @version $Revision$
21: */package javax.net.ssl;
22:
23: import java.io.IOException;
24: import java.net.InetAddress;
25: import java.net.Socket;
26: import java.net.SocketException;
27: import java.net.UnknownHostException;
28:
29: /**
30: * Default inoperative implementation of javax.net.ssl.SSLSocketFactory
31: *
32: */
33: class DefaultSSLSocketFactory extends SSLSocketFactory {
34:
35: private String errMessage;
36:
37: public String[] getDefaultCipherSuites() {
38: return new String[0];
39: }
40:
41: public String[] getSupportedCipherSuites() {
42: return new String[0];
43: }
44:
45: /**
46: * @see javax.net.ssl.SSLSocketFactory#createSocket(java.net.Socket, java.lang.String, int, boolean)
47: */
48: public Socket createSocket(Socket s, String host, int port,
49: boolean autoClose) throws IOException {
50: throw new SocketException(errMessage);
51: }
52:
53: /**
54: * @see javax.net.SocketFactory#createSocket(java.lang.String, int)
55: */
56: public Socket createSocket(String host, int port)
57: throws IOException, UnknownHostException {
58: throw new SocketException(errMessage);
59: }
60:
61: /**
62: * @see javax.net.SocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int)
63: */
64: public Socket createSocket(String host, int port,
65: InetAddress localHost, int localPort) throws IOException,
66: UnknownHostException {
67: throw new SocketException(errMessage);
68: }
69:
70: /**
71: * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int)
72: */
73: public Socket createSocket(InetAddress host, int port)
74: throws IOException {
75: throw new SocketException(errMessage);
76: }
77:
78: /**
79: * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int, java.net.InetAddress, int)
80: */
81: public Socket createSocket(InetAddress address, int port,
82: InetAddress localAddress, int localPort) throws IOException {
83: throw new SocketException(errMessage);
84: }
85:
86: DefaultSSLSocketFactory(String mes) {
87: errMessage = mes;
88: }
89:
90: }
|