Class HandlerServer
- All Implemented Interfaces:
ClientInterface, HandlerInterface, RemoteServer, MBeanListener, MBeanService, ToBeStarted, Serializable, Remote
- See Also:
-
Field Summary
Fields inherited from class RemoteObject
ref -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeployHttpCertificate(byte[] pkcs12Bytes, String keystorePassword) Deploys a new PKCS#12 keystore to this handler's HTTPS server and reloads the certificate.Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this handler's HTTPS server, or"{}"if no certificate is available.Gets the password.getRoot()Gets the root.Gets the service.Gets the version.Methods inherited from class StarterServer
exit, getAttribute, getGraceful, getInstance, getInstance, getMBeanCenter, getMBeanInfo, getPluginContainer, getPluginInfos, getRemoteCnf, getRestart, getStartDate, handle, handle, handleNotification, invoke, setAttribute, shutdown, shutdownMethods inherited from class CallBackObject
createOrGetRegistry, getPort, unexportMethods inherited from class UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class RemoteServer
getClientHost, getLog, setLogMethods inherited from interface HandlerInterface
handle, handle, reloadHttpCertificate
-
Constructor Details
-
HandlerServer
public HandlerServer(Starter starter) throws IOException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, InstanceNotFoundException Instantiates a new handler server.- Parameters:
starter- the starter- Throws:
IOException- Signals that an I/O exception has occurred.InstanceAlreadyExistsException- the instance already exists exceptionMBeanRegistrationException- the MBean registration exceptionNotCompliantMBeanException- the not compliant m bean exceptionMalformedObjectNameException- the malformed object name exceptionInstanceNotFoundException- the instance not found exception
-
-
Method Details
-
getRoot
Gets the root. Gets the root.- Specified by:
getRootin interfaceClientInterface- Returns:
- the root
-
getPassword
Gets the password. Gets the password.- Specified by:
getPasswordin interfaceClientInterface- Returns:
- the password
-
getVersion
Gets the version. Gets the version.- Specified by:
getVersionin classStarterServer- Returns:
- the version
-
getService
Gets the service. Gets the service.- Specified by:
getServicein interfaceClientInterface- Returns:
- the service
-
getHttpCertificateJson
Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this handler's HTTPS server, or"{}"if no certificate is available.Note: this is intentionally a
defaultmethod returning"{}". Java RMI'sRemoteObjectInvocationHandler(Java 9+) invokes default interface methods locally on the caller JVM rather than forwarding the call to the remote object. The pre-compiledHandlerServer_Stubinecaccess-stubs.jarwas generated before this method existed and has no entry for it.Monitors running as
MonitorServerinstead of the legacyHandlerServerimplementMonitorInterface, which re-declares this method asabstract. SinceMonitorInterfacehas no pre-compiled stub, RMI uses a dynamic proxy that properly forwards the call to the remoteMonitorServer. Thedefaulthere preserves backward compatibility for legacy clients that still present aHandlerServer_Stub. Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this handler's HTTPS server. Delegates to thehttpplugin via theHttpCertificateProviderinterface. Returns"{}"if the plugin is not available or does not implement the interface.- Specified by:
getHttpCertificateJsonin interfaceHandlerInterface- Returns:
- JSON string; never
null - Throws:
RemoteException- the remote exception
-
deployHttpCertificate
public void deployHttpCertificate(byte[] pkcs12Bytes, String keystorePassword) throws RemoteException Deploys a new PKCS#12 keystore to this handler's HTTPS server and reloads the certificate.Note: this is intentionally a
defaultno-op — seeHandlerInterface.getHttpCertificateJson()for the rationale. Monitors running asMonitorServeroverride this method viaMonitorInterfaceand receive the call over the direct RMI channel. Deploys a new PKCS#12 keystore to this handler's HTTPS server. Delegates to thehttpplugin via theHttpCertificateProviderinterface. No-op if the plugin is not available or does not implement the interface.- Specified by:
deployHttpCertificatein interfaceHandlerInterface- Parameters:
pkcs12Bytes- the PKCS#12 keystore byteskeystorePassword- password for the keystore and private key- Throws:
RemoteException- the remote exception
-