Search in sources :

Example 1 with SSLSessionBindingListener

use of javax.net.ssl.SSLSessionBindingListener in project XobotOS by xamarin.

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 2 with SSLSessionBindingListener

use of javax.net.ssl.SSLSessionBindingListener in project XobotOS by xamarin.

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.
     *
     * <p>These links-to -data bounds are
     * monitored, as a matter of security, by the full machinery of the
     * <code>AccessController</code> class.
     *
     * @param name the name of the link (no null are
     *            accepted!)
     * @throws <code>IllegalArgumentException</code> 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 3 with SSLSessionBindingListener

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

the class mySSLSession method putValue.

public void putValue(String s, Object obj) {
    if (s == null || obj == null)
        throw new IllegalArgumentException("arguments can not be null");
    Object obj1 = table.put(s, obj);
    if (obj1 instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent sslsessionbindingevent = new SSLSessionBindingEvent(this, s);
        ((SSLSessionBindingListener) obj1).valueUnbound(sslsessionbindingevent);
    }
    if (obj instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent sslsessionbindingevent1 = new SSLSessionBindingEvent(this, s);
        ((SSLSessionBindingListener) obj).valueBound(sslsessionbindingevent1);
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 4 with SSLSessionBindingListener

use of javax.net.ssl.SSLSessionBindingListener 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 5 with SSLSessionBindingListener

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

the class SSLSessionTest method test_getValue.

/**
     * javax.net.ssl.SSLSession#getValue(String name)
     */
public void test_getValue() {
    SSLSession s = clientSession;
    mySSLSessionBindingListener sbl = new mySSLSessionBindingListener();
    try {
        s.getValue(null);
        fail("IllegalArgumentException wasn't thrown");
    } catch (IllegalArgumentException expected) {
    // expected
    }
    s.putValue("Name", sbl);
    Object obj = s.getValue("Name");
    assertTrue(obj instanceof SSLSessionBindingListener);
}
Also used : SSLSession(javax.net.ssl.SSLSession) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Aggregations

SSLSessionBindingListener (javax.net.ssl.SSLSessionBindingListener)9 SSLSessionBindingEvent (javax.net.ssl.SSLSessionBindingEvent)8 SSLSession (javax.net.ssl.SSLSession)1