Interface ServerMBean


  • public interface ServerMBean
    One ServerMBean instance exists in the system, to provide general information and operations on the Server. It is created at startup by Lightstreamer Server and lasts until the shutdown of the Server.

    ServerMBean name:
    "com.lightstreamer:type=Server"
    • Method Detail

      • getTotalMemory

        java.lang.Long getTotalMemory()
        Returns:
        The total memory (expressed in Bytes) allocated for the heap.
      • getFreeMemory

        java.lang.Long getFreeMemory()
        Returns:
        The free memory (expressed in Bytes) in the heap.
      • getJavaVersion

        java.lang.String getJavaVersion()
        Returns:
        The version of the Java virtual machine.
      • getUptimeMillis

        java.lang.Long getUptimeMillis()
        Returns:
        The time (expressed in milliseconds) passed since Lightstreamer Server has been started up.
      • getStartupTime

        java.util.Date getStartupTime()
        Returns:
        The timestamp of Lightstreamer Server startup.
      • getLSVersion

        java.lang.String getLSVersion()
        Returns:
        The version of Lightstreamer Server.
      • getLSEdition

        java.lang.String getLSEdition()
        Returns:
        The edition in which Lightstreamer Server is running, can be one of the following:
        - COMMUNITY
        - ENTERPRISE
      • getLSLicenseType

        java.lang.String getLSLicenseType()
        Returns:
        The license type used to run Lightstreamer Server, can be one of the following:
        - DEMO
        - EVALUATION
        - STARTUP
        - NON-PRODUCTION-LIMITED
        - NON-PRODUCTION-FULL
        - PRODUCTION
        - HOT-STANDBY
        - FREE
      • getLSClientId

        java.lang.String getLSClientId()
        Returns:
        The client id of the license used to run Lightstreamer Server. For a DEMO license type, "-" is returned.
      • getLocalHostIP

        java.lang.String getLocalHostIP()
        Returns:
        The local IP address of the host running Lightstreamer Server.
      • getLocalHostname

        java.lang.String getLocalHostname()
        Returns:
        The local hostname of the host running Lightstreamer Server.
      • getStatus

        java.lang.String getStatus()
        Returns:
        The status of the server with respect to support for client requests. It can be "Initializing", "Running", "Stopped", or "Blocked"; moreover, if a draining activity requested through drainSessions(Double) is in place, it is also reported.
      • getCumulAcceptPauseMillis

        java.lang.Long getCumulAcceptPauseMillis()
        Returns:
        The total time in which the Server has paused, keeping from accepting new socket connections, in the life of the Server. The Server may pause in case of unexpected errors or because of the configured pool queue limits. The time is aggregated over all server socket ports (hence, in principle, it can be greater than the total uptime itself).
      • getNewAcceptPauseMillis

        java.lang.Long getNewAcceptPauseMillis()
        Returns:
        The time in which the Server has paused, keeping from accepting new socket connections, during the last sampling period. The Server may pause in case of unexpected errors or because of the configured pool queue limits. The time is aggregated over all server socket ports (hence, it can be greater than the sampling period itself).
      • shutdown

        void shutdown()
        Terminate the Server operations and exit JVM.
      • stop

        java.lang.Boolean stop()
        Close all Connections, of any type, and stop accepting Connections of any type from any client. This will cause all the currently active Sessions to terminate, with no cause notification to the clients. Incoming Connection attempts will be accepted and logged, then immediately closed. The process stays alive.
        WARNING If you stop the Server from JMX Tree, you will not be able to start it again from JMX Tree itself, but from a JMX client, like JConsole.
        Returns:
        True if operation succeeded. False if operation failed.
      • block

        java.lang.Boolean block​(java.lang.Boolean forceRetry)
        Stop accepting new Requests for opening new Sessions, but keep serving currently active Sessions and accept any Requests related to these Sessions. Requests on ports declared as "priority ports" will not be affected. Also requests to the Internal Web Server, like all JMX Tree activity, will still be allowed.
        Parameters:
        forceRetry - If true, the client will be asked to try a reconnection; this makes sense only in a clustering scenario; otherwise the client will be asked to keep from retrying.
        Returns:
        True if operation succeeded. False if operation failed.
      • drainSessions

        java.lang.Boolean drainSessions​(java.lang.Double secondRate)
        Starts a background activity to close all sessions at a desired rate. If such an activity is already in place, it will be replaced. The sessions will be closed one at a time. Since session close involves invocations to the Metadata Adapter, which may introduce delays, the actual rate of closes may be lower than requested. Sessions logged to the Internal Monitor Adapter Set are not affected.
        This invocation is meant to force rebalancing in a clustering scenario, hence the clients will be asked to try a reconnection. If new connections on this instance have to be prevented, block(Boolean) can be called first.
        Parameters:
        secondRate - The desired rate of sessions to be closed per second. Rates from 1/1000 to 1 million per second are supported.
        Returns:
        True if operation succeeded. False if operation failed.
        See Also:
        start()
      • start

        java.lang.Boolean start()
        Start accepting new Connections and Requests of any type. Called to switch from "Stopped" and "Blocked" mode to "Running" mode. Any pending draining activity requested through drainSessions(Double) will also be interrupted.
        Returns:
        True if operation succeeded. False if operation failed.
      • disableIP

        java.lang.Boolean disableIP​(java.lang.String ip)
        Ban a specified IP address. Close all Connections, of any type, and stop accepting Connections of any type from clients connected from this IP address. This will cause the Sessions related with those clients to terminate, with no cause notification to the clients. Incoming Connection attempts from the banned IP will be accepted and logged, then immediately closed.
        Parameters:
        ip - an IP address.
        Returns:
        True if operation succeeded. False if operation failed.
      • enableIP

        java.lang.Boolean enableIP​(java.lang.String ip)
        Remove the ban associated to the specified IP address.
        Parameters:
        ip - an IP address.
        Returns:
        True if operation succeeded. False if operation failed.
      • getDisabledIPsList

        java.util.List<java.lang.String> getDisabledIPsList()
        Returns:
        The list of all banned IP addresses. Expressed as an ArrayList of Strings, where each String contains an IP address.
      • disableHostname

        java.lang.Boolean disableHostname​(java.lang.String hostname)
        Ban a specified host or domain name. Close all Connections, of any type, and stop accepting Connections of any type from clients connected from this host or domain. This will cause the Sessions related with those clients to terminate, with no cause notification to the clients. Incoming Connection attempts from the banned host/domain will be accepted and logged, then immediately closed.
        Parameters:
        hostname - a host or domain name.
        Returns:
        True if operation succeeded. False if operation failed.
      • enableHostname

        java.lang.Boolean enableHostname​(java.lang.String hostname)
        Remove the ban associated to the specified host or domain name.
        Parameters:
        hostname - a host or domain name.
        Returns:
        True if operation succeeded. False if operation failed.
      • getDisabledHostnamesList

        java.util.List<java.lang.String> getDisabledHostnamesList()
        Returns:
        The list of all banned host or domain names. Expressed as an ArrayList of Strings, where each String contains a host/domain name.
      • getMaxSessions

        java.lang.Integer getMaxSessions()
        Returns:
        The maximum allowed number of concurrent Sessions (Clients). a 0 value indicates an unlimited number of Sessions. As long as sessions are in "prestarted" state, they don't concur to the overall count; sessions that are in "prestarted" state while the limit is exceeded are kept, but they may get closed upon the first attempt to use them.
        This setting corresponds to the <max_sessions> configuration setting.
        Note that further restrictions may be posed by license terms.
      • setMaxSessions

        void setMaxSessions​(java.lang.Integer sessions)
        Parameters:
        sessions - The maximum allowed number of concurrent Sessions (Clients). 0 is used to indicate an unlimited number of Sessions. This setting overrides the <max_sessions> configuration setting. Setting a limit which is lower than the current number of active sessions does not affect these sessions in any way.
        See Also:
        getMaxSessions()
      • getMaxMPNDevices

        java.lang.Integer getMaxMPNDevices()
        Returns:
        The maximum allowed number of concurrent MPN Devices served by the Push Notification service in this Server instance. A 0 value indicates an unlimited number of MPN Devices. This setting corresponds to the <max_mpn_devices> configuration setting.
        It is null if the internal MPN Module is not enabled. Note that further restrictions may be posed by license terms.
        See Also:
        PushNotificationsMBean.getCurrentMPNDevices()
        Unavailability Note:
        MPN is currently not available.
      • setMaxMPNDevices

        void setMaxMPNDevices​(java.lang.Integer devices)
        Parameters:
        devices - The maximum allowed number of concurrent MPN Devices being served by the Push Notification service in this Server instance. 0 is used to indicate an unlimited number of MPN Devices. This setting overrides the <max_mpn_devices> configuration setting. Setting a limit which is lower than the number of MPN Devices currently served does not affect these Devices in any way. The setting is ignored if the internal MPN Module is not enabled.
        See Also:
        PushNotificationsMBean.getCurrentMPNDevices()
        Unavailability Note:
        MPN is currently not available.
      • getSamplingPeriodMillis

        java.lang.Integer getSamplingPeriodMillis()
        Returns:
        The duration of the sampling period (used for statistical attributes for all the MBeans of Lightstreamer).
      • getLastRefreshTime

        java.util.Date getLastRefreshTime()
        Returns:
        The time of the last refresh of sampled attributes (used for statistical attributes for all the MBeans of Lightstreamer).
      • getConfigFile

        java.lang.String getConfigFile​(java.lang.String placeholder)
        Parameters:
        placeholder - Dummy argument that turns the property into an operation and prevents JMX clients from computing the result in a non-interacting way. It can be left null.
        Returns:
        The contents of the Server XML configuration file, as read at Server startup.
      • getVersionConfigFile

        @Deprecated
        java.lang.String getVersionConfigFile​(java.lang.String placeholder)
        Deprecated.
        You should use the new getEditionConfigFile method.
        Parameters:
        placeholder - Dummy argument that turns the property into an operation and prevents JMX clients from computing the result in a non-interacting way. It can be left null.
        Returns:
        The contents of the Server XML edition configuration file, as read at Server startup.
      • getEditionConfigFile

        java.lang.String getEditionConfigFile​(java.lang.String placeholder)
        Parameters:
        placeholder - Dummy argument that turns the property into an operation and prevents JMX clients from computing the result in a non-interacting way. It can be left null.
        Returns:
        The contents of the Server XML edition configuration file, as read at Server startup.
      • getConfigAsProperties

        java.util.Map<java.lang.String,​java.lang.String> getConfigAsProperties​(java.lang.String filter)
        Parameters:
        filter - A text to be used as a filter for property names, or null if no filtering is needed.
        Returns:
        The contents of the Server XML configuration file, as actually used by the Server for its own configuration needs; in particular, only nonempty elements are reported, as empty elements are ignored by the Server. If a filtering text is supplied, then a proper subset is returned. The return value is a key-value Map alphabetically ordered. Note that the key values follow an internal naming convention, by which:
        • subelements are represented as dot-separated compound names;
        • attributes are represented within parenthesis;
        • multiple instances of the same elements are distinguished through a trailing progressive.
      • getVersionConfigAsProperties

        @Deprecated
        java.util.Map<java.lang.String,​java.lang.String> getVersionConfigAsProperties​(java.lang.String filter)
        Deprecated.
        You should use the new getEditionConfigAsProperties method.
        Parameters:
        filter - A text to be used as a filter for property names, or null if no filtering is needed.
        Returns:
        The contents of the Server XML edition configuration file, as actually used by the Server for its own configuration needs; in particular, only nonempty elements are reported, as empty elements are ignored by the Server. If a filtering text is supplied, then a proper subset is returned. The return value is a key-value Map alphabetically ordered. Note that the key values follow an internal naming convention, by which:
        • subelements are represented as dot-separated compound names;
        • attributes are represented within parenthesis;
        • multiple instances of the same elements are distinguished through a trailing progressive.
      • getEditionConfigAsProperties

        java.util.Map<java.lang.String,​java.lang.String> getEditionConfigAsProperties​(java.lang.String filter)
        Parameters:
        filter - A text to be used as a filter for property names, or null if no filtering is needed.
        Returns:
        The contents of the Server XML edition configuration file, as actually used by the Server for its own configuration needs; in particular, only nonempty elements are reported, as empty elements are ignored by the Server. If a filtering text is supplied, then a proper subset is returned. The return value is a key-value Map alphabetically ordered. Note that the key values follow an internal naming convention, by which:
        • subelements are represented as dot-separated compound names;
        • attributes are represented within parenthesis;
        • multiple instances of the same elements are distinguished through a trailing progressive.