Builder
class Builder
kotlin.Any | |
↳ | android.net.ipsec.ike.TransportModeChildSessionParams.Builder |
This class can be used to incrementally construct a TransportModeChildSessionParams
.
Summary
Public constructors | |
---|---|
Builder() Create a Builder for negotiating a transport mode Child Session. |
|
Builder(childParams: TransportModeChildSessionParams) Construct Builder from the |
Public methods | |
---|---|
TransportModeChildSessionParams.Builder |
addChildSaProposal(proposal: ChildSaProposal) Adds a Child SA proposal to the |
TransportModeChildSessionParams.Builder |
addInboundTrafficSelectors(trafficSelector: IkeTrafficSelector) Adds an inbound |
TransportModeChildSessionParams.Builder |
addOutboundTrafficSelectors(trafficSelector: IkeTrafficSelector) Adds an outbound |
TransportModeChildSessionParams |
build() Validates and builds the |
TransportModeChildSessionParams.Builder |
setLifetimeSeconds(hardLifetimeSeconds: Int, softLifetimeSeconds: Int) Sets hard and soft lifetimes. |
Public constructors
Builder
Builder()
Create a Builder for negotiating a transport mode Child Session.
Builder
Builder(childParams: TransportModeChildSessionParams)
Construct Builder from the TransportModeChildSessionParams
object.
Parameters | |
---|---|
childParams |
TransportModeChildSessionParams: the object this Builder will be constructed with. This value cannot be null . |
Public methods
addChildSaProposal
fun addChildSaProposal(proposal: ChildSaProposal): TransportModeChildSessionParams.Builder
Adds a Child SA proposal to the TransportModeChildSessionParams
being built.
Parameters | |
---|---|
proposal |
ChildSaProposal: Child SA proposal. This value cannot be null . |
Return | |
---|---|
TransportModeChildSessionParams.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
addInboundTrafficSelectors
fun addInboundTrafficSelectors(trafficSelector: IkeTrafficSelector): TransportModeChildSessionParams.Builder
Adds an inbound IkeTrafficSelector
to the TransportModeChildSessionParams
being built.
This method allows callers to limit the inbound traffic transmitted over the Child Session to the given range. The IKE server may further narrow the range. Callers should refer to ChildSessionConfiguration
for the negotiated traffic selectors.
If no inbound IkeTrafficSelector
is provided, a default value will be used that covers all IP addresses and ports.
Parameters | |
---|---|
trafficSelector |
IkeTrafficSelector: the inbound IkeTrafficSelector . This value cannot be null . |
Return | |
---|---|
TransportModeChildSessionParams.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
addOutboundTrafficSelectors
fun addOutboundTrafficSelectors(trafficSelector: IkeTrafficSelector): TransportModeChildSessionParams.Builder
Adds an outbound IkeTrafficSelector
to the TransportModeChildSessionParams
being built.
This method allows callers to limit the outbound traffic transmitted over the Child Session to the given range. The IKE server may further narrow the range. Callers should refer to ChildSessionConfiguration
for the negotiated traffic selectors.
If no outbound IkeTrafficSelector
is provided, a default value will be used that covers all IP addresses and ports.
Parameters | |
---|---|
trafficSelector |
IkeTrafficSelector: the outbound IkeTrafficSelector . This value cannot be null . |
Return | |
---|---|
TransportModeChildSessionParams.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
build
fun build(): TransportModeChildSessionParams
Validates and builds the TransportModeChildSessionParams
.
Return | |
---|---|
TransportModeChildSessionParams |
the validated TransportModeChildSessionParams . This value cannot be null . |
setLifetimeSeconds
fun setLifetimeSeconds(
hardLifetimeSeconds: Int,
softLifetimeSeconds: Int
): TransportModeChildSessionParams.Builder
Sets hard and soft lifetimes.
Lifetimes will not be negotiated with the remote IKE server.
Parameters | |
---|---|
hardLifetimeSeconds |
Int: number of seconds after which Child SA will expire. Defaults to 7200 seconds (2 hours). Considering IPsec packet lifetime, IKE library requires hard lifetime to be a value from 300 seconds (5 minutes) to 14400 seconds (4 hours), inclusive. Value is between CHILD_HARD_LIFETIME_SEC_MINIMUM and CHILD_HARD_LIFETIME_SEC_MAXIMUM inclusive |
softLifetimeSeconds |
Int: number of seconds after which Child SA will request rekey. Defaults to 3600 seconds (1 hour). MUST be at least 120 seconds (2 minutes), and at least 60 seconds (1 minute) shorter than the hard lifetime. Value is between CHILD_SOFT_LIFETIME_SEC_MINIMUM and CHILD_HARD_LIFETIME_SEC_MAXIMUM inclusive |
Return | |
---|---|
TransportModeChildSessionParams.Builder |
This value cannot be null . |