Interface MonitorInterface

All Superinterfaces:
ClientInterface, HandlerInterface, Remote
All Known Implementing Classes:
MonitorServer

public interface MonitorInterface extends HandlerInterface
The Interface MonitorInterface.

Extends HandlerInterface with direct RMI-callable certificate operations for ECpds Monitor daemons.

HandlerInterface.getHttpCertificateJson() and HandlerInterface.deployHttpCertificate(byte[], String) are declared default (no-op) in HandlerInterface because the pre-compiled HandlerServer_Stub in the parallel ECaccess-J project has no entry for those methods — Java 9+ RMI would invoke them locally on the caller JVM rather than forwarding to the remote.

MonitorInterface is defined inside open-ecpds, so no pre-compiled stub exists for it. Java RMI uses a dynamic proxy (RemoteObjectInvocationHandler) for any remote object exported under this interface, and a dynamic proxy forwards non-default abstract methods to the remote correctly. By re-declaring getHttpCertificateJson() and deployHttpCertificate() as abstract here, the master can call them via an ordinary RMI round-trip to the MonitorServer running on the monitor host.

Monitors must be started with -Decmwf.common.starter.name=ecmwf.ecpds.monitor.MonitorServer instead of the legacy ecmwf.common.ecaccess.HandlerServer.

  • Method Details

    • getHttpCertificateJson

      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.

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

      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.

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

      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.
      Specified by:
      reloadHttpCertificate in interface HandlerInterface
      Throws:
      RemoteException - the remote exception