Java 8 SSLSessionBindingEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SSLSessionBindingEvent class.

This code example shows how to use the following methods:getName
This code example shows how to use the following methods:
This code example shows how to use the following methods:getName, getSession
 */ 
public class SSLSessionBindingEventTest extends TestCase {
 
    public final void testSSLSessionBindingEvent() { 
        SSLSession ses = new MySSLSession();
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
         
        assertEquals("test", event.getName());
        assertEquals(ses, event.getSession());
    } 
 
} 
class MySSLSession implements SSLSession {
    /* 
     * @see javax.net.ssl.SSLSession#getApplicationBufferSize() 
     */ 
    public int getApplicationBufferSize() { 
        return 0; 
    } 
 
5
CodeRank
This code example shows how to use the following methods:
        if (name == null || value == null) {
            throw new IllegalArgumentException("Parameter is null");
        } 
        Object old = values.put(new ValueKey(name), value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
        } 
        if (old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
        } 
 
    } 
 
    public void removeValue(String name) {
        if (name == null) {
            throw new IllegalArgumentException("Parameter is null");
        } 
        Object old = values.remove(new ValueKey(name));
        if (old instanceof SSLSessionBindingListener) {
            SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
5
CodeRank
This code example shows how to use the following methods:getName, getSession
 */ 
public class SSLSessionBindingEventTest extends TestCase {
 
    public final void testSSLSessionBindingEvent() { 
        SSLSession ses = new MySSLSession();
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
         
        assertEquals("test", event.getName());
        assertEquals(ses, event.getSession());
    } 
 
} 
class MySSLSession implements SSLSession {
    /* 
     * @see javax.net.ssl.SSLSession#getApplicationBufferSize() 
     */ 
    public int getApplicationBufferSize() { 
        return 0; 
    } 
 
5
CodeRank
This code example shows how to use the following methods:
        if (name == null || value == null) {
            throw new IllegalArgumentException("name == null || value == null");
        } 
        Object old = values.put(name, value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
        } 
        if (old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
        } 
 
    } 
 
    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;
4
CodeRank
This code example shows how to use the following methods:
        if (name == null || value == null) {
            throw new IllegalArgumentException("name == null || value == null");
        } 
        Object old = values.put(name, value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
        } 
        if (old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
        } 
 
    } 
 
    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;
4
CodeRank
This code example shows how to use the following methods:
            throw new IllegalArgumentException("name == null || value == null");
        } 
        Object old = values.put(name, value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value)
                    .valueBound(new SSLSessionBindingEvent(this, name));
        } 
        if (old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old)
                    .valueUnbound(new SSLSessionBindingEvent(this, name));
        } 
    } 
 
    /** 
     * 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. 
     * 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
            throw new IllegalArgumentException("Parameter is null");
        } 
        Object old = values.put(name, AccessController.getContext(), value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value)
                    .valueBound(new SSLSessionBindingEvent(this, name));
        } 
        if (old != null && old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old)
                    .valueUnbound(new SSLSessionBindingEvent(this, name));
        } 
    } 
 
    /** 
     * Removes a link (name) with the specified value object of the SSL 
     * session's application layer data. 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 
4
CodeRank
See Code Examples for Java 8 SSLSessionBindingEvent Methods: