PHP 클래스 AppserverIo\Appserver\ServletEngine\StandardSessionManager

상속: implements AppserverIo\Appserver\ServletEngine\SessionManagerInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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