What to do when a client makes a request to a listener.
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
new NetworkListenerAction(actionJson: ActionProperty, 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.
|bind(scope, listener)||Called when the action is being used in a listener.|
|render||Render the actions in this chain.|
|protected renumber(actions)||Renumber the "order" fields in the actions array.|
|static forward(targetGroups, options?)||Forward to one or more Target Groups.|
|static weighted||Forward to one or more Target Groups which are weighted differently.|
public bind(scope: Construct, listener: INetworkListener): void
Called when the action is being used in a listener.
public renderActions(): ActionProperty
Render the actions in this chain.
protected renumber(actions: ActionProperty): ActionProperty
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 in
Listener so that we give
users the opportunity to override by subclassing and overriding
static forward(targetGroups, options?)
public static forward(targetGroups: INetworkTargetGroup, options?: NetworkForwardOptions): NetworkListenerAction
Forward to one or more Target Groups.
public static weightedForward(targetGroups: NetworkWeightedTargetGroup, options?: NetworkForwardOptions): NetworkListenerAction
Forward to one or more Target Groups which are weighted differently.