Record Class ApplicationSpec.OptionalPort
java.lang.Object
java.lang.Record
com.cloudforge.core.interfaces.ApplicationSpec.OptionalPort
- Record Components:
port- The port numberprotocol- The protocol ("tcp" or "udp")configKey- The DeploymentContext key to enable this port (e.g., "enableSmtp")service- Human-readable service name for logging/promptsinbound- true if port accepts inbound connections (requires security group rule), false if outbound only (container connects out, no SG rule needed)
- Enclosing interface:
ApplicationSpec
public static record ApplicationSpec.OptionalPort(int port, String protocol, String configKey, String service, boolean inbound)
extends Record
Optional service port that can be enabled via deployment configuration.
Ports are NOT exposed by default - must be explicitly enabled via the configKey in deployment configuration. This follows the principle of least privilege.
-
Constructor Summary
ConstructorsConstructorDescriptionOptionalPort(int port, String protocol, String configKey, String service, boolean inbound) Creates an instance of aOptionalPortrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfigKeyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninbound()Returns the value of theinboundrecord component.static ApplicationSpec.OptionalPortinboundTcp(int port, String configKey, String service) Convenience constructor for inbound TCP ports.static ApplicationSpec.OptionalPortoutboundTcp(int port, String configKey, String service) Convenience constructor for outbound TCP ports (no security group rule needed).intport()Returns the value of theportrecord component.protocol()Returns the value of theprotocolrecord component.service()Returns the value of theservicerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OptionalPort
Creates an instance of aOptionalPortrecord class.
-
-
Method Details
-
inboundTcp
Convenience constructor for inbound TCP ports.- Parameters:
port- the port numberconfigKey- the deployment config key to enable this portservice- the service name using this port- Returns:
- an OptionalPort configured for inbound TCP
-
outboundTcp
Convenience constructor for outbound TCP ports (no security group rule needed).- Parameters:
port- the port numberconfigKey- the deployment config key to enable this portservice- the service name using this port- Returns:
- an OptionalPort configured for outbound TCP
-
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. -
port
-
protocol
-
configKey
-
service
-
inbound
-