Class MultiTelemetryBackend

java.lang.Object
org.wpilib.telemetry.MultiTelemetryBackend
All Implemented Interfaces:
AutoCloseable, TelemetryBackend

public class MultiTelemetryBackend extends Object implements TelemetryBackend
A telemetry backend that forwards logged data to multiple child backends.
  • Constructor Details

    • MultiTelemetryBackend

      public MultiTelemetryBackend(TelemetryBackend... backends)
      Constructs a telemetry backend that forwards to multiple child backends.
      Parameters:
      backends - child backends
    • MultiTelemetryBackend

      public MultiTelemetryBackend(Collection<? extends TelemetryBackend> backends)
      Constructs a telemetry backend that forwards to multiple child backends.
      Parameters:
      backends - child backends
  • Method Details

    • ownsBackend

      public boolean ownsBackend(TelemetryBackend backend)
      Description copied from interface: TelemetryBackend
      Returns whether this backend is or owns the given backend instance for lifecycle purposes.

      Composite backends should override this and recursively check child backends that are closed when this backend is closed. The registry uses this to avoid closing a displaced backend that is now retained by another registered backend.

      Specified by:
      ownsBackend in interface TelemetryBackend
      Parameters:
      backend - backend instance
      Returns:
      True if this backend is or owns the given backend
    • sharesBackendWith

      public boolean sharesBackendWith(TelemetryBackend backend)
      Description copied from interface: TelemetryBackend
      Returns whether this backend shares lifecycle ownership with another backend.

      The registry uses this to avoid closing displaced backends whose close operation would close a backend that remains registered elsewhere.

      Specified by:
      sharesBackendWith in interface TelemetryBackend
      Parameters:
      backend - backend instance
      Returns:
      True if this backend owns, is owned by, or shares a child backend with the given backend
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • getEntry

      public TelemetryEntry getEntry(String path)
      Description copied from interface: TelemetryBackend
      Create an entry for the given path.

      Backend implementations must not throw from this method. Recoverable failures should be reported through TelemetryRegistry.reportWarning(String, String) and represented with a discard entry.

      Specified by:
      getEntry in interface TelemetryBackend
      Parameters:
      path - full name
      Returns:
      telemetry entry
    • removeEntry

      public void removeEntry(String path)
      Description copied from interface: TelemetryBackend
      Removes an entry for the given path.

      Backend implementations must not throw from this method.

      Specified by:
      removeEntry in interface TelemetryBackend
      Parameters:
      path - normalized full name