Record Class NetworkCaptureOptions
java.lang.Object
java.lang.Record
com.shaft.capture.network.NetworkCaptureOptions
- Record Components:
includeAssetTypes- whether stylesheet/script/image/font/media requests are recordedurlIncludeGlobs- URL glob patterns; when non-empty, only matching URLs are recordedurlExcludeGlobs- URL glob patterns excluded even when an include glob also matchesfirstPartyOnly- whether only same-origin (relative to the initiator page) requests are recordedmaxTransactions- maximum number of transactions recorded per sessionmaxBodyBytes- maximum number of body bytes persisted per request/response;<= 0means unlimitedcaptureRequestBodies- whether request bodies are persisted at all;falserecords the transaction (method/URL/headers/status) with no requestBodyRefcaptureResponseBodies- whether response bodies are persisted at all;falserecords the transaction with no responseBodyRef
public record NetworkCaptureOptions(boolean includeAssetTypes, List<String> urlIncludeGlobs, List<String> urlExcludeGlobs, boolean firstPartyOnly, int maxTransactions, long maxBodyBytes, boolean captureRequestBodies, boolean captureResponseBodies)
extends Record
Options controlling
CaptureNetworkRecorder filtering and body-capture behavior.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault maximum number of persisted body bytes per request/response.static final intDefault maximum number of recorded transactions per session. -
Constructor Summary
ConstructorsConstructorDescriptionNetworkCaptureOptions(boolean includeAssetTypes, List<String> urlIncludeGlobs, List<String> urlExcludeGlobs, boolean firstPartyOnly, int maxTransactions, long maxBodyBytes) Compatibility constructor for callers that predatecaptureRequestBodies/captureResponseBodies(issue #4057): preserves the original unconditional body-capture behavior (subject tomaxBodyBytestruncation) by defaulting both new flags totrue.NetworkCaptureOptions(boolean includeAssetTypes, List<String> urlIncludeGlobs, List<String> urlExcludeGlobs, boolean firstPartyOnly, int maxTransactions, long maxBodyBytes, boolean captureRequestBodies, boolean captureResponseBodies) Creates normalized, validated network capture options. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecaptureRequestBodiesrecord component.booleanReturns the value of thecaptureResponseBodiesrecord component.static NetworkCaptureOptionsdefaults()Returns default network capture options: no asset types, no glob filters, first-party only, capped at 500 transactions.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thefirstPartyOnlyrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincludeAssetTypesrecord component.longReturns the value of themaxBodyBytesrecord component.intReturns the value of themaxTransactionsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theurlExcludeGlobsrecord component.Returns the value of theurlIncludeGlobsrecord component.
-
Field Details
-
DEFAULT_MAX_TRANSACTIONS
public static final int DEFAULT_MAX_TRANSACTIONSDefault maximum number of recorded transactions per session.- See Also:
-
DEFAULT_MAX_BODY_BYTES
public static final long DEFAULT_MAX_BODY_BYTESDefault maximum number of persisted body bytes per request/response.- See Also:
-
-
Constructor Details
-
NetworkCaptureOptions
-
NetworkCaptureOptions
public NetworkCaptureOptions(boolean includeAssetTypes, List<String> urlIncludeGlobs, List<String> urlExcludeGlobs, boolean firstPartyOnly, int maxTransactions, long maxBodyBytes) Compatibility constructor for callers that predatecaptureRequestBodies/captureResponseBodies(issue #4057): preserves the original unconditional body-capture behavior (subject tomaxBodyBytestruncation) by defaulting both new flags totrue.- Parameters:
includeAssetTypes- whether stylesheet/script/image/font/media requests are recordedurlIncludeGlobs- URL glob patterns; when non-empty, only matching URLs are recordedurlExcludeGlobs- URL glob patterns excluded even when an include glob also matchesfirstPartyOnly- whether only same-origin (relative to the initiator page) requests are recordedmaxTransactions- maximum number of transactions recorded per sessionmaxBodyBytes- maximum number of body bytes persisted per request/response;<= 0means unlimited
-
-
Method Details
-
defaults
Returns default network capture options: no asset types, no glob filters, first-party only, capped at 500 transactions.- Returns:
- default network capture options
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
includeAssetTypes
public boolean includeAssetTypes()Returns the value of theincludeAssetTypesrecord component.- Returns:
- the value of the
includeAssetTypesrecord component
-
urlIncludeGlobs
Returns the value of theurlIncludeGlobsrecord component.- Returns:
- the value of the
urlIncludeGlobsrecord component
-
urlExcludeGlobs
Returns the value of theurlExcludeGlobsrecord component.- Returns:
- the value of the
urlExcludeGlobsrecord component
-
firstPartyOnly
public boolean firstPartyOnly()Returns the value of thefirstPartyOnlyrecord component.- Returns:
- the value of the
firstPartyOnlyrecord component
-
maxTransactions
public int maxTransactions()Returns the value of themaxTransactionsrecord component.- Returns:
- the value of the
maxTransactionsrecord component
-
maxBodyBytes
public long maxBodyBytes()Returns the value of themaxBodyBytesrecord component.- Returns:
- the value of the
maxBodyBytesrecord component
-
captureRequestBodies
public boolean captureRequestBodies()Returns the value of thecaptureRequestBodiesrecord component.- Returns:
- the value of the
captureRequestBodiesrecord component
-
captureResponseBodies
public boolean captureResponseBodies()Returns the value of thecaptureResponseBodiesrecord component.- Returns:
- the value of the
captureResponseBodiesrecord component
-