Class NetworkListenerAction
- All Implemented Interfaces:
IListenerAction
,software.amazon.jsii.JsiiSerializable
Some actions can be combined with other ones (specifically, you can perform authentication before serving the request).
Multiple actions form a linked chain; the chain must always terminate in a (weighted)forward, fixedResponse or redirect action.
If an action supports chaining, the next action can be indicated
by passing it in the next
property.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.elasticloadbalancingv2.*; import software.amazon.awscdk.core.*; NetworkTargetGroup networkTargetGroup; NetworkListenerAction networkListenerAction = NetworkListenerAction.forward(List.of(networkTargetGroup), NetworkForwardOptions.builder() .stickinessDuration(Duration.minutes(30)) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IListenerAction
IListenerAction.Jsii$Default, IListenerAction.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
NetworkListenerAction
(CfnListener.ActionProperty actionJson) Create an instance of NetworkListenerAction.protected
NetworkListenerAction
(CfnListener.ActionProperty actionJson, NetworkListenerAction next) Create an instance of NetworkListenerAction.protected
NetworkListenerAction
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
NetworkListenerAction
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(Construct scope, INetworkListener listener) Called when the action is being used in a listener.static NetworkListenerAction
forward
(List<? extends INetworkTargetGroup> targetGroups) Forward to one or more Target Groups.static NetworkListenerAction
forward
(List<? extends INetworkTargetGroup> targetGroups, NetworkForwardOptions options) Forward to one or more Target Groups.protected NetworkListenerAction
getNext()
Render the actions in this chain.protected List<CfnListener.ActionProperty>
renumber
(List<CfnListener.ActionProperty> actions) Renumber the "order" fields in the actions array.static NetworkListenerAction
weightedForward
(List<? extends NetworkWeightedTargetGroup> targetGroups) Forward to one or more Target Groups which are weighted differently.static NetworkListenerAction
weightedForward
(List<? extends NetworkWeightedTargetGroup> targetGroups, NetworkForwardOptions options) Forward to one or more Target Groups which are weighted differently.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
NetworkListenerAction
protected NetworkListenerAction(software.amazon.jsii.JsiiObjectRef objRef) -
NetworkListenerAction
protected NetworkListenerAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NetworkListenerAction
@Stability(Stable) protected NetworkListenerAction(@NotNull CfnListener.ActionProperty actionJson, @Nullable NetworkListenerAction next) Create an instance of NetworkListenerAction.The default class should be good enough for most cases and should be created by using one of the static factory functions, but allow overriding to make sure we allow flexibility for the future.
- Parameters:
actionJson
- This parameter is required.next
-
-
NetworkListenerAction
Create an instance of NetworkListenerAction.The default class should be good enough for most cases and should be created by using one of the static factory functions, but allow overriding to make sure we allow flexibility for the future.
- Parameters:
actionJson
- This parameter is required.
-
-
Method Details
-
forward
@Stability(Stable) @NotNull public static NetworkListenerAction forward(@NotNull List<? extends INetworkTargetGroup> targetGroups, @Nullable NetworkForwardOptions options) Forward to one or more Target Groups.- Parameters:
targetGroups
- This parameter is required.options
-
-
forward
@Stability(Stable) @NotNull public static NetworkListenerAction forward(@NotNull List<? extends INetworkTargetGroup> targetGroups) Forward to one or more Target Groups.- Parameters:
targetGroups
- This parameter is required.
-
weightedForward
@Stability(Stable) @NotNull public static NetworkListenerAction weightedForward(@NotNull List<? extends NetworkWeightedTargetGroup> targetGroups, @Nullable NetworkForwardOptions options) Forward to one or more Target Groups which are weighted differently.- Parameters:
targetGroups
- This parameter is required.options
-
-
weightedForward
@Stability(Stable) @NotNull public static NetworkListenerAction weightedForward(@NotNull List<? extends NetworkWeightedTargetGroup> targetGroups) Forward to one or more Target Groups which are weighted differently.- Parameters:
targetGroups
- This parameter is required.
-
bind
Called when the action is being used in a listener.- Parameters:
scope
- This parameter is required.listener
- This parameter is required.
-
renderActions
Render the actions in this chain.- Specified by:
renderActions
in interfaceIListenerAction
-
renumber
@Stability(Stable) @NotNull protected List<CfnListener.ActionProperty> renumber(@NotNull List<CfnListener.ActionProperty> actions) Renumber the "order" fields in the actions array.We don't number for 0 or 1 elements, but otherwise number them 1...#actions so ELB knows about the right order.
Do this in
NetworkListenerAction
instead of inListener
so that we give users the opportunity to override by subclassing and overridingrenderActions
.- Parameters:
actions
- This parameter is required.
-
getNext
-