Record Class NetworkEgressPolicy
java.lang.Object
java.lang.Record
org.j7m.middleware.api.isolation.NetworkEgressPolicy
- Record Components:
denyAllByDefault- whether unmatched destinations are deniedallowLoopback- whether loopback destinations are alloweddenyNonLoopback- whether non-loopback destinations are denied before rulesrules- ordered immutable rules
public record NetworkEgressPolicy(boolean denyAllByDefault, boolean allowLoopback, boolean denyNonLoopback, List<NetworkEgressRule> rules)
extends Record
Deterministic network egress policy.
The policy evaluates host/port metadata before J7M-provided network capabilities are used. It is not a kernel firewall and does not intercept arbitrary socket creation by application code.
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkEgressPolicy(boolean denyAllByDefault, boolean allowLoopback, boolean denyNonLoopback, List<NetworkEgressRule> rules) Creates a validated network policy. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowLoopbackrecord component.static NetworkEgressPolicydenyAll()Creates a deny-all network policy.booleanReturns the value of thedenyAllByDefaultrecord component.booleanReturns the value of thedenyNonLoopbackrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.rules()Returns the value of therulesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NetworkEgressPolicy
public NetworkEgressPolicy(boolean denyAllByDefault, boolean allowLoopback, boolean denyNonLoopback, List<NetworkEgressRule> rules) Creates a validated network policy.
-
-
Method Details
-
denyAll
Creates a deny-all network policy.- Returns:
- deny-all policy
-
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. -
denyAllByDefault
public boolean denyAllByDefault()Returns the value of thedenyAllByDefaultrecord component.- Returns:
- the value of the
denyAllByDefaultrecord component
-
allowLoopback
public boolean allowLoopback()Returns the value of theallowLoopbackrecord component.- Returns:
- the value of the
allowLoopbackrecord component
-
denyNonLoopback
public boolean denyNonLoopback()Returns the value of thedenyNonLoopbackrecord component.- Returns:
- the value of the
denyNonLoopbackrecord component
-
rules
-