.TH ssl_session_cache_api 3erl "ssl 8.1" "Ericsson AB" "Erlang Module Definition" .SH NAME ssl_session_cache_api \- TLS session cache API .SH DESCRIPTION .LP Defines the API for the TLS session cache so that the data storage scheme can be replaced by defining a new callback module implementing this API\&. .SH "DATA TYPES" .LP The following data types are used in the functions for \fIssl_session_cache_api\fR\&: .RS 2 .TP 2 .B \fIcache_ref() =\fR\&: \fIopaque()\fR\& .TP 2 .B \fIkey() =\fR\&: \fI{partialkey(), session_id()}\fR\& .TP 2 .B \fIpartialkey() =\fR\&: \fIopaque()\fR\& .TP 2 .B \fIsession_id() =\fR\&: \fIbinary()\fR\& .TP 2 .B \fIsession()\fR\& =: \fIopaque()\fR\& .RE .SH EXPORTS .LP .B delete(Cache, Key) -> _ .br .RS .LP Types: .RS 3 Cache = cache_ref() .br Key = key() .br .RE .RE .RS .LP Deletes a cache entry\&. Is only called from the cache handling process\&. .RE .LP .B foldl(Fun, Acc0, Cache) -> Acc .br .RS .LP Types: .RS 3 .br .RE .RE .RS .LP Calls \fIFun(Elem, AccIn)\fR\& on successive elements of the cache, starting with \fIAccIn == Acc0\fR\&\&. \fIFun/2\fR\& must return a new accumulator, which is passed to the next call\&. The function returns the final value of the accumulator\&. \fIAcc0\fR\& is returned if the cache is empty\&. .RE .LP .B init(Args) -> opaque() .br .RS .LP Types: .RS 3 Args = proplists:proplist() .br .RE .RE .RS .LP Includes property \fI{role, client | server}\fR\&\&. Currently this is the only predefined property, there can also be user-defined properties\&. See also application environment variable \fBsession_cb_init_args\fR\&\&. .LP Performs possible initializations of the cache and returns a reference to it that is used as parameter to the other API functions\&. Is called by the cache handling processes \fIinit\fR\& function, hence putting the same requirements on it as a normal process \fIinit\fR\& function\&. This function is called twice when starting the SSL application, once with the role client and once with the role server, as the SSL application must be prepared to take on both roles\&. .RE .LP .B lookup(Cache, Key) -> Entry .br .RS .LP Types: .RS 3 Cache = cache_ref() .br Key = key() .br Entry = session() | undefined .br .RE .RE .RS .LP Looks up a cache entry\&. Is to be callable from any process\&. .RE .LP .B select_session(Cache, PartialKey) -> [session()] .br .RS .LP Types: .RS 3 Cache = cache_ref() .br PartialKey = partialkey() .br Session = session() .br .RE .RE .RS .LP Selects sessions that can be reused\&. Is to be callable from any process\&. .RE .LP .B terminate(Cache) -> _ .br .RS .LP Types: .RS 3 Cache = term() - as returned by init/0 .br .RE .RE .RS .LP Takes care of possible cleanup that is needed when the cache handling process terminates\&. .RE .LP .B update(Cache, Key, Session) -> _ .br .RS .LP Types: .RS 3 Cache = cache_ref() .br Key = key() .br Session = session() .br .RE .RE .RS .LP Caches a new session or updates an already cached one\&. Is only called from the cache handling process\&. .RE