Search in sources :

Example 6 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class SSLSessionImpl method removeValue.

public void removeValue(String name) {
    if (name == null) {
        throw new IllegalArgumentException("name == null");
    }
    Object old = values.remove(name);
    if (old instanceof SSLSessionBindingListener) {
        SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
        listener.valueUnbound(new SSLSessionBindingEvent(this, name));
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 7 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class OpenSSLSessionImpl method removeValue.

/**
     * Removes a link (name) with the specified value object of the SSL
     * session's application layer data.
     *
     * <p>If the value object implements the <code>SSLSessionBindingListener</code>
     * interface, the object will receive a <code>valueUnbound</code> notification.
     *
     * @param name the name of the link (no null are
     *            accepted!)
     * @throws IllegalArgumentException if the argument is null.
     */
public void removeValue(String name) {
    if (name == null) {
        throw new IllegalArgumentException("name == null");
    }
    Object old = values.remove(name);
    if (old instanceof SSLSessionBindingListener) {
        SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
        listener.valueUnbound(new SSLSessionBindingEvent(this, name));
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 8 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class MySSLSession method test_ConstructorLjavax_net_ssl_SSLSessionLjava_lang_String.

public final void test_ConstructorLjavax_net_ssl_SSLSessionLjava_lang_String() {
    SSLSession ses = new MySSLSession();
    try {
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
        if (!"test".equals(event.getName())) {
            fail("incorrect name");
        }
        if (!event.getSession().equals(ses)) {
            fail("incorrect session");
        }
    } catch (Exception e) {
        fail("Unexpected exception " + e);
    }
    try {
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(null, "test");
        fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    // expected
    }
    try {
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, null);
    } catch (IllegalArgumentException e) {
        fail("Unexpected IllegalArgumentException: " + e);
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSession(javax.net.ssl.SSLSession) SSLPeerUnverifiedException(javax.net.ssl.SSLPeerUnverifiedException)

Example 9 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class mySSLSession method removeValue.

public void removeValue(String s) {
    if (s == null)
        throw new IllegalArgumentException("argument can not be null");
    Object obj = table.remove(s);
    if (obj instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent sslsessionbindingevent = new SSLSessionBindingEvent(this, s);
        ((SSLSessionBindingListener) obj).valueUnbound(sslsessionbindingevent);
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 10 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project jdk8u_jdk by JetBrains.

the class SecureKey method removeValue.

/**
     * Removes the specified session value, delivering a session changed
     * event as appropriate.
     */
@Override
public void removeValue(String key) {
    if (key == null) {
        throw new IllegalArgumentException("argument can not be null");
    }
    SecureKey secureKey = new SecureKey(key);
    Object value = table.remove(secureKey);
    if (value instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent e;
        e = new SSLSessionBindingEvent(this, key);
        ((SSLSessionBindingListener) value).valueUnbound(e);
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Aggregations

SSLSessionBindingEvent (javax.net.ssl.SSLSessionBindingEvent)11 SSLSessionBindingListener (javax.net.ssl.SSLSessionBindingListener)8 SSLSession (javax.net.ssl.SSLSession)3 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)1