Remote Access Subsystem
The Remote Access Extension adds the RemoteAccessSubsystem to the ThingWorx Platform. This subsystem is generic and is shared by all RemoteAccessProvider Things, which include Axeda Global Access Servers 6.9.2/6.9.3, ThingWorx Global Access Servers 7.x, and the ThingWorx Internal Remote Access Provider for AlwaysOn devices.
The Remote Access Subsystem is used to persist and update remote sessions. It also generates audit messages for remote sessions. These audit messages are collected by the ThingWorx Audit Subsystem. The Remote Session history is maintained by storing historical Remote Session entries into persistence once they are completed.
To ensure remote sessions do not execute forever, a Maximum Session Duration (in hours) setting for the Remote Access Subsystem is enforced. To ensure remote sessions are properly cleaned up, the Inactive Session Timeout (in minutes) is also enforced. Both settings are configurable. Refer to the section below on configuring the subsystem for details.
Two events result in audit messages, a remote session is created and a remote session is completed. The Remote Access Extension fires these events (SessionCreated and SessionCompleted) to the RemoteAccessible Thing associated with the session when a session is started or completed. The triggering of either of these events results in an audit entry being logged that contains session information.
Configuring the Remote Access Subsystem
The subsystem has the following configuration settings:
• Maximum Number of Sessions to Return from Data Storage specifies the maximum number of persisted remote sessions to return when there is a request for remote sessions. The default value is 500 sessions.
• Timeout to indicate that the RemoteAccessClient is not installed locally specifies the number of milliseconds to wait before generating a message that says the ThingWorx Remote Access Client (RAC) is not installed on the user's computer.
• Maximum Session Duration (in hours) specifies the maximum number of hours that a remote session can remain active. The default value is 24 hours, with a minimum value of 1 hour and a maximum value of 240 hours.
• Inactive Session Timeout (in minutes) specifies the number of minutes that a remote session is allowed to remain inactive before it is timed out. The default value is 15 minutes, with a minimum value of 1 minute and a maximum value of 60 minutes.
• Maximum Number of AutoLaunchConfigs to Return from Storage specifies the number of configuration entries for Auto Launch to retrieve from the RAE storage when the
GetAutoLaunchConfigs service is run. The AutoLaunchConfigs are stored in a ThingWorx Data Table. For guidance on storing data in ThingWorx, refer to
Storing Data in ThingWorx in the ThingWorx Platform 9 Help Center.
• Time to keep metrics data in Days (min. 30, max. 365)—Specifies the number of days that session metrics are kept in the
RemoteSessionsMetrics data table. For more information, see
Viewing Remote Session Metrics.
• Enable Auto Launch? shows whether the Auto Launch features is enabled in the Remote Access Subsystem on this ThingWorx Platform. The checkmark indicates that Auto Launch is enabled. To disable it, clear the check box. When Auto Launch is disabled, end users can click the Launch command shown in the user interface of the Remote Access Client (RAC) to start the application they want to use during the remote session. For example, an SSH terminal or VNC Viewer.
The Remote Access Subsystem will throw exceptions if attempts are made to set values outside of the minimum and maximum values. Values for the subsystem can be set through ThingWorx Composer, as shown below:
|
Modifying the configuration of the inactivity timeout, the maximum session duration, and the maximum number of AutoLaunchConfig to return, and enabling/disabling Auto Launch do not require a restart of the Remote Access Subsystem.
|
The subsystem is started automatically when the ThingWorx Platform is started.
| The Remote Access Subsystem will throw exceptions if callers attempt to set values outside of the minimum and maximum value ranges from either ThingWorx Composer or the SetConfigurationTable service. |
The subsystem provides the following services to clean up old sessions and end inactive sessions:
Service | Description | Responsibilities |
---|
CleanupOldSessions | Called every 30 minutes (1800000 ms) by default, this sevice cleans up any sessions that have exceeded the maximum session duration by updating status to CLOSE_REQUESTED. To change the default, refer to . | • Determine expirationTime (in milliseconds) by subtracting: System.currentTimeMillis - HOURS.toMillis(maxSessionDuration). • Find all Remote Sessions with a createdTime field that is less than or equal to expirationTime. • For each session returned, set status to CLOSE_REQUESTED and then set the terminationCause to "Remote session close was requested due to max session duration of %s hours" and then update the session by calling updateRemoteSession(session). |
TerminateInactiveSessions | Called every minute (60000 ms) by default, this service ends any inactive sessions and sets the status to TERMINATED. To change the default, refer to . | • Determine inactiveTime (in milliseconds) by subtracting: System.currentTimeMillis - MINUTES.toMillis(maxSessionDuration). • Find all Remote Sessions with a lastActivityTime field less than or equal to inactiveTime. • For each session returned, set the status to CLOSE_REQUESTED if it is not already set to CLOSE_REQUESTED. If the status is already CLOSE_REQUESTED, set the status to TERMINATED and then set the terminationCause to "Remote session was terminated due to session inactive timeout of %s minutes". Then, update the session. The CleanupOldSessionsTime runs and sets the sessions that exceed max_session_duration to CLOSE_REQUESTED. The UpdateSession service automatically refreshes the lastActivityTime when it updates the session. | Since the status is TERMINATED, the session is removed from persistence and also from the subsystem. |
|
| The lastActivityTime property of a Thing is updated with each GAS status update and with status updates from the Remote Access Client (RAC). Any update from either GAS or RAC will result in the lastActivityTime property being updated and the session will not time out. "Inactivity" to the ThingWorx Platform means only that the platform has not received a status update from either RAC or GAS. Inactivity does not mean that there are no bytes being transferred. |