1022 * @see SSLSession 1023 * @see ExtendedSSLSession 1024 * @see X509ExtendedKeyManager 1025 * @see X509ExtendedTrustManager 1026 * 1027 * @return null if this instance is not currently handshaking, or 1028 * if the current handshake has not progressed far enough to 1029 * create a basic SSLSession. Otherwise, this method returns the 1030 * {@code SSLSession} currently being negotiated. 1031 * @throws UnsupportedOperationException if the underlying provider 1032 * does not implement the operation. 1033 * 1034 * @since 1.7 1035 */ 1036 public SSLSession getHandshakeSession() { 1037 throw new UnsupportedOperationException(); 1038 } 1039 1040 1041 /** 1042 * Initiates handshaking (initial or renegotiation) on this SSLEngine. 1043 * <P> 1044 * This method is not needed for the initial handshake, as the 1045 * {@code wrap()} and {@code unwrap()} methods will 1046 * implicitly call this method if handshaking has not already begun. 1047 * <P> 1048 * Note that the peer may also request a session renegotiation with 1049 * this {@code SSLEngine} by sending the appropriate 1050 * session renegotiate handshake message. 1051 * <P> 1052 * Unlike the {@link SSLSocket#startHandshake() 1053 * SSLSocket#startHandshake()} method, this method does not block 1054 * until handshaking is completed. 1055 * <P> 1056 * To force a complete SSL/TLS/DTLS session renegotiation, the current 1057 * session should be invalidated prior to calling this method. 1058 * <P> 1059 * Some protocols may not support multiple handshakes on an existing 1060 * engine and may throw an {@code SSLException}. 1061 * | 1022 * @see SSLSession 1023 * @see ExtendedSSLSession 1024 * @see X509ExtendedKeyManager 1025 * @see X509ExtendedTrustManager 1026 * 1027 * @return null if this instance is not currently handshaking, or 1028 * if the current handshake has not progressed far enough to 1029 * create a basic SSLSession. Otherwise, this method returns the 1030 * {@code SSLSession} currently being negotiated. 1031 * @throws UnsupportedOperationException if the underlying provider 1032 * does not implement the operation. 1033 * 1034 * @since 1.7 1035 */ 1036 public SSLSession getHandshakeSession() { 1037 throw new UnsupportedOperationException(); 1038 } 1039 1040 1041 /** 1042 * Registers an event listener to receive notifications that an 1043 * SSL handshake has completed on this connection. 1044 * 1045 * @param listener the HandShake Completed event listener 1046 * @see #startHandshake() 1047 * @see #removeHandshakeCompletedListener(HandshakeCompletedListener) 1048 * @throws IllegalArgumentException if the argument is null. 1049 */ 1050 public abstract void addHandshakeCompletedListener( 1051 HandshakeCompletedListener listener); 1052 1053 1054 /** 1055 * Removes a previously registered handshake completion listener. 1056 * 1057 * @param listener the HandShake Completed event listener 1058 * @throws IllegalArgumentException if the listener is not registered, 1059 * or the argument is null. 1060 * @see #addHandshakeCompletedListener(HandshakeCompletedListener) 1061 */ 1062 public abstract void removeHandshakeCompletedListener( 1063 HandshakeCompletedListener listener); 1064 1065 1066 /** 1067 * Registers an event listener to get information or modify 1068 * the control flow of an ongoing SSL handshake. 1069 * 1070 * @param listener the object providing callback methods. 1071 * @throws IllegalArgumentException if the argument is null. 1072 * @see #removeHandshakeListener(HandshakeListener) 1073 */ 1074 public abstract void addHandshakeListener( 1075 HandshakeListener listener); 1076 1077 1078 /** 1079 * Removes a previously registered HandshakeListener event listener. 1080 * 1081 * @param listener the object providing callback methods. 1082 * @throws IllegalArgumentException if the listener is not registered, 1083 * or the argument is null. 1084 * @see #addHandshakeListener(HandshakeListener) 1085 */ 1086 public abstract void removeHandshakeListener( 1087 HandshakeListener listener); 1088 1089 1090 /** 1091 * Initiates handshaking (initial or renegotiation) on this SSLEngine. 1092 * <P> 1093 * This method is not needed for the initial handshake, as the 1094 * {@code wrap()} and {@code unwrap()} methods will 1095 * implicitly call this method if handshaking has not already begun. 1096 * <P> 1097 * Note that the peer may also request a session renegotiation with 1098 * this {@code SSLEngine} by sending the appropriate 1099 * session renegotiate handshake message. 1100 * <P> 1101 * Unlike the {@link SSLSocket#startHandshake() 1102 * SSLSocket#startHandshake()} method, this method does not block 1103 * until handshaking is completed. 1104 * <P> 1105 * To force a complete SSL/TLS/DTLS session renegotiation, the current 1106 * session should be invalidated prior to calling this method. 1107 * <P> 1108 * Some protocols may not support multiple handshakes on an existing 1109 * engine and may throw an {@code SSLException}. 1110 * |