Path: blob/master/src/java.base/share/classes/javax/net/ssl/SSLSessionBindingEvent.java
41159 views
/*1* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/242526package javax.net.ssl;2728import java.util.EventObject;293031/**32* This event is propagated to a SSLSessionBindingListener.33* When a listener object is bound or unbound to an SSLSession by34* {@link SSLSession#putValue(String, Object)}35* or {@link SSLSession#removeValue(String)}, objects which36* implement the SSLSessionBindingListener will be receive an37* event of this type. The event's <code>name</code> field is the38* key in which the listener is being bound or unbound.39*40* @see SSLSession41* @see SSLSessionBindingListener42*43* @since 1.444* @author Nathan Abramson45* @author David Brownell46*/47public48class SSLSessionBindingEvent49extends EventObject50{51@java.io.Serial52private static final long serialVersionUID = 3989172637106345L;5354/**55* @serial The name to which the object is being bound or unbound56*/57private String name;5859/**60* Constructs a new SSLSessionBindingEvent.61*62* @param session the SSLSession acting as the source of the event63* @param name the name to which the object is being bound or unbound64* @exception IllegalArgumentException if <code>session</code> is null.65*/66public SSLSessionBindingEvent(SSLSession session, String name)67{68super(session);69this.name = name;70}7172/**73* Returns the name to which the object is being bound, or the name74* from which the object is being unbound.75*76* @return the name to which the object is being bound or unbound77*/78public String getName()79{80return name;81}8283/**84* Returns the SSLSession into which the listener is being bound or85* from which the listener is being unbound.86*87* @return the <code>SSLSession</code>88*/89public SSLSession getSession()90{91return (SSLSession) getSource();92}93}949596