Class PerspectiveSessionCollection
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.perspective.gateway.session.PerspectiveSessionCollection
- All Implemented Interfaces:
EventListener
,javax.servlet.http.HttpSessionBindingListener
,javax.servlet.http.HttpSessionIdListener
public class PerspectiveSessionCollection
extends AbstractLifecycle
implements javax.servlet.http.HttpSessionBindingListener, javax.servlet.http.HttpSessionIdListener
This is the top level of session object for a collection of "project" sessions. A given "auth session" (which
correlates to a browser instance) can run multiple projects simultaneously because of tabbed browsing.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal PerspectiveContext
final SessionScope
"scope" of this session - Client or Designerstatic final String
This is the name ( "perspective-session" ) used to store this object on an HttpSessionfinal String
UUID to help keep track of sessions by session monitor. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
findProjectSession
(String project) com.inductiveautomation.ignition.common.gson.Gson
getGson()
Optional<javax.servlet.http.HttpSession>
Returns the preferredLocale
that the client will accept content in, based on the Accept-Language header.Returns aList
ofLocale
objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header in the request which created this session.getOrCreateSession
(String projectName) Fetch theInternalSession
associated with the given project name and version or create one if it does not exist in this session collection.getOrCreateSession
(String projectName, UUID sessionId) getScope()
com.google.common.collect.ImmutableCollection<String>
void
handleLogs
(LogMessage log) Called when the client has POSTed log messages back to the server.boolean
boolean
boolean
void
notifyConnected
(MessageChannel channel) void
notifyDisconnected
(MessageChannel channel) void
Stops any ongoing processes running as part of the project running in this session.protected void
void
receive
(MessageChannel channel, String protocol, Reader payload) void
sessionIdChanged
(javax.servlet.http.HttpSessionEvent event, String oldSessionId) void
setRecentBytesSent
(Long recentBytesSent) void
Received challenge response from mobile devicevoid
valueBound
(javax.servlet.http.HttpSessionBindingEvent event) void
valueUnbound
(javax.servlet.http.HttpSessionBindingEvent event) Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Field Details
-
SESSION_KEY
This is the name ( "perspective-session" ) used to store this object on an HttpSession- See Also:
-
context
-
uuid
UUID to help keep track of sessions by session monitor. -
scope
"scope" of this session - Client or Designer
-
-
Method Details
-
getRemoteHost
-
getRemoteAddr
-
getGson
public com.inductiveautomation.ignition.common.gson.Gson getGson() -
getLocale
Returns the preferredLocale
that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.- Returns:
- the preferred
Locale
for the client
-
isValidMobile
public boolean isValidMobile() -
isValidWorkstation
public boolean isValidWorkstation() -
isBrokeredAuth
public boolean isBrokeredAuth() -
getDevice
-
validate
Received challenge response from mobile device -
getLocales
Returns aList
ofLocale
objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header in the request which created this session. If the client request doesn't provide an Accept-Language header, this method returns aList
containing oneLocale
, the default locale for the server.- Returns:
- a
List
of preferredLocale
objects for the client
-
getOrCreateSession
Fetch theInternalSession
associated with the given project name and version or create one if it does not exist in this session collection.- Parameters:
projectName
- the project name- Returns:
- the
InternalSession
associated with the given project name and version in a running state
-
getOrCreateSession
-
findProjectSession
-
getScope
-
getContext
-
valueBound
public void valueBound(javax.servlet.http.HttpSessionBindingEvent event) - Specified by:
valueBound
in interfacejavax.servlet.http.HttpSessionBindingListener
-
valueUnbound
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event) - Specified by:
valueUnbound
in interfacejavax.servlet.http.HttpSessionBindingListener
-
getHttpSession
-
sessionIdChanged
- Specified by:
sessionIdChanged
in interfacejavax.servlet.http.HttpSessionIdListener
-
onStartup
protected void onStartup()- Specified by:
onStartup
in classAbstractLifecycle
-
onShutdown
public void onShutdown()Stops any ongoing processes running as part of the project running in this session.- Specified by:
onShutdown
in classAbstractLifecycle
-
notifyConnected
-
notifyDisconnected
-
receive
-
handleLogs
Called when the client has POSTed log messages back to the server. -
builder
-
getSecurityZones
-
getTotalBytesSent
-
getRecentBytesSent
-
setRecentBytesSent
-