Class ClusteredRequestTraceStore
- java.lang.Object
-
- fish.payara.nucleus.requesttracing.store.ClusteredRequestTraceStore
-
- All Implemented Interfaces:
RequestTraceStoreInterface,Serializable
public class ClusteredRequestTraceStore extends Object implements RequestTraceStoreInterface, Serializable
A store ofRequestTraceobjects. Stores the list across a cluster.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestTraceaddTrace(RequestTrace trace)Adds a request trace to the store.RequestTraceaddTrace(RequestTrace trace, RequestTrace traceToRemove)Adds a request trace to the store, removing the specified trace if present and necessary.Collection<RequestTrace>emptyStore()Removes all of the traces from the store.intgetStoreSize()Gets the current size of the store.Collection<RequestTrace>getTraces()Gets the entire contents of the store.Collection<RequestTrace>getTraces(int limit)Gets the contents of the store, up to a limit number of items.booleanisShared()voidsetSize(IntSupplier maxSize)Sets the supplier for the maximum size of the store.
-
-
-
Method Detail
-
addTrace
public RequestTrace addTrace(RequestTrace trace)
Description copied from interface:RequestTraceStoreInterfaceAdds a request trace to the store.- Specified by:
addTracein interfaceRequestTraceStoreInterface- Parameters:
trace- the trace to add.- Returns:
- The trace that was removed, or null if no trace was removed
-
addTrace
public RequestTrace addTrace(RequestTrace trace, RequestTrace traceToRemove)
Description copied from interface:RequestTraceStoreInterfaceAdds a request trace to the store, removing the specified trace if present and necessary.- Specified by:
addTracein interfaceRequestTraceStoreInterface- Parameters:
trace- The trace to addtraceToRemove- The trace to remove if present- Returns:
- The trace that was removed, or null if no trace was removed
-
getTraces
public Collection<RequestTrace> getTraces()
Description copied from interface:RequestTraceStoreInterfaceGets the entire contents of the store.- Specified by:
getTracesin interfaceRequestTraceStoreInterface- Returns:
- every request trace in the store.
-
getTraces
public Collection<RequestTrace> getTraces(int limit)
Description copied from interface:RequestTraceStoreInterfaceGets the contents of the store, up to a limit number of items.- Specified by:
getTracesin interfaceRequestTraceStoreInterface- Parameters:
limit- the maximum number of traces to return.- Returns:
- up to the limit number of items from the store.
-
setSize
public void setSize(IntSupplier maxSize)
Description copied from interface:RequestTraceStoreInterfaceSets the supplier for the maximum size of the store. Any traces added after this size will cause another to be removed. The trace removed depends on the store implementation.- Specified by:
setSizein interfaceRequestTraceStoreInterface- Parameters:
maxSize- A supplier for the maximum size of the store.
-
getStoreSize
public int getStoreSize()
Description copied from interface:RequestTraceStoreInterfaceGets the current size of the store.- Specified by:
getStoreSizein interfaceRequestTraceStoreInterface- Returns:
- the size of the store.
-
emptyStore
public Collection<RequestTrace> emptyStore()
Description copied from interface:RequestTraceStoreInterfaceRemoves all of the traces from the store. The store will be empty after this method is called.- Specified by:
emptyStorein interfaceRequestTraceStoreInterface- Returns:
- The traces that were stored
-
isShared
public boolean isShared()
- Specified by:
isSharedin interfaceRequestTraceStoreInterface- Returns:
- true in case of a clustered store, false in case of a local store.
-
-