-
public final class EmbraceNetworkRequestThis class is used to create manually-recorded network requests.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringurlprivate final LongstartTimeprivate final LongendTimeprivate final LongbytesReceivedprivate final LongbytesSentprivate final IntegerresponseCodeprivate final Throwableerrorprivate final StringerrorTypeprivate final StringerrorMessageprivate final StringtraceIdprivate final Stringw3cTraceparentprivate final NetworkCaptureDatanetworkCaptureData
-
Method Summary
Modifier and Type Method Description StringgetUrl()LonggetStartTime()LonggetEndTime()LonggetBytesReceived()LonggetBytesSent()IntegergetResponseCode()ThrowablegetError()StringgetErrorType()StringgetErrorMessage()StringgetTraceId()StringgetW3cTraceparent()NetworkCaptureDatagetNetworkCaptureData()static EmbraceNetworkRequestfromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode)Construct a new EmbraceNetworkRequest instance where a HTTP response was returned. static EmbraceNetworkRequestfromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId)Construct a new EmbraceNetworkRequest instance where a HTTP response was returned. static EmbraceNetworkRequestfromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId, @Nullable() NetworkCaptureData networkCaptureData)Construct a new EmbraceNetworkRequest instance where a HTTP response was returned. static EmbraceNetworkRequestfromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId, @Nullable() String w3cTraceparent, @Nullable() NetworkCaptureData networkCaptureData)Construct a new EmbraceNetworkRequest instance where a HTTP response was returned. static EmbraceNetworkRequestfromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage)Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned. static EmbraceNetworkRequestfromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId)Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned. static EmbraceNetworkRequestfromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId, @Nullable() NetworkCaptureData networkCaptureData)Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned. static EmbraceNetworkRequestfromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId, @Nullable() String w3cTraceparent, @Nullable() NetworkCaptureData networkCaptureData)Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned. LonggetBytesIn()LonggetBytesOut()-
-
Method Detail
-
getStartTime
@NonNull() Long getStartTime()
-
getEndTime
@NonNull() Long getEndTime()
-
getBytesReceived
@Nullable() Long getBytesReceived()
-
getBytesSent
@Nullable() Long getBytesSent()
-
getResponseCode
@Nullable() Integer getResponseCode()
-
getErrorType
@Nullable() String getErrorType()
-
getErrorMessage
@Nullable() String getErrorMessage()
-
getTraceId
@Nullable() String getTraceId()
-
getW3cTraceparent
@Nullable() String getW3cTraceparent()
-
getNetworkCaptureData
@Nullable() NetworkCaptureData getNetworkCaptureData()
-
fromCompletedRequest
@NonNull() static EmbraceNetworkRequest fromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode)
Construct a new EmbraceNetworkRequest instance where a HTTP response was returned.If no response was returned, use fromIncompleteRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.bytesSent- the number of bytes sent.bytesReceived- the number of bytes received.statusCode- the status code of the response.
-
fromCompletedRequest
@NonNull() static EmbraceNetworkRequest fromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId)
Construct a new EmbraceNetworkRequest instance where a HTTP response was returned.If no response was returned, use fromIncompleteRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.bytesSent- the number of bytes sent.bytesReceived- the number of bytes received.statusCode- the status code of the response.traceId- the trace ID of the request, used for distributed tracing.
-
fromCompletedRequest
@NonNull() static EmbraceNetworkRequest fromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId, @Nullable() NetworkCaptureData networkCaptureData)
Construct a new EmbraceNetworkRequest instance where a HTTP response was returned.If no response was returned, use fromIncompleteRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.bytesSent- the number of bytes sent.bytesReceived- the number of bytes received.statusCode- the status code of the response.traceId- the trace ID of the request, used for distributed tracing.networkCaptureData- the network capture data for the request.
-
fromCompletedRequest
@NonNull() static EmbraceNetworkRequest fromCompletedRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, long bytesSent, long bytesReceived, int statusCode, @Nullable() String traceId, @Nullable() String w3cTraceparent, @Nullable() NetworkCaptureData networkCaptureData)
Construct a new EmbraceNetworkRequest instance where a HTTP response was returned.If no response was returned, use fromIncompleteRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.bytesSent- the number of bytes sent.bytesReceived- the number of bytes received.statusCode- the status code of the response.traceId- the trace ID of the request, used for distributed tracing.w3cTraceparent- W3C-compliant traceparent representing the network call that is being recordednetworkCaptureData- the network capture data for the request.
-
fromIncompleteRequest
@NonNull() static EmbraceNetworkRequest fromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage)
Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned.If a response was returned, use fromCompletedRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.errorType- the error type that occurred.errorMessage- the error message
-
fromIncompleteRequest
@NonNull() static EmbraceNetworkRequest fromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId)
Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned.If a response was returned, use fromCompletedRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.errorType- the error type that occurred.errorMessage- the error messagetraceId- the trace ID of the request, used for distributed tracing.
-
fromIncompleteRequest
@NonNull() static EmbraceNetworkRequest fromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId, @Nullable() NetworkCaptureData networkCaptureData)
Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned.If a response was returned, use fromCompletedRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.errorType- the error type that occurred.errorMessage- the error messagetraceId- the trace ID of the request, used for distributed tracing.networkCaptureData- the network capture data for the request.
-
fromIncompleteRequest
@NonNull() static EmbraceNetworkRequest fromIncompleteRequest(@NonNull() String url, @NonNull() HttpMethod httpMethod, long startTime, long endTime, @NonNull() String errorType, @NonNull() String errorMessage, @Nullable() String traceId, @Nullable() String w3cTraceparent, @Nullable() NetworkCaptureData networkCaptureData)
Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned.If a response was returned, use fromCompletedRequest instead.
- Parameters:
url- the URL of the request.httpMethod- the HTTP method of the request.startTime- the start time of the request.endTime- the end time of the request.errorType- the error type that occurred.errorMessage- the error messagetraceId- the trace ID of the request, used for distributed tracing.w3cTraceparent- W3C-compliant traceparent representing the network call that is being recordednetworkCaptureData- the network capture data for the request.
-
getBytesIn
@NonNull() Long getBytesIn()
-
getBytesOut
@NonNull() Long getBytesOut()
-
-
-
-