Package com.vaadin.observability
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanHandleRequest(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.getConfigProperty(String key) Gets the string value of the provided configuration key name from a callback injected by the Observability agent.getId()Returns the unique ID for the installed handler.booleansynchronizedHandleRequest(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
-
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:
canHandleRequestin classcom.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:
synchronizedHandleRequestin classcom.vaadin.flow.server.SynchronizedRequestHandler- Parameters:
session- the Vaadin sessionrequest- the Vaadin requestresponse- the Vaadin response- Returns:
- true if the request has been handled and should not be processed further.
-
getId
Returns the unique ID for the installed handler.- Returns:
- the unique handler ID
-
getConfigProperty
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
-