Stay organized with collections
Save and categorize content based on your preferences.
IkeSessionCallback
interface IkeSessionCallback
Callback interface for receiving state changes of an IkeSession
.
IkeSessionCallback
MUST be unique to each IkeSession
. It is registered when callers are requesting a new IkeSession
. It is automatically unregistered when an IkeSession
is closed.
Summary
Public methods
onClosedWithException
open fun onClosedWithException(exception: IkeException): Unit
Called if IkeSession
setup failed or IkeSession
is closed because of a fatal error.
Parameters |
exception |
IkeException: the detailed error information. This value cannot be null . |
onError
open fun onError(exception: IkeException): Unit
Called if a recoverable error is encountered in an established IkeSession
.
This method may be triggered by protocol errors such as an INVALID_IKE_SPI, or by non-protocol errors such as the underlying android.net.Network
dying.
Parameters |
exception |
IkeException: the detailed error information. This value cannot be null . |
onOpened
abstract fun onOpened(sessionConfiguration: IkeSessionConfiguration): Unit
Called when the IkeSession
setup succeeds.
This method does not indicate the first Child Session has been setup. Caller MUST refer to the corresponding ChildSessionCallback
for the Child Session setup result.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# IkeSessionCallback\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nIkeSessionCallback\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/ipsec/ike/IkeSessionCallback \"View this page in Java\") \n\n```\ninterface IkeSessionCallback\n```\n\n|-----------------------------------------------|\n| [android.net.ipsec.ike.IkeSessionCallback](#) |\n\nCallback interface for receiving state changes of an [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession).\n\n[IkeSessionCallback](#) MUST be unique to each [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession). It is registered when callers are requesting a new [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession). It is automatically unregistered when an [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) is closed.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onClosed](#onClosed())`()` Called when the [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) is closed. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onClosedWithException](#onClosedWithException(android.net.ipsec.ike.exceptions.IkeException))`(`exception:` `[IkeException](/reference/kotlin/android/net/ipsec/ike/exceptions/IkeException)`)` Called if [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) setup failed or [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) is closed because of a fatal error. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(android.net.ipsec.ike.exceptions.IkeException))`(`exception:` `[IkeException](/reference/kotlin/android/net/ipsec/ike/exceptions/IkeException)`)` Called if a recoverable error is encountered in an established [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession). |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onOpened](#onOpened(android.net.ipsec.ike.IkeSessionConfiguration))`(`sessionConfiguration:` `[IkeSessionConfiguration](/reference/kotlin/android/net/ipsec/ike/IkeSessionConfiguration)`)` Called when the [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) setup succeeds. |\n\nPublic methods\n--------------\n\n### onClosed\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onClosed(): Unit\n```\n\nCalled when the [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) is closed.\n\nWhen the closure is caused by a local, fatal error, [onClosedWithException(android.net.ipsec.ike.exceptions.IkeException)](#onClosedWithException(android.net.ipsec.ike.exceptions.IkeException)) will be fired instead of this method. \n\n### onClosedWithException\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onClosedWithException(exception: IkeException): Unit\n```\n\nCalled if [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) setup failed or [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) is closed because of a fatal error.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `exception` | [IkeException](/reference/kotlin/android/net/ipsec/ike/exceptions/IkeException): the detailed error information. This value cannot be `null`. |\n\n### onError\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(exception: IkeException): Unit\n```\n\nCalled if a recoverable error is encountered in an established [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession).\n\nThis method may be triggered by protocol errors such as an INVALID_IKE_SPI, or by non-protocol errors such as the underlying [android.net.Network](../../Network.html#) dying.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `exception` | [IkeException](/reference/kotlin/android/net/ipsec/ike/exceptions/IkeException): the detailed error information. This value cannot be `null`. |\n\n### onOpened\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onOpened(sessionConfiguration: IkeSessionConfiguration): Unit\n```\n\nCalled when the [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) setup succeeds.\n\nThis method does not indicate the first Child Session has been setup. Caller MUST refer to the corresponding [ChildSessionCallback](/reference/kotlin/android/net/ipsec/ike/ChildSessionCallback) for the Child Session setup result.\n\n| Parameters ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sessionConfiguration` | [IkeSessionConfiguration](/reference/kotlin/android/net/ipsec/ike/IkeSessionConfiguration): the configuration information of [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession) negotiated during IKE setup. This value cannot be `null`. |"]]