PHP Class AppserverIo\Appserver\ServletEngine\Session\AbstractSessionHandler

Inheritance: implements AppserverIo\Appserver\ServletEngine\Session\SessionHandlerInterface
Show file Open project: appserver-io/appserver

Protected Properties

Property Type Description
$sessionMarshaller AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller instance.
$sessionSettings AppserverIo\Appserver\ServletEngine\SessionSettingsInterface The settings for the session handling.

Public Methods

Method Description
__construct ( string $sessionMarshallerType = FilesystemSessionHandler::DEFAULT_SESSION_MARSHALLER_TYPE ) Initializes the session handler with the configured params.
getSessionMarshaller ( ) : AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface Returns the session marshaller.
getSessionSettings ( ) : AppserverIo\Appserver\ServletEngine\SessionSettingsInterface Returns the session settings.
injectSessionMarshaller ( AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface $sessionMarshaller ) : void Injects the session marshaller.
injectSessionSettings ( AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : void Injects the session settings.

Protected Methods

Method Description
marshall ( AppserverIo\Psr\Servlet\ServletSessionInterface $servletSession ) : string Transforms the passed session instance into a JSON encoded string. If the data contains objects, each of them will be serialized before store them to the persistence layer.
unmarshall ( string $marshalled ) : AppserverIo\Psr\Servlet\ServletSessionInterface Initializes the session instance from the passed JSON string. If the encoded data contains objects, they will be unserialized before reattached to the session instance.

Method Details

__construct() public method

Initializes the session handler with the configured params.
public __construct ( string $sessionMarshallerType = FilesystemSessionHandler::DEFAULT_SESSION_MARSHALLER_TYPE )
$sessionMarshallerType string The session marshaller type to use

getSessionMarshaller() public method

Returns the session marshaller.
public getSessionMarshaller ( ) : AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface
return AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller

getSessionSettings() public method

Returns the session settings.
public getSessionSettings ( ) : AppserverIo\Appserver\ServletEngine\SessionSettingsInterface
return AppserverIo\Appserver\ServletEngine\SessionSettingsInterface The session settings

injectSessionMarshaller() public method

Injects the session marshaller.
public injectSessionMarshaller ( AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface $sessionMarshaller ) : void
$sessionMarshaller AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller instance
return void

injectSessionSettings() public method

Injects the session settings.
public injectSessionSettings ( AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : void
$sessionSettings AppserverIo\Appserver\ServletEngine\SessionSettingsInterface Settings for the session handling
return void

marshall() protected method

Transforms the passed session instance into a JSON encoded string. If the data contains objects, each of them will be serialized before store them to the persistence layer.
protected marshall ( AppserverIo\Psr\Servlet\ServletSessionInterface $servletSession ) : string
$servletSession AppserverIo\Psr\Servlet\ServletSessionInterface The servlet session to be transformed
return string The marshalled servlet session representation

unmarshall() protected method

Initializes the session instance from the passed JSON string. If the encoded data contains objects, they will be unserialized before reattached to the session instance.
protected unmarshall ( string $marshalled ) : AppserverIo\Psr\Servlet\ServletSessionInterface
$marshalled string The marshaled session representation
return AppserverIo\Psr\Servlet\ServletSessionInterface The un-marshaled servlet session instance

Property Details

$sessionMarshaller protected property

The session marshaller instance.
protected SessionMarshallerInterface,AppserverIo\Appserver\ServletEngine $sessionMarshaller
return AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface

$sessionSettings protected property

The settings for the session handling.
protected SessionSettingsInterface,AppserverIo\Appserver\ServletEngine $sessionSettings
return AppserverIo\Appserver\ServletEngine\SessionSettingsInterface