PHP Класс AppserverIo\Appserver\ServletEngine\StandardSessionManager

Автор: Tim Wagner ([email protected])
Наследование: implements AppserverIo\Appserver\ServletEngine\SessionManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

Initialize the session manager.
public __construct ( )

__destruct() публичный метод

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

attach() публичный метод

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
Результат void

create() публичный метод

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
Результат AppserverIo\Psr\Servlet\ServletSessionInterface The requested session

find() публичный метод

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
Результат AppserverIo\Psr\Servlet\Http\ServletSessionInterface | null The requested session

flush() публичный метод

Flushes the session storage and persists all sessions.
public flush ( ) : void
Результат void

getApplication() публичный метод

Returns the application instance.
public getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface | AppserverIo\Psr\Naming\NamingDirectoryInterface
Результат AppserverIo\Psr\Application\ApplicationInterface | AppserverIo\Psr\Naming\NamingDirectoryInterface The application instance

getAttribute() публичный метод

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
Результат mixed | null The requested value if available

getGarbageCollector() публичный метод

Returns the garbage collector instance.
public getGarbageCollector ( ) : AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface
Результат AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface The garbage collector instance

getIdentifier() публичный метод

Initializes the manager instance.
См. также: AppserverIo\Psr\Application\ManagerInterface::initialize()
public getIdentifier ( ) : string
Результат string

getLogger() публичный метод

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
Результат Psr\Log\LoggerInterface The logger with the requested name

getManagerConfiguration() публичный метод

Return's the manager configuration.
public getManagerConfiguration ( ) : AppserverIo\Psr\Application\ManagerConfigurationInterface
Результат AppserverIo\Psr\Application\ManagerConfigurationInterface The manager configuration

getPersistenceManager() публичный метод

Returns the persistence manager instance.
public getPersistenceManager ( ) : AppserverIo\Appserver\ServletEngine\FilesystemPersistenceManager
Результат AppserverIo\Appserver\ServletEngine\FilesystemPersistenceManager The persistence manager instance

getServletManager() публичный метод

Returns the servlet manager instance.
public getServletManager ( ) : AppserverIo\Psr\Servlet\ServletContextInterface
Результат AppserverIo\Psr\Servlet\ServletContextInterface The servlet manager instance

getSessionFactory() публичный метод

Returns the session factory.
public getSessionFactory ( ) : AppserverIo\Appserver\ServletEngine\SessionFactory
Результат AppserverIo\Appserver\ServletEngine\SessionFactory The session factory instance

getSessionHandlers() публичный метод

Returns all registered session handlers.
public getSessionHandlers ( ) : AppserverIo\Collections\ArrayList
Результат AppserverIo\Collections\ArrayList The session handlers

getSessionMarshaller() публичный метод

Returns the session marshaller.
public getSessionMarshaller ( ) : AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface
Результат AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller

getSessionPool() публичный метод

Returns the session pool instance.
public getSessionPool ( ) : AppserverIo\Storage\StorageInterface
Результат AppserverIo\Storage\StorageInterface The session pool

getSessionSettings() публичный метод

Returns the session settings.
public getSessionSettings ( ) : AppserverIo\Appserver\ServletEngine\SessionSettingsInterface
Результат AppserverIo\Appserver\ServletEngine\SessionSettingsInterface The session settings

getSessions() публичный метод

Returns all sessions actually attached to the session manager.
public getSessions ( ) : AppserverIo\Collections\HashMap
Результат AppserverIo\Collections\HashMap The container with sessions

initialize() публичный метод

Initializes the session manager.
См. также: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Результат void

injectApplication() публичный метод

Inject the application instance.
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Результат void

injectGarbageCollector() публичный метод

Injects the garbage collector.
public injectGarbageCollector ( AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface $garbageCollector ) : void
$garbageCollector AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface The garbage collector
Результат void

injectManagerConfiguration() публичный метод

Inject the configuration for this manager.
public injectManagerConfiguration ( AppserverIo\Psr\Application\ManagerConfigurationInterface $managerConfiguration ) : void
$managerConfiguration AppserverIo\Psr\Application\ManagerConfigurationInterface The managers configuration
Результат void

injectSessionHandlers() публичный метод

Inject the session handlers.
public injectSessionHandlers ( AppserverIo\Collections\CollectionInterface $sessionHandlers ) : void
$sessionHandlers AppserverIo\Collections\CollectionInterface The session handlers
Результат void

injectSessionMarshaller() публичный метод

Injects the session marshaller.
public injectSessionMarshaller ( AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface $sessionMarshaller ) : void
$sessionMarshaller AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface The session marshaller instance
Результат void

injectSessionSettings() публичный метод

Injects the session settings.
public injectSessionSettings ( AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : void
$sessionSettings AppserverIo\Appserver\ServletEngine\SessionSettingsInterface Settings for the session handling
Результат void

stop() публичный метод

Shutdown the session manager instance.
public stop ( ) : void
Результат void \AppserverIo\Psr\Application\ManagerInterface::stop()

Описание свойств

$application защищенное свойство

The application instance.
protected ApplicationInterface,AppserverIo\Psr\Application $application
Результат AppserverIo\Psr\Application\ApplicationInterface

$garbageCollector защищенное свойство

The garbage collector instance.
protected GarbageCollectorInterface,AppserverIo\Appserver\ServletEngine $garbageCollector
Результат AppserverIo\Appserver\ServletEngine\GarbageCollectorInterface

$managerConfiguration защищенное свойство

The manager configuration instance.
protected ManagerConfigurationInterface,AppserverIo\Psr\Application $managerConfiguration
Результат AppserverIo\Psr\Application\ManagerConfigurationInterface

$sessionHandlers защищенное свойство

The HashMap containing the session handlers.
protected HashMap,AppserverIo\Collections $sessionHandlers
Результат AppserverIo\Collections\HashMap

$sessionMarshaller защищенное свойство

The session marshaller instance.
protected SessionMarshallerInterface,AppserverIo\Appserver\ServletEngine $sessionMarshaller
Результат AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface

$sessionSettings защищенное свойство

The settings for the session handling.
protected SessionSettingsInterface,AppserverIo\Appserver\ServletEngine $sessionSettings
Результат AppserverIo\Appserver\ServletEngine\SessionSettingsInterface

$sessions защищенное свойство

The HashMap containing the sessions.
protected HashMap,AppserverIo\Collections $sessions
Результат AppserverIo\Collections\HashMap