Class HttpRequestExtension

java.lang.Object
security.whisper.javastix.coo.extension.types.HttpRequestExtension
All Implemented Interfaces:
Serializable, StixCustomProperties, CyberObservableExtension, CyberObservableExtensionCommonProperties, HttpRequestExtensionExt, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue @AllowedParents(NetworkTrafficCoo.class) public final class HttpRequestExtension extends Object implements HttpRequestExtensionExt, Serializable
http-request-ext

The HTTP request extension specifies a default extension for capturing network traffic properties specific to HTTP requests.

See Also:
  • Method Details

    • getRequestMethod

      @JsonPropertyDescription("Specifies the HTTP method portion of the HTTP request line, as a lowercase string.") public String getRequestMethod()
      Specified by:
      getRequestMethod in interface HttpRequestExtensionExt
      Returns:
      The value of the requestMethod attribute
    • getRequestValue

      @JsonPropertyDescription("Specifies the value (typically a resource path) portion of the HTTP request line.") public String getRequestValue()
      Specified by:
      getRequestValue in interface HttpRequestExtensionExt
      Returns:
      The value of the requestValue attribute
    • getRequestVersion

      @JsonPropertyDescription("Specifies the HTTP version portion of the HTTP request line, as a lowercase string.") public Optional<String> getRequestVersion()
      Specified by:
      getRequestVersion in interface HttpRequestExtensionExt
      Returns:
      The value of the requestVersion attribute
    • getRequestHeader

      @JsonPropertyDescription("Specifies all of the HTTP header fields that may be found in the HTTP client request, as a dictionary.") public com.google.common.collect.ImmutableMap<String,String> getRequestHeader()
      Currently only supports non-duplicate keys: https://github.com/oasis-tcs/cti-stix2/issues/137
      Specified by:
      getRequestHeader in interface HttpRequestExtensionExt
    • getMessageBodyLength

      @JsonPropertyDescription("Specifies the length of the HTTP message body, if included, in bytes.") public Optional<Long> getMessageBodyLength()
      Specified by:
      getMessageBodyLength in interface HttpRequestExtensionExt
      Returns:
      The value of the messageBodyLength attribute
    • getMessageBodyDataRef

      @JsonPropertyDescription("Specifies the data contained in the HTTP message body, if included.") public Optional<String> getMessageBodyDataRef()
      Specified by:
      getMessageBodyDataRef in interface HttpRequestExtensionExt
      Returns:
      The value of the messageBodyDataRef attribute
    • getType

      public String getType()
      This property is used for generation of the dictionary during serialization, and used as the "Type" mapping value for polymorphic when deserializing.
      Specified by:
      getType in interface CyberObservableExtensionCommonProperties
    • getCustomProperties

      public com.google.common.collect.ImmutableMap<String,Object> getCustomProperties()
      Custom Properties for STIX Objects. Any object that supports custom properties will have a validation of the custom property prefix (typically "x_"). If the additional property in the JSON does not meet the StartsWith condition, then the JSON will be rejected.
      Specified by:
      getCustomProperties in interface StixCustomProperties
      Returns:
      Map of custom properties Map<String, Object>
    • withRequestMethod

      public final HttpRequestExtension withRequestMethod(String value)
      Copy the current immutable object by setting a value for the requestMethod attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for requestMethod (can be null)
      Returns:
      A modified copy of the this object
    • withRequestValue

      public final HttpRequestExtension withRequestValue(String value)
      Copy the current immutable object by setting a value for the requestValue attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for requestValue (can be null)
      Returns:
      A modified copy of the this object
    • withRequestVersion

      public final HttpRequestExtension withRequestVersion(String value)
      Copy the current immutable object by setting a present value for the optional requestVersion attribute.
      Parameters:
      value - The value for requestVersion
      Returns:
      A modified copy of this object
    • withRequestVersion

      public final HttpRequestExtension withRequestVersion(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the requestVersion attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for requestVersion
      Returns:
      A modified copy of this object
    • withRequestHeader

      public final HttpRequestExtension withRequestHeader(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the requestHeader map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the requestHeader map
      Returns:
      A modified copy of this object
    • withMessageBodyLength

      public final HttpRequestExtension withMessageBodyLength(long value)
      Copy the current immutable object by setting a present value for the optional messageBodyLength attribute.
      Parameters:
      value - The value for messageBodyLength
      Returns:
      A modified copy of this object
    • withMessageBodyLength

      public final HttpRequestExtension withMessageBodyLength(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the messageBodyLength attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for messageBodyLength
      Returns:
      A modified copy of this object
    • withMessageBodyDataRef

      public final HttpRequestExtension withMessageBodyDataRef(String value)
      Copy the current immutable object by setting a present value for the optional messageBodyDataRef attribute.
      Parameters:
      value - The value for messageBodyDataRef
      Returns:
      A modified copy of this object
    • withMessageBodyDataRef

      public final HttpRequestExtension withMessageBodyDataRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the messageBodyDataRef attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for messageBodyDataRef
      Returns:
      A modified copy of this object
    • withType

      public final HttpRequestExtension withType(String value)
      Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type (can be null)
      Returns:
      A modified copy of the this object
    • withCustomProperties

      public final HttpRequestExtension withCustomProperties(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the customProperties map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the customProperties map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of HttpRequestExtension that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: requestMethod, requestValue, requestVersion, requestHeader, messageBodyLength, messageBodyDataRef, type, customProperties.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value HttpRequestExtension with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static HttpRequestExtension copyOf(HttpRequestExtensionExt instance)
      Creates an immutable copy of a HttpRequestExtensionExt value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable HttpRequestExtension instance
    • builder

      public static HttpRequestExtension.Builder builder()
      Creates a builder for HttpRequestExtension.
      Returns:
      A new HttpRequestExtension builder