KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > net > ssl > SSLSessionContext


1 /*
2  * @(#)SSLSessionContext.java 1.11 04/02/16
3  *
4  * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7   
8 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.net.ssl;
17
18 import java.util.Enumeration;
19
20 /**
21  * A <code>SSLSessionContext</code> represents a set of
22  * <code>SSLSession</code>s associated with a single entity. For example,
23  * it could be associated with a server or client who participates in many
24  * sessions concurrently.
25  * <p>
26  * Not all environments will contain session contexts.
27  * <p>
28  * There are <code>SSLSessionContext</code> parameters that affect how
29  * sessions are stored:
30  * <UL>
31  * <LI>Sessions can be set to expire after a specified
32  * time limit.
33  * <LI>The number of sessions that can be stored in context
34  * can be limited.
35  * </UL>
36  * A session can be retrieved based on its session id, and all session id's
37  * in a <code>SSLSessionContext</code> can be listed.
38  *
39  * @see SSLSession
40  *
41  * @since 1.4
42  * @author Nathan Abramson
43  * @author David Brownell
44  * @version 1.13
45  */

46 public interface SSLSessionContext
47 {
48
49     /**
50      * Returns the <code>SSLSession</code> bound to the specified session id.
51      *
52      * @param sessionId the Session identifier
53      * @return the <code>SSLSession</code> or null if
54      * the specified session id does not refer to a valid SSLSession.
55      */

56     public SSLSession getSession(byte[] sessionId);
57
58     /**
59      * Returns an Enumeration of all session id's grouped under this
60      * <code>SSLSessionContext</code>.
61      *
62      * @return an enumeration of all the Session id's
63      */

64     public Enumeration getIds();
65
66     /**
67      * Sets the timeout limit for <code>SSLSession</code> objects grouped
68      * under this <code>SSLSessionContext</code>.
69      * <p>
70      * If the timeout limit is set to 't' seconds, a session exceeds the
71      * timeout limit 't' seconds after its creation time.
72      * When the timeout limit is exceeded for a session, the
73      * <code>SSLSession</code> object is invalidated and future connections
74      * cannot resume or rejoin the session.
75      * A check for sessions exceeding the timeout is made immediately whenever
76      * the timeout limit is changed for this <code>SSLSessionContext</code>.
77      *
78      * @param seconds the new session timeout limit in seconds; zero means
79      * there is no limit.
80      *
81      * @exception IllegalArgumentException if the timeout specified is < 0.
82      * @see #getSessionTimeout
83      */

84     public void setSessionTimeout(int seconds) throws IllegalArgumentException;
85
86     /**
87      * Returns the timeout limit of <code>SSLSession</code> objects grouped
88      * under this <code>SSLSessionContext</code>.
89      * <p>
90      * If the timeout limit is set to 't' seconds, a session exceeds the
91      * timeout limit 't' seconds after its creation time.
92      * When the timeout limit is exceeded for a session, the
93      * <code>SSLSession</code> object is invalidated and future connections
94      * cannot resume or rejoin the session.
95      * A check for sessions exceeding the timeout limit is made immediately
96      * whenever the timeout limit is changed for this
97      * <code>SSLSessionContext</code>.
98      *
99      * @return the session timeout limit in seconds; zero means there is no
100      * limit.
101      * @see #setSessionTimeout
102      */

103     public int getSessionTimeout();
104
105     /**
106      * Sets the size of the cache used for storing
107      * <code>SSLSession</code> objects grouped under this
108      * <code>SSLSessionContext</code>.
109      *
110      * @param size the new session cache size limit; zero means there is no
111      * limit.
112      * @exception IllegalArgumentException if the specified size is < 0.
113      * @see #getSessionCacheSize
114      */

115     public void setSessionCacheSize(int size) throws IllegalArgumentException;
116
117     /**
118      * Returns the size of the cache used for storing
119      * <code>SSLSession</code> objects grouped under this
120      * <code>SSLSessionContext</code>.
121      *
122      * @return size of the session cache; zero means there is no size limit.
123      * @see #setSessionCacheSize
124      */

125     public int getSessionCacheSize();
126 }
127
Popular Tags