Class VirtualizedMonitorPropCnr

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.server.monitor.VirtualizedMonitorPropCnr
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IEndPointListener, Cloneable
Direct Known Subclasses:
EditorVirtualizedMonitorPropCnr

public class VirtualizedMonitorPropCnr extends PropCnr implements IEndPointListener
Property container used for Virtual Monitor data and communication.
Author:
Christopher Mindus
  • Field Details

    • DEBUG

      public static boolean DEBUG
      Very verbose output.
    • monitor

      protected IVirtualizedMonitor monitor
      The server monitor interface, null when not a monitor (i.e. end-point in server).
  • Constructor Details

    • VirtualizedMonitorPropCnr

      public VirtualizedMonitorPropCnr()
      Constructor for transactions.
    • VirtualizedMonitorPropCnr

      public VirtualizedMonitorPropCnr(Atom atom, IVirtualizedMonitor monitor)
      Constructor for monitor.
  • Method Details

    • clone

      public VirtualizedMonitorPropCnr clone()
      Clone must be overridden.
      Overrides:
      clone in class PropCnr
    • cloneWithoutSecrets

      public static PropCnr cloneWithoutSecrets(PropCnr cnr)
      Creates the copy of a live server property container that is sent to the monitor: a deep clone in which no secret value remains, while the structure is kept so that the monitor still shows which settings exist. Every PasswordProp gets the empty string, every PKCS12IdentityProp keeps only its description (the text before the first NUL byte, and that byte) without the keystore, and every entry of a customApp map (ServerConfigEnvProps.CUSTOM_APP_SETTINGS) keeps its key with an empty value. A read-only flag on the copy is cleared first; a value that still cannot be emptied (an unmodifiable map, a validator refusing the empty value) is removed from the copy instead.

      A property marked secret (GProp.isPropSecret()) is emptied whatever its class (order 607): the mark says that its value belongs to the secrets store, and a plain StringProp carries it as a password does - the VAPID private key and the Firebase service account of the server's own $push are such strings. A marked string gets the empty string, with or without a value before: a marked member left as it was resolved would take a later change of the secrets store (SecretsContexts.storeChanged), the copy of the settings being a secrets root as the settings are. A marked property of a class this method has no empty value for is removed from the copy.

      The two secrets of a push container are emptied by their NAME, marked or not (order 617, MS-D-1): the VAPID private key and the Firebase service account of every PushProps of the copy. The server's own $push may hold them inline and unmarked, as plain strings that nothing else here would recognize.

      A marked PKCS#12 identity WITHOUT a value gets the lone NUL byte in the copy (order 617, MS-D-6): left null it would still be the value it was resolved with, and a later change of the secrets store would be written into the copy (SecretsContexts.storeChanged). An unmarked identity without a value stays null: the secrets store never writes it.

      The values are emptied rather than set to null: the copy travels in a create transaction, and PasswordProp.initializeValue refuses a null value on the receiving side (the property is not nullable), which would dispose of the monitor connection. The description of an identity is kept because PKCS12IdentityProp.getIdentityDescription() requires the NUL byte.

      Parameters:
      cnr - The live container, e.g. the server settings or the server properties.
      Returns:
      The copy without secret values, an orphan.
    • requestServerPlugins

      public void requestServerPlugins()
      Requests the list of plug-ins registered with the server and all the applications it is running.
    • requestBrowsableClients

      public void requestBrowsableClients()
      Request the list of clients that are browsable. The PropMgr owner must be an instance of IVirtualizedMonitor to get the callback when request has completed.
    • onRemoteEvent

      public void onRemoteEvent(RemoteEvent event)
      Processing of remote events.
      Specified by:
      onRemoteEvent in interface IGProp<GProp<?>[]>
      Overrides:
      onRemoteEvent in class GProp<GProp<?>[]>
      Parameters:
      event - The remote event.
    • onEndPointCreated

      public void onEndPointCreated(IEndPoint endPoint)
      Called when an end point is created.
      Specified by:
      onEndPointCreated in interface IEndPointListener
    • onEndPointDisposed

      public void onEndPointDisposed(IEndPoint endPoint)
      Called when an end point is disposed of.
      Specified by:
      onEndPointDisposed in interface IEndPointListener
    • onPropDispose

      protected void onPropDispose()
      Called when a property is disposed of by delete/remove in a container, or by the dispose method.

      This call is done just at the end of the delete/remove routine in the container, without synchronization.

      Overrides:
      onPropDispose in class PropCnr