Class MonitorServer

All Implemented Interfaces:
ClientInterface, HandlerInterface, RemoteServer, MBeanListener, MBeanService, ToBeStarted, MonitorInterface, Serializable, Remote

public final class MonitorServer extends StarterServer implements MonitorInterface
The Class MonitorServer.

Entry point for the ECpds Monitor daemon. Replaces the legacy ecmwf.common.ecaccess.HandlerServer as the RMI-exported server object on monitor hosts.

By implementing MonitorInterface (which is part of open-ecpds rather than the pre-compiled ecaccess-stubs.jar), Java RMI uses a dynamic proxy when the master connects to this server. A dynamic proxy forwards all non-default abstract methods — including getHttpCertificateJson() and deployHttpCertificate(byte[], String) — to this remote object over the network. This resolves the Java 9+ RMI issue where default interface methods on HandlerInterface were invoked locally on the master JVM instead of being forwarded to the remote monitor.

Start monitors with:

JAVA_OPTS = "$JAVA_OPTS -Decmwf.common.starter.name=ecmwf.ecpds.monitor.MonitorServer"

The service name ("ECpdsMonitor") is unchanged, so existing master configuration and the getMonitorInterface() lookup are backward-compatible at the service-registration level.

See Also:
  • Constructor Details

  • Method Details

    • getRoot

      public String getRoot()
      Gets the root. Gets the root.
      Specified by:
      getRoot in interface ClientInterface
      Returns:
      the root
    • getPassword

      public String getPassword()
      Gets the password. Gets the password.
      Specified by:
      getPassword in interface ClientInterface
      Returns:
      the password
    • getVersion

      public String getVersion()
      Gets the version. Gets the version.
      Specified by:
      getVersion in class StarterServer
      Returns:
      the version
    • getService

      public String getService()
      Gets the service. Returns the service name used to register this monitor with the master. The service name "ECpdsMonitor" is unchanged from the legacy HandlerServer so that the master's getMonitorInterface() lookup continues to work without configuration changes.
      Specified by:
      getService in interface ClientInterface
      Returns:
      the service
    • getHttpCertificateJson

      public String getHttpCertificateJson() throws RemoteException
      Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this monitor's HTTPS server.

      This method re-declares the default method from HandlerInterface as abstract so that Java RMI's dynamic proxy forwards the call to the remote MonitorServer rather than executing it locally. Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this monitor's HTTPS server. Delegates to the http plugin via reflection to avoid classloader-isolation issues.

      Specified by:
      getHttpCertificateJson in interface HandlerInterface
      Specified by:
      getHttpCertificateJson in interface MonitorInterface
      Returns:
      JSON string; never null
      Throws:
      RemoteException - the remote exception
    • reloadHttpCertificate

      public void reloadHttpCertificate() throws RemoteException
      Hot-reloads the TLS certificate from the keystore file currently on disk on the remote Monitor. Re-declares the default no-op from HandlerInterface as abstract so that Java RMI's dynamic proxy forwards the call to the remote MonitorServer. Hot-reloads the TLS certificate from the keystore file currently on disk on this Monitor. Delegates to the http plugin via reflection to avoid classloader-isolation issues.
      Specified by:
      reloadHttpCertificate in interface HandlerInterface
      Specified by:
      reloadHttpCertificate in interface MonitorInterface
      Throws:
      RemoteException - the remote exception
    • deployHttpCertificate

      public void deployHttpCertificate(byte[] pkcs12Bytes, String keystorePassword) throws RemoteException
      Deploys a new PKCS#12 keystore to this monitor's HTTPS server and reloads the certificate.

      This method re-declares the default no-op from HandlerInterface as abstract so that Java RMI's dynamic proxy forwards the call to the remote MonitorServer. Deploys a new PKCS#12 keystore to this monitor's HTTPS server. Delegates to the http plugin via reflection to avoid classloader-isolation issues.

      Specified by:
      deployHttpCertificate in interface HandlerInterface
      Specified by:
      deployHttpCertificate in interface MonitorInterface
      Parameters:
      pkcs12Bytes - the PKCS#12 keystore bytes
      keystorePassword - password for the keystore and private key
      Throws:
      RemoteException - the remote exception
    • getNetworkPluginInfos

      public List<Map<String,Object>> getNetworkPluginInfos()
      Lists every network plugin currently loaded in this Monitor's own JVM (ref/name/port/status), read directly from its own plugin container - mirrors MoverInterface#getNetworkPluginInfos(), allowing the Master to report every connected Monitor instance's own plugins/ports in the System Topology diagram, not just the one instance that happens to be serving a given web request. Lists every network plugin currently loaded in this Monitor's own JVM, read directly from its own plugin container (no RMI involved on this end - the caller, the Master Server, reaches this over the existing MonitorInterface RMI connection).
      Specified by:
      getNetworkPluginInfos in interface MonitorInterface
      Returns:
      the list of plugin info maps