Class NetworkTraffic

java.lang.Object
security.whisper.javastix.coo.objects.NetworkTraffic
All Implemented Interfaces:
Serializable, BundleableObject, Stix, StixCustomProperties, CyberObservableObject, CyberObservableObjectCommonProperties, NetworkTrafficCoo, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class NetworkTraffic extends Object implements NetworkTrafficCoo
network-traffic

The Network Traffic Object represents arbitrary network traffic that originates from a source and is addressed to a destination.

See Also:
  • Method Details

    • getStart

      @JsonPropertyDescription("Specifies the date/time the network traffic was initiated, if known.") public Optional<StixInstant> getStart()
      Specified by:
      getStart in interface NetworkTrafficCoo
      Returns:
      The value of the start attribute
    • getEnd

      @JsonPropertyDescription("Specifies the date/time the network traffic ended, if known.") public Optional<StixInstant> getEnd()
      Specified by:
      getEnd in interface NetworkTrafficCoo
      Returns:
      The value of the end attribute
    • isActive

      @JsonPropertyDescription("Indicates whether the network traffic is still ongoing.") public Optional<Boolean> isActive()
      Specified by:
      isActive in interface NetworkTrafficCoo
      Returns:
      The value of the isActive attribute
    • getSrcRef

      @JsonPropertyDescription("Specifies the source of the network traffic, as a reference to one or more Observable Objects.") public Optional<String> getSrcRef()
      Specified by:
      getSrcRef in interface NetworkTrafficCoo
      Returns:
      The value of the srcRef attribute
    • getDstRef

      @JsonPropertyDescription("Specifies the destination of the network traffic, as a reference to one or more Observable Objects.") public Optional<String> getDstRef()
      Specified by:
      getDstRef in interface NetworkTrafficCoo
      Returns:
      The value of the dstRef attribute
    • getSrcPort

      @JsonPropertyDescription("Specifies the source port used in the network traffic, as an integer. The port value MUST be in the range of 0 - 65535.") public Optional<Integer> getSrcPort()
      Specified by:
      getSrcPort in interface NetworkTrafficCoo
      Returns:
      The value of the srcPort attribute
    • getDstPort

      @JsonPropertyDescription("Specifies the destination port used in the network traffic, as an integer. The port value MUST be in the range of 0 - 65535.") public Optional<Integer> getDstPort()
      Specified by:
      getDstPort in interface NetworkTrafficCoo
      Returns:
      The value of the dstPort attribute
    • getSrcByteCount

      @JsonPropertyDescription("Specifies the number of bytes sent from the source to the destination.") public Optional<Long> getSrcByteCount()
      Specified by:
      getSrcByteCount in interface NetworkTrafficCoo
      Returns:
      The value of the srcByteCount attribute
    • getDstByteCount

      @JsonPropertyDescription("Specifies the number of bytes sent from the destination to the source.") public Optional<Long> getDstByteCount()
      Specified by:
      getDstByteCount in interface NetworkTrafficCoo
      Returns:
      The value of the dstByteCount attribute
    • getSrcPackets

      @JsonPropertyDescription("Specifies the number of packets sent from the source to the destination.") public Optional<Long> getSrcPackets()
      Specified by:
      getSrcPackets in interface NetworkTrafficCoo
      Returns:
      The value of the srcPackets attribute
    • getDstPackets

      @JsonPropertyDescription("Specifies the number of packets sent destination to the source.") public Optional<Long> getDstPackets()
      Specified by:
      getDstPackets in interface NetworkTrafficCoo
      Returns:
      The value of the dstPackets attribute
    • getIpFix

      @JsonPropertyDescription("Specifies any IP Flow Information Export [IPFIX] data for the traffic, as a dictionary.") public com.google.common.collect.ImmutableMap<String,Object> getIpFix()
      Specified by:
      getIpFix in interface NetworkTrafficCoo
      Returns:
      The value of the ipFix attribute
    • getSrcPayloadRef

      @JsonPropertyDescription("Specifies the bytes sent from the source to the destination.") public Optional<String> getSrcPayloadRef()
      Specified by:
      getSrcPayloadRef in interface NetworkTrafficCoo
      Returns:
      The value of the srcPayloadRef attribute
    • getDstPayloadRef

      @JsonPropertyDescription("Specifies the bytes sent from the source to the destination.") public Optional<String> getDstPayloadRef()
      Specified by:
      getDstPayloadRef in interface NetworkTrafficCoo
      Returns:
      The value of the dstPayloadRef attribute
    • getEncapsulatedByRef

      @JsonPropertyDescription("Links to another network-traffic object which encapsulates this object.") public Optional<String> getEncapsulatedByRef()
      Specified by:
      getEncapsulatedByRef in interface NetworkTrafficCoo
      Returns:
      The value of the encapsulatedByRef attribute
    • getId

      public String getId()
      Deterministically generates the ID for this network traffic based on source/destination references, ports, and protocols.
      Specified by:
      getId in interface BundleableObject
      Specified by:
      getId in interface CyberObservableObjectCommonProperties
      Specified by:
      getId in interface NetworkTrafficCoo
    • getType

      public String getType()
      Specified by:
      getType in interface BundleableObject
      Specified by:
      getType in interface CyberObservableObjectCommonProperties
      Returns:
      The value of the type attribute
    • getExtensions

      @JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public com.google.common.collect.ImmutableSet<CyberObservableExtension> getExtensions()
      Multiple extensions can be added, but only 1 instance of a specific extension can be added.
      Specified by:
      getExtensions in interface CyberObservableObjectCommonProperties
    • getObservableObjectKey

      public String getObservableObjectKey()
      Used for generation of Map Keys by
      invalid reference
      ObservedDataSdo#getObjects()
      Manually set this value if you want to control key names. Otherwise UUIDs will be used.
      Specified by:
      getObservableObjectKey in interface CyberObservableObjectCommonProperties
    • getDefanged

      @JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public Optional<Boolean> getDefanged()
      Indicates whether the data contained in the SCO has been defanged. Defanging refers to the process of modifying data to make it safe to handle (e.g., changing an IP address from 192.168.1.1 to 192[.]168[.]1[.]1).
      Specified by:
      getDefanged in interface CyberObservableObjectCommonProperties
    • 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>
    • getObjectMarkingRefs

      public com.google.common.collect.ImmutableSet<MarkingDefinitionDm> getObjectMarkingRefs()
      Specified by:
      getObjectMarkingRefs in interface BundleableObject
      Returns:
      The value of the objectMarkingRefs attribute
    • getGranularMarkings

      public com.google.common.collect.ImmutableSet<GranularMarkingDm> getGranularMarkings()
      Specified by:
      getGranularMarkings in interface BundleableObject
      Returns:
      The value of the granularMarkings attribute
    • getHydrated

      public boolean getHydrated()
      Specified by:
      getHydrated in interface BundleableObject
      Returns:
      The value of the hydrated attribute
    • toJsonString

      public String toJsonString()
      Specified by:
      toJsonString in interface BundleableObject
      Returns:
      The value of the toJsonString attribute
    • withStart

      public final NetworkTraffic withStart(StixInstant value)
      Copy the current immutable object by setting a present value for the optional start attribute.
      Parameters:
      value - The value for start
      Returns:
      A modified copy of this object
    • withStart

      public final NetworkTraffic withStart(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the start attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for start
      Returns:
      A modified copy of this object
    • withEnd

      public final NetworkTraffic withEnd(StixInstant value)
      Copy the current immutable object by setting a present value for the optional end attribute.
      Parameters:
      value - The value for end
      Returns:
      A modified copy of this object
    • withEnd

      public final NetworkTraffic withEnd(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the end attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for end
      Returns:
      A modified copy of this object
    • withIsActive

      public final NetworkTraffic withIsActive(boolean value)
      Copy the current immutable object by setting a present value for the optional isActive attribute.
      Parameters:
      value - The value for isActive
      Returns:
      A modified copy of this object
    • withIsActive

      public final NetworkTraffic withIsActive(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the isActive 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 isActive
      Returns:
      A modified copy of this object
    • withSrcRef

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

      public final NetworkTraffic withSrcRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the srcRef 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 srcRef
      Returns:
      A modified copy of this object
    • withDstRef

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

      public final NetworkTraffic withDstRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the dstRef 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 dstRef
      Returns:
      A modified copy of this object
    • withSrcPort

      public final NetworkTraffic withSrcPort(int value)
      Copy the current immutable object by setting a present value for the optional srcPort attribute.
      Parameters:
      value - The value for srcPort
      Returns:
      A modified copy of this object
    • withSrcPort

      public final NetworkTraffic withSrcPort(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the srcPort 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 srcPort
      Returns:
      A modified copy of this object
    • withDstPort

      public final NetworkTraffic withDstPort(int value)
      Copy the current immutable object by setting a present value for the optional dstPort attribute.
      Parameters:
      value - The value for dstPort
      Returns:
      A modified copy of this object
    • withDstPort

      public final NetworkTraffic withDstPort(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the dstPort 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 dstPort
      Returns:
      A modified copy of this object
    • withSrcByteCount

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

      public final NetworkTraffic withSrcByteCount(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the srcByteCount 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 srcByteCount
      Returns:
      A modified copy of this object
    • withDstByteCount

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

      public final NetworkTraffic withDstByteCount(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the dstByteCount 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 dstByteCount
      Returns:
      A modified copy of this object
    • withSrcPackets

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

      public final NetworkTraffic withSrcPackets(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the srcPackets 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 srcPackets
      Returns:
      A modified copy of this object
    • withDstPackets

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

      public final NetworkTraffic withDstPackets(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the dstPackets 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 dstPackets
      Returns:
      A modified copy of this object
    • withIpFix

      public final NetworkTraffic withIpFix(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the ipFix 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 ipFix map
      Returns:
      A modified copy of this object
    • withSrcPayloadRef

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

      public final NetworkTraffic withSrcPayloadRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the srcPayloadRef 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 srcPayloadRef
      Returns:
      A modified copy of this object
    • withDstPayloadRef

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

      public final NetworkTraffic withDstPayloadRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the dstPayloadRef 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 dstPayloadRef
      Returns:
      A modified copy of this object
    • withEncapsulatedByRef

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

      public final NetworkTraffic withEncapsulatedByRef(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the encapsulatedByRef 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 encapsulatedByRef
      Returns:
      A modified copy of this object
    • withType

      public final NetworkTraffic 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
    • withExtensions

      public final NetworkTraffic withExtensions(CyberObservableExtension... elements)
      Copy the current immutable object with elements that replace the content of extensions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtensions

      public final NetworkTraffic withExtensions(Iterable<? extends CyberObservableExtension> elements)
      Copy the current immutable object with elements that replace the content of extensions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of extensions elements to set
      Returns:
      A modified copy of this object
    • withObservableObjectKey

      public final NetworkTraffic withObservableObjectKey(String value)
      Copy the current immutable object by setting a value for the observableObjectKey attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for observableObjectKey
      Returns:
      A modified copy of the this object
    • withDefanged

      public final NetworkTraffic withDefanged(boolean value)
      Copy the current immutable object by setting a present value for the optional defanged attribute.
      Parameters:
      value - The value for defanged
      Returns:
      A modified copy of this object
    • withDefanged

      public final NetworkTraffic withDefanged(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the defanged 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 defanged
      Returns:
      A modified copy of this object
    • withCustomProperties

      public final NetworkTraffic 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
    • withObjectMarkingRefs

      public final NetworkTraffic withObjectMarkingRefs(MarkingDefinitionDm... elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withObjectMarkingRefs

      public final NetworkTraffic withObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of objectMarkingRefs elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final NetworkTraffic withGranularMarkings(GranularMarkingDm... elements)
      Copy the current immutable object with elements that replace the content of granularMarkings.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final NetworkTraffic withGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Copy the current immutable object with elements that replace the content of granularMarkings. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of granularMarkings elements to set
      Returns:
      A modified copy of this object
    • withHydrated

      public final NetworkTraffic withHydrated(boolean value)
      Copy the current immutable object by setting a value for the hydrated attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hydrated
      Returns:
      A modified copy of the this object
    • withToJsonString

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of NetworkTraffic 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: start, end, isActive, srcRef, dstRef, srcPort, dstPort, srcByteCount, dstByteCount, srcPackets, dstPackets, ipFix, srcPayloadRef, dstPayloadRef, encapsulatedByRef, id, type, extensions, observableObjectKey, defanged, customProperties, objectMarkingRefs, granularMarkings, hydrated, toJsonString.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static NetworkTraffic copyOf(NetworkTrafficCoo instance)
      Creates an immutable copy of a NetworkTrafficCoo 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 NetworkTraffic instance
    • builder

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