Package com.tccc.kos.commons.util
Interface Tracker
public interface Tracker
Interface for objects that provide a tracker property. Tracker values,
or "cookies", are generally provided by external clients and returned
in response payloads, particularly websocket events. This provides an
easy way for external clients to correlate asynchronous data with requests.
Since trackers are provided by external clients, they should be restricted to MAX_TRACKER_LEN (256 characters).
- Since:
- 1.0
- Version:
- 2022-10-24
-
Method Summary
Modifier and TypeMethodDescriptionvoid
_setTracker
(String tracker) Sets the tracker value with no restrictions.Returns the tracker value.default void
setTracker
(String tracker) Default implementation ofsetTracker()
.
-
Method Details
-
getTracker
String getTracker()Returns the tracker value. -
_setTracker
Sets the tracker value with no restrictions. This is called fromsetTracker()
.- Parameters:
tracker
- the tracker string
-
setTracker
Default implementation ofsetTracker()
. It restricts the length of the tracker string toMAX_TRACKER_LEN
, since it comes from an external client. It then calls_setTracker()
with the final tracker value.- Parameters:
tracker
- the raw/unrestricted tracker string
-