Class NetworkSocketExtension

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

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue @AllowedParents(NetworkTrafficCoo.class) public final class NetworkSocketExtension extends Object implements NetworkSocketExtensionExt, Serializable
socket-ext

The Network Socket extension specifies a default extension for capturing network traffic properties associated with network sockets.

See Also:
  • Method Details

    • getAddressFamily

      @JsonPropertyDescription("Specifies the address family (AF_*) that the socket is configured for.") public String getAddressFamily()
      Specified by:
      getAddressFamily in interface NetworkSocketExtensionExt
      Returns:
      The value of the addressFamily attribute
    • getBlocking

      @JsonPropertyDescription("Specifies whether the socket is in blocking mode.") public Optional<Boolean> getBlocking()
      Specified by:
      getBlocking in interface NetworkSocketExtensionExt
      Returns:
      The value of the blocking attribute
    • getListening

      @JsonPropertyDescription("Specifies whether the socket is in listening mode.") public Optional<Boolean> getListening()
      Specified by:
      getListening in interface NetworkSocketExtensionExt
      Returns:
      The value of the listening attribute
    • getProtocolFamily

      @JsonPropertyDescription("Specifies the protocol family (PF_*) that the socket is configured for.") public Optional<String> getProtocolFamily()
      Specified by:
      getProtocolFamily in interface NetworkSocketExtensionExt
      Returns:
      The value of the protocolFamily attribute
    • getOptions

      @JsonPropertyDescription("Specifies any options (SO_*) that may be used by the socket, as a dictionary.") public com.google.common.collect.ImmutableMap<String,String> getOptions()
      Specified by:
      getOptions in interface NetworkSocketExtensionExt
      Returns:
      The value of the options attribute
    • getSocketType

      @JsonPropertyDescription("Specifies the type of the socket.") public Optional<String> getSocketType()
      Specified by:
      getSocketType in interface NetworkSocketExtensionExt
      Returns:
      The value of the socketType attribute
    • getSocketDescriptor

      @JsonPropertyDescription("Specifies the socket file descriptor value associated with the socket, as a non-negative integer.") public Optional<Long> getSocketDescriptor()
      Specified by:
      getSocketDescriptor in interface NetworkSocketExtensionExt
      Returns:
      The value of the socketDescriptor attribute
    • getSocketHandle

      @JsonPropertyDescription("Specifies the handle or inode value associated with the socket.") public Optional<Long> getSocketHandle()
      Specified by:
      getSocketHandle in interface NetworkSocketExtensionExt
      Returns:
      The value of the socketHandle 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>
    • withAddressFamily

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

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

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

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

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

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

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

      public final NetworkSocketExtension withOptions(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the options 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 options map
      Returns:
      A modified copy of this object
    • withSocketType

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

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

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

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

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

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

      public final NetworkSocketExtension 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 NetworkSocketExtension 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 NetworkSocketExtension 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: addressFamily, blocking, listening, protocolFamily, options, socketType, socketDescriptor, socketHandle, type, customProperties.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

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