/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// package private
// use soft reference
}
/**
* Returns the <code>SSLSession</code> bound to the specified session id.
*/
throw new NullPointerException("session id cannot be null");
}
if (!isTimedout(sess)) {
return sess;
}
return null;
}
/**
* Returns an enumeration of the active SSL sessions.
*/
return scVisitor.getSessionIds();
}
/**
* Sets the timeout limit for cached <code>SSLSession</code> objects
*
* Note that after reset the timeout, the cached session before
* should be timed within the shorter one of the old timeout and the
* new timeout.
*/
throws IllegalArgumentException {
if (seconds < 0) {
throw new IllegalArgumentException();
}
}
}
/**
* Gets the timeout limit for cached <code>SSLSession</code> objects
*/
public int getSessionTimeout() {
return timeout;
}
/**
* Sets the size of the cache used for storing
* <code>SSLSession</code> objects.
*/
throws IllegalArgumentException {
if (size < 0)
throw new IllegalArgumentException();
if (cacheLimit != size) {
cacheLimit = size;
}
}
/**
* Gets the size of the cache used for storing
* <code>SSLSession</code> objects.
*/
public int getSessionCacheSize() {
return cacheLimit;
}
// package-private method, used ONLY by ServerHandshaker
}
// package-private method, used ONLY by ClientHandshaker
/*
* If no session caching info is available, we won't
* get one, so exit before doing a lookup.
*/
return null;
}
if (!isTimedout(sess)) {
return sess;
}
return null;
}
}
// cache a SSLSession
//
// In SunJSSE implementation, a session is created while getting a
// client hello or a server hello message, and cached while the
// handshaking finished.
// Here we time the session from the time it cached instead of the
// time it created, which is a little longer than the expected. So
// please do check isTimedout() while getting entry from the cache.
}
s.setContext(this);
}
// package-private method, remove a cached SSLSession
if (s != null) {
}
}
private int getDefaultCacheLimit() {
int cacheLimit = 0;
try {
return System.getProperty(
"javax.net.ssl.sessionCacheSize");
}
});
} catch (Exception e) {
}
}
if (timeout == 0) {
return false;
}
<= (System.currentTimeMillis()))) {
sess.invalidate();
return true;
}
return false;
}
final class SessionCacheVisitor
// public void visit(java.util.Map<Object, Object> map) {}
if (!isTimedout(value)) {
}
}
}
}
}
}