Class ObservabilityHandler

java.lang.Object
com.vaadin.flow.server.SynchronizedRequestHandler
com.vaadin.observability.ObservabilityHandler
All Implemented Interfaces:
com.vaadin.flow.server.RequestHandler, Serializable

public class ObservabilityHandler extends com.vaadin.flow.server.SynchronizedRequestHandler
This class handles Observability messages, which consist of JSON representations of Frontend Observability traces.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.flow.server.SynchronizedRequestHandler

    com.vaadin.flow.server.SynchronizedRequestHandler.ResponseWriter
  • Field Summary

    Fields inherited from class com.vaadin.flow.server.SynchronizedRequestHandler

    MAX_BUFFER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    canHandleRequest(com.vaadin.flow.server.VaadinRequest request)
    Returns whether the provided request conforms to a Frontend Observability message and that the associated ID matches the handler ID.
    Gets the string value of the provided configuration key name from a callback injected by the Observability agent.
    Returns the unique ID for the installed handler.
    boolean
    synchronizedHandleRequest(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response)
    Handles a Frontend Observability message within a request.

    Methods inherited from class com.vaadin.flow.server.SynchronizedRequestHandler

    getRequestBody, handleRequest, isReadAndWriteOutsideSessionLock, synchronizedHandleRequest

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ObservabilityHandler

      public ObservabilityHandler()
  • Method Details

    • canHandleRequest

      protected boolean canHandleRequest(com.vaadin.flow.server.VaadinRequest request)
      Returns whether the provided request conforms to a Frontend Observability message and that the associated ID matches the handler ID.
      Overrides:
      canHandleRequest in class com.vaadin.flow.server.SynchronizedRequestHandler
      Parameters:
      request - the Vaadin request
      Returns:
      true if the request can be handled
    • synchronizedHandleRequest

      public boolean synchronizedHandleRequest(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response)
      Handles a Frontend Observability message within a request. The incoming JSON string is mapped to a hierarchical map of native Java objects and sent to a callback injected by the Observability agent.
      Specified by:
      synchronizedHandleRequest in class com.vaadin.flow.server.SynchronizedRequestHandler
      Parameters:
      session - the Vaadin session
      request - the Vaadin request
      response - the Vaadin response
      Returns:
      true if the request has been handled and should not be processed further.
    • getId

      public String getId()
      Returns the unique ID for the installed handler.
      Returns:
      the unique handler ID
    • getConfigProperty

      public String getConfigProperty(String key)
      Gets the string value of the provided configuration key name from a callback injected by the Observability agent.
      Parameters:
      key - the configuration key name
      Returns:
      the string value of the key