PHP Class AppserverIo\Appserver\ServletEngine\StandardSessionManager

Inheritance: implements AppserverIo\Appserver\ServletEngine\SessionManagerInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Свойство Type Description
$application AppserverIo\Psr\Application\ApplicationInterface The application instance.
$garbageCollector AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface The garbage collector instance.
$managerConfiguration AppserverIo\Psr\Application\ManagerConfigurationInterface The manager configuration instance.
$sessionHandlers AppserverIo\Collections\HashMap The HashMap containing the session handlers.
$sessionMarshaller AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller instance.
$sessionSettings AppserverIo\Appserver\ServletEngine\SessionSettingsInterface The settings for the session handling.
$sessions AppserverIo\Collections\HashMap The HashMap containing the sessions.

Méthodes publiques

Méthode Description
__construct ( ) Initialize the session manager.
__destruct ( ) Save the sessions back to the persistence layer.
attach ( AppserverIo\Psr\Servlet\ServletSessionInterface $session ) : void Attaches the passed session to the manager and returns the instance.
create ( mixed $id, string $name, integer | DateTime $lifetime = null, integer | null $maximumAge = null, string | null $domain = null, string $path = null, boolean $secure = null, boolean $httpOnly = null ) : AppserverIo\Psr\Servlet\ServletSessionInterface Creates a new session with the passed session ID and session name if given.
find ( string $id ) : AppserverIo\Psr\Servlet\Http\ServletSessionInterface | null Tries to find a session for the given request. The session-ID will be searched in the cookie header of the request, and in the request query string. If both values are present, the value in the query string takes precedence. If no session id is found, a new one is created and assigned to the request.
flush ( ) : void Flushes the session storage and persists all sessions.
getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface | AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the application instance.
getAttribute ( string $key ) : mixed | null Returns the attribute with the passed key from the container.
getGarbageCollector ( ) : AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface Returns the garbage collector instance.
getIdentifier ( ) : string Initializes the manager instance.
getLogger ( string $loggerName ) : Psr\Log\LoggerInterface Return's the logger with the requested name. First we look in the application and then in the system itself.
getManagerConfiguration ( ) : AppserverIo\Psr\Application\ManagerConfigurationInterface Return's the manager configuration.
getPersistenceManager ( ) : AppserverIo\Appserver\ServletEngine\FilesystemPersistenceManager Returns the persistence manager instance.
getServletManager ( ) : AppserverIo\Psr\Servlet\ServletContextInterface Returns the servlet manager instance.
getSessionFactory ( ) : AppserverIo\Appserver\ServletEngine\SessionFactory Returns the session factory.
getSessionHandlers ( ) : AppserverIo\Collections\ArrayList Returns all registered session handlers.
getSessionMarshaller ( ) : AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface Returns the session marshaller.
getSessionPool ( ) : AppserverIo\Storage\StorageInterface Returns the session pool instance.
getSessionSettings ( ) : AppserverIo\Appserver\ServletEngine\SessionSettingsInterface Returns the session settings.
getSessions ( ) : AppserverIo\Collections\HashMap Returns all sessions actually attached to the session manager.
initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Initializes the session manager.
injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Inject the application instance.
injectGarbageCollector ( AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface $garbageCollector ) : void Injects the garbage collector.
injectManagerConfiguration ( AppserverIo\Psr\Application\ManagerConfigurationInterface $managerConfiguration ) : void Inject the configuration for this manager.
injectSessionHandlers ( AppserverIo\Collections\CollectionInterface $sessionHandlers ) : void Inject the session handlers.
injectSessionMarshaller ( AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface $sessionMarshaller ) : void Injects the session marshaller.
injectSessionSettings ( AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : void Injects the session settings.
stop ( ) : void Shutdown the session manager instance.

Method Details

__construct() public méthode

Initialize the session manager.
public __construct ( )

__destruct() public méthode

Save the sessions back to the persistence layer.
public __destruct ( )

attach() public méthode

If a session with the session identifier already exists, it will be overwritten.
public attach ( AppserverIo\Psr\Servlet\ServletSessionInterface $session ) : void
$session AppserverIo\Psr\Servlet\ServletSessionInterface The session to attach
Résultat void

create() public méthode

Creates a new session with the passed session ID and session name if given.
public create ( mixed $id, string $name, integer | DateTime $lifetime = null, integer | null $maximumAge = null, string | null $domain = null, string $path = null, boolean $secure = null, boolean $httpOnly = null ) : AppserverIo\Psr\Servlet\ServletSessionInterface
$id mixed The session ID
$name string The session name
$lifetime integer | DateTime Date and time after the session expires
$maximumAge integer | null Number of seconds until the session expires
$domain string | null The host to which the user agent will send this cookie
$path string The path describing the scope of this cookie
$secure boolean If this cookie should only be sent through a "secure" channel by the user agent
$httpOnly boolean If this cookie should only be used through the HTTP protocol
Résultat AppserverIo\Psr\Servlet\ServletSessionInterface The requested session

find() public méthode

Tries to find a session for the given request. The session-ID will be searched in the cookie header of the request, and in the request query string. If both values are present, the value in the query string takes precedence. If no session id is found, a new one is created and assigned to the request.
public find ( string $id ) : AppserverIo\Psr\Servlet\Http\ServletSessionInterface | null
$id string The unique session ID to that has to be returned
Résultat AppserverIo\Psr\Servlet\Http\ServletSessionInterface | null The requested session

flush() public méthode

Flushes the session storage and persists all sessions.
public flush ( ) : void
Résultat void

getApplication() public méthode

Returns the application instance.
public getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface | AppserverIo\Psr\Naming\NamingDirectoryInterface
Résultat AppserverIo\Psr\Application\ApplicationInterface | AppserverIo\Psr\Naming\NamingDirectoryInterface The application instance

getAttribute() public méthode

Returns the attribute with the passed key from the container.
public getAttribute ( string $key ) : mixed | null
$key string The key the requested value is registered with
Résultat mixed | null The requested value if available

getGarbageCollector() public méthode

Returns the garbage collector instance.
public getGarbageCollector ( ) : AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface
Résultat AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface The garbage collector instance

getIdentifier() public méthode

Initializes the manager instance.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public getIdentifier ( ) : string
Résultat string

getLogger() public méthode

Return's the logger with the requested name. First we look in the application and then in the system itself.
public getLogger ( string $loggerName ) : Psr\Log\LoggerInterface
$loggerName string The name of the logger to return
Résultat Psr\Log\LoggerInterface The logger with the requested name

getManagerConfiguration() public méthode

Return's the manager configuration.
public getManagerConfiguration ( ) : AppserverIo\Psr\Application\ManagerConfigurationInterface
Résultat AppserverIo\Psr\Application\ManagerConfigurationInterface The manager configuration

getPersistenceManager() public méthode

Returns the persistence manager instance.
public getPersistenceManager ( ) : AppserverIo\Appserver\ServletEngine\FilesystemPersistenceManager
Résultat AppserverIo\Appserver\ServletEngine\FilesystemPersistenceManager The persistence manager instance

getServletManager() public méthode

Returns the servlet manager instance.
public getServletManager ( ) : AppserverIo\Psr\Servlet\ServletContextInterface
Résultat AppserverIo\Psr\Servlet\ServletContextInterface The servlet manager instance

getSessionFactory() public méthode

Returns the session factory.
public getSessionFactory ( ) : AppserverIo\Appserver\ServletEngine\SessionFactory
Résultat AppserverIo\Appserver\ServletEngine\SessionFactory The session factory instance

getSessionHandlers() public méthode

Returns all registered session handlers.
public getSessionHandlers ( ) : AppserverIo\Collections\ArrayList
Résultat AppserverIo\Collections\ArrayList The session handlers

getSessionMarshaller() public méthode

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

getSessionPool() public méthode

Returns the session pool instance.
public getSessionPool ( ) : AppserverIo\Storage\StorageInterface
Résultat AppserverIo\Storage\StorageInterface The session pool

getSessionSettings() public méthode

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

getSessions() public méthode

Returns all sessions actually attached to the session manager.
public getSessions ( ) : AppserverIo\Collections\HashMap
Résultat AppserverIo\Collections\HashMap The container with sessions

initialize() public méthode

Initializes the session manager.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Résultat void

injectApplication() public méthode

Inject the application instance.
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Résultat void

injectGarbageCollector() public méthode

Injects the garbage collector.
public injectGarbageCollector ( AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface $garbageCollector ) : void
$garbageCollector AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface The garbage collector
Résultat void

injectManagerConfiguration() public méthode

Inject the configuration for this manager.
public injectManagerConfiguration ( AppserverIo\Psr\Application\ManagerConfigurationInterface $managerConfiguration ) : void
$managerConfiguration AppserverIo\Psr\Application\ManagerConfigurationInterface The managers configuration
Résultat void

injectSessionHandlers() public méthode

Inject the session handlers.
public injectSessionHandlers ( AppserverIo\Collections\CollectionInterface $sessionHandlers ) : void
$sessionHandlers AppserverIo\Collections\CollectionInterface The session handlers
Résultat void

injectSessionMarshaller() public méthode

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

injectSessionSettings() public méthode

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

stop() public méthode

Shutdown the session manager instance.
public stop ( ) : void
Résultat void \AppserverIo\Psr\Application\ManagerInterface::stop()

Property Details

$application protected_oe property

The application instance.
protected ApplicationInterface,AppserverIo\Psr\Application $application
Résultat AppserverIo\Psr\Application\ApplicationInterface

$garbageCollector protected_oe property

The garbage collector instance.
protected GarbageCollectorInterface,AppserverIo\Appserver\ServletEngine $garbageCollector
Résultat AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface

$managerConfiguration protected_oe property

The manager configuration instance.
protected ManagerConfigurationInterface,AppserverIo\Psr\Application $managerConfiguration
Résultat AppserverIo\Psr\Application\ManagerConfigurationInterface

$sessionHandlers protected_oe property

The HashMap containing the session handlers.
protected HashMap,AppserverIo\Collections $sessionHandlers
Résultat AppserverIo\Collections\HashMap

$sessionMarshaller protected_oe property

The session marshaller instance.
protected SessionMarshallerInterface,AppserverIo\Appserver\ServletEngine $sessionMarshaller
Résultat AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface

$sessionSettings protected_oe property

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

$sessions protected_oe property

The HashMap containing the sessions.
protected HashMap,AppserverIo\Collections $sessions
Résultat AppserverIo\Collections\HashMap