offline event
- Last Updated: June 14, 2019
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Fires when the current JSDOSession object detects that the
device on which it is running has gone offline, or that the web application to which it has
been connected is no longer available.
This event always fires when the device on which the JSDOSession object is created goes offline (that is, the device is disconnected
from the network). For this event to fire when the web application to which it has been
connected is no longer available, the JSDOSession object
must have previously:
- Been connected to the web application using the object's
login( )method - Not been disconnected from the web application using the object's
logout( )method
Applies to: progress.data.JSDOSession class
Syntax
The following parameters appear in the signature of any event handler (callback) function (or functions) that you subscribe to this event:
|
- session
- A reference to the
JSDOSessionobject that has detected the offline condition. - off-line-reason
- A
stringconstant indicating the reason that the offline event has been fired. Possible constants include:progress.data.Session.APPSERVER_OFFLINE— (OpenEdge Data Object Services only) The other components necessary to run the service are available, but the associated OpenEdge application server is offline.progress.data.Session.DEVICE_OFFLINE— The device itself is offline. For example, it might be in airplane mode, or it might be unable to pick up a Wi-Fi or cell signal.progress.data.Session.SERVER_OFFLINE— The web server is not available. For a Data Object Service, this is the web server for the public or private cloud. For an OpenEdge Data Object Service, this is the Tomcat Java servlet container.progress.data.Session.WEB_APPLICATION_OFFLINE— The server is running, but the Java web application that implements the Data Object Service is not deployed.
Note: Theprogress.data.Session.DEVICE_OFFLINEcondition will fire theofflineevent on aJSDOSessionobject even if the object has not yet authenticated.You can use the string values of these constants directly to display or log messages, or test the values only and respond to the result in some other way.
- request
- If the offline condition was detected as a result of a request sent on
behalf of a JSDO, this is a reference to the
requestobject used to make the request. For more information, see the description of the request object. If the offline event is the result of the device going offline or because of a call to theping( )method (either directly or because thepingIntervalproperty is set greater than 0), this parameter isnull.
offline event to
fire, nor will the fact that a particular Data Object Service contained by the hosting web
application was not loaded when the application started.Example
The following code fragment subscribes the function, onSessionOffline, to
handle the offline event fired on the session,
mySession:
|
See also:
connected property, login( ) method (JSDOSession class), logout( ) method (JSDOSession class), online event, ping( ) method (JSDOSession class), subscribe( ) method (JSDOSession class), unsubscribe( ) method (JSDOSession class)