Class TraceProxy
- java.lang.Object
-
- org.hansken.plugin.extraction.runtime.grpc.server.proxy.ImmutableTraceProxy
-
- org.hansken.plugin.extraction.runtime.grpc.server.proxy.TraceProxy
-
- All Implemented Interfaces:
AutoCloseable,ImmutableTrace,Trace
public final class TraceProxy extends ImmutableTraceProxy implements Trace, AutoCloseable
Proxy implementation for the server side of theextraction pluginframework. It delegates calls through gRPC (seeGrpcFacade) to the trace currently being processed on the client side.Note: this implementation is not thread-safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hansken.plugin.extraction.api.Trace
Trace.Tracelet, Trace.TraceletBuilder, Trace.TraceletProperty
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TraceaddTracelet(Trace.Tracelet tracelet)TraceaddType(String type)voidclose()static TraceProxyfromRpc(RpcTrace trace, GrpcFacade facade)Create a newtrace proxyfor thetracecurrently being processed, which is described by givenRpcTrace.<T> Tget(String name)TracenewChild(String name, ThrowingConsumer<Trace,IOException> enrichChildCallback)Set<String>properties()Traceset(String name, Object value)TracesetData(String dataType, List<DataTransformation> transformations)TracesetData(String dataType, DataWriter writer)Set<String>types()-
Methods inherited from class org.hansken.plugin.extraction.runtime.grpc.server.proxy.ImmutableTraceProxy
traceId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hansken.plugin.extraction.api.ImmutableTrace
traceId
-
Methods inherited from interface org.hansken.plugin.extraction.api.Trace
addTracelet, setData, setData
-
-
-
-
Method Detail
-
fromRpc
public static TraceProxy fromRpc(RpcTrace trace, GrpcFacade facade)
Create a newtrace proxyfor thetracecurrently being processed, which is described by givenRpcTrace. Calls to this proxy are delegated using the givenGrpcFacade.- Parameters:
trace- metadata of the trace currently being processed, such as the types and propertiesfacade- the facade to delegate calls to- Returns:
- the trace proxy
-
types
public Set<String> types()
- Specified by:
typesin interfaceImmutableTrace- Overrides:
typesin classImmutableTraceProxy
-
properties
public Set<String> properties()
- Specified by:
propertiesin interfaceImmutableTrace- Overrides:
propertiesin classImmutableTraceProxy
-
get
public <T> T get(String name)
- Specified by:
getin interfaceImmutableTrace- Overrides:
getin classImmutableTraceProxy
-
addTracelet
public Trace addTracelet(Trace.Tracelet tracelet)
- Specified by:
addTraceletin interfaceTrace
-
setData
public Trace setData(String dataType, DataWriter writer) throws IOException
- Specified by:
setDatain interfaceTrace- Throws:
IOException
-
setData
public Trace setData(String dataType, List<DataTransformation> transformations)
-
newChild
public Trace newChild(String name, ThrowingConsumer<Trace,IOException> enrichChildCallback) throws IOException
- Specified by:
newChildin interfaceTrace- Throws:
IOException
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-