Enum NullWebRequestTracer
- java.lang.Object
-
- java.lang.Enum<NullWebRequestTracer>
-
- com.dynatrace.openkit.core.objects.NullWebRequestTracer
-
- All Implemented Interfaces:
WebRequestTracer,java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,java.lang.Comparable<NullWebRequestTracer>
public enum NullWebRequestTracer extends java.lang.Enum<NullWebRequestTracer> implements WebRequestTracer
This implementation ofWebRequestTraceris returned byAction.traceWebRequest(String)orAction.traceWebRequest(java.net.URLConnection)when theAction.leaveAction()()} has been called before.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe soleNullWebRequestTracerinstance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringgetTag()Returns the Dynatrace tag which has to be set manually as Dynatrace HTTP header (OpenKitConstants.WEBREQUEST_TAG_HEADER).WebRequestTracersetBytesReceived(int bytesReceived)Sets the amount of received data of this web request.WebRequestTracersetBytesReceived(long bytesReceived)Sets the amount of received data of this web request.WebRequestTracersetBytesSent(int bytesSent)Sets the amount of sent data of this web request.WebRequestTracersetBytesSent(long bytesSent)Sets the amount of sent data of this web request.WebRequestTracerstart()Starts the web request timing.voidstop(int respondeCode)Stops the web request timing with the given response code.static NullWebRequestTracervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static NullWebRequestTracer[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NullWebRequestTracer INSTANCE
The soleNullWebRequestTracerinstance
-
-
Method Detail
-
values
public static NullWebRequestTracer[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NullWebRequestTracer c : NullWebRequestTracer.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NullWebRequestTracer valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getTag
public java.lang.String getTag()
Description copied from interface:WebRequestTracerReturns the Dynatrace tag which has to be set manually as Dynatrace HTTP header (OpenKitConstants.WEBREQUEST_TAG_HEADER).
This is only necessary for tracing web requests via 3rd party HTTP clients.- Specified by:
getTagin interfaceWebRequestTracer- Returns:
- the Dynatrace tag to be set as HTTP header value or an empty String if capture is off
-
setBytesSent
public WebRequestTracer setBytesSent(int bytesSent)
Description copied from interface:WebRequestTracerSets the amount of sent data of this web request. Has to be called beforeWebRequestTracer.stop(int).- Specified by:
setBytesSentin interfaceWebRequestTracer- Parameters:
bytesSent- number of bytes
-
setBytesSent
public WebRequestTracer setBytesSent(long bytesSent)
Description copied from interface:WebRequestTracerSets the amount of sent data of this web request. Has to be called beforeWebRequestTracer.stop(int).- Specified by:
setBytesSentin interfaceWebRequestTracer- Parameters:
bytesSent- number of bytes
-
setBytesReceived
public WebRequestTracer setBytesReceived(int bytesReceived)
Description copied from interface:WebRequestTracerSets the amount of received data of this web request. Has to be called beforeWebRequestTracer.stop(int).- Specified by:
setBytesReceivedin interfaceWebRequestTracer- Parameters:
bytesReceived- number of bytes
-
setBytesReceived
public WebRequestTracer setBytesReceived(long bytesReceived)
Description copied from interface:WebRequestTracerSets the amount of received data of this web request. Has to be called beforeWebRequestTracer.stop(int).- Specified by:
setBytesReceivedin interfaceWebRequestTracer- Parameters:
bytesReceived- number of bytes
-
start
public WebRequestTracer start()
Description copied from interface:WebRequestTracerStarts the web request timing. Should be called when the web request is initiated.- Specified by:
startin interfaceWebRequestTracer
-
stop
public void stop(int respondeCode)
Description copied from interface:WebRequestTracerStops the web request timing with the given response code. Should be called when the web request is finished.- Specified by:
stopin interfaceWebRequestTracer- Parameters:
respondeCode- response code of this web request
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-