19992013 Ericsson AB. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ssl ssl_session_cache_api.xml
ssl_session_cache_api 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.
Common Data Types

The following data types are used in the functions below:

cache_ref() = opaque()

key() = {partialkey(), session_id()}

partialkey() = opaque()

session_id() = binary()

session() = opaque()

delete(Cache, Key) -> _ Cache = cache_ref() Key = key()

Deletes a cache entry. Will only be called from the cache handling process.

foldl(Fun, Acc0, Cache) -> Acc

Calls Fun(Elem, AccIn) on successive elements of the cache, starting with AccIn == Acc0. Fun/2 must return a new accumulator which is passed to the next call. The function returns the final value of the accumulator. Acc0 is returned if the cache is empty.

init() -> opaque() Return cache reference

Performs possible initializations of the cache and returns a reference to it that will be used as parameter to the other api functions. Will be called by the cache handling processes init function, hence putting the same requirements on it as a normal process init function.

lookup(Cache, Key) -> Entry Looks up a cache entry. Cache = cache_ref() Key = key() Entry = session() | undefined

Looks up a cache entry. Should be callable from any process.

select_session(Cache, PartialKey) -> [session()] >Selects sessions that could be reused. Cache = cache_ref() PartialKey = partialkey() Session = session()

Selects sessions that could be reused. Should be callable from any process.

terminate(Cache) -> _ Called by the process that handles the cache when it is about to terminate. Cache = term() - as returned by init/0

Takes care of possible cleanup that is needed when the cache handling process terminates.

update(Cache, Key, Session) -> _ Caches a new session or updates a already cached one. Cache = cache_ref() Key = key() Session = session()

Caches a new session or updates a already cached one. Will only be called from the cache handling process.