Stay organized with collections
Save and categorize content based on your preferences.
IkeSessionCallback
public
interface
IkeSessionCallback
android.net.ipsec.ike.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
public void onClosedWithException (IkeException exception)
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
public void onError (IkeException exception)
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 Network
dying.
Parameters |
exception |
IkeException : the detailed error information.
This value cannot be null . |
onOpened
public abstract void onOpened (IkeSessionConfiguration sessionConfiguration)
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.
Parameters |
sessionConfiguration |
IkeSessionConfiguration : the configuration information of IkeSession negotiated
during IKE setup.
This value cannot be null . |
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nIkeSessionCallback\n==================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/net/ipsec/ike/IkeSessionCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nIkeSessionCallback\n`\n\n\n`\n\n\n`\n\n|------------------------------------------|\n| android.net.ipsec.ike.IkeSessionCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback interface for receiving state changes of an [IkeSession](/reference/android/net/ipsec/ike/IkeSession).\n\n[IkeSessionCallback](/reference/android/net/ipsec/ike/IkeSessionCallback) MUST be unique to each [IkeSession](/reference/android/net/ipsec/ike/IkeSession). It is registered when\ncallers are requesting a new [IkeSession](/reference/android/net/ipsec/ike/IkeSession). It is automatically unregistered when an [IkeSession](/reference/android/net/ipsec/ike/IkeSession) is closed. \n**See also:**\n\n- [RFC 7296, Internet Key Exchange Protocol\n Version 2 (IKEv2)](https://tools.ietf.org/html/rfc7296)\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onClosed](/reference/android/net/ipsec/ike/IkeSessionCallback#onClosed())`() ` Called when the [IkeSession](/reference/android/net/ipsec/ike/IkeSession) is closed. |\n| ` default void` | ` `[onClosedWithException](/reference/android/net/ipsec/ike/IkeSessionCallback#onClosedWithException(android.net.ipsec.ike.exceptions.IkeException))`(`[IkeException](/reference/android/net/ipsec/ike/exceptions/IkeException)` exception) ` Called if [IkeSession](/reference/android/net/ipsec/ike/IkeSession) setup failed or [IkeSession](/reference/android/net/ipsec/ike/IkeSession) is closed because of a fatal error. |\n| ` default void` | ` `[onError](/reference/android/net/ipsec/ike/IkeSessionCallback#onError(android.net.ipsec.ike.exceptions.IkeException))`(`[IkeException](/reference/android/net/ipsec/ike/exceptions/IkeException)` exception) ` Called if a recoverable error is encountered in an established [IkeSession](/reference/android/net/ipsec/ike/IkeSession). |\n| ` abstract void` | ` `[onOpened](/reference/android/net/ipsec/ike/IkeSessionCallback#onOpened(android.net.ipsec.ike.IkeSessionConfiguration))`(`[IkeSessionConfiguration](/reference/android/net/ipsec/ike/IkeSessionConfiguration)` sessionConfiguration) ` Called when the [IkeSession](/reference/android/net/ipsec/ike/IkeSession) setup succeeds. |\n\nPublic methods\n--------------\n\n### onClosed\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClosed ()\n```\n\nCalled when the [IkeSession](/reference/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)](/reference/android/net/ipsec/ike/IkeSessionCallback#onClosedWithException(android.net.ipsec.ike.exceptions.IkeException)) will be fired instead of this method.\n\n\u003cbr /\u003e\n\n### onClosedWithException\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onClosedWithException (IkeException exception)\n```\n\nCalled if [IkeSession](/reference/android/net/ipsec/ike/IkeSession) setup failed or [IkeSession](/reference/android/net/ipsec/ike/IkeSession) is closed because of a fatal\nerror.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------|\n| `exception` | `IkeException`: the detailed error information. This value cannot be `null`. \u003cbr /\u003e |\n\n### onError\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onError (IkeException exception)\n```\n\nCalled if a recoverable error is encountered in an established [IkeSession](/reference/android/net/ipsec/ike/IkeSession).\n\nThis method may be triggered by protocol errors such as an INVALID_IKE_SPI, or by\nnon-protocol errors such as the underlying [Network](/reference/android/net/Network) dying.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------|\n| `exception` | `IkeException`: the detailed error information. This value cannot be `null`. \u003cbr /\u003e |\n\n### onOpened\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onOpened (IkeSessionConfiguration sessionConfiguration)\n```\n\nCalled when the [IkeSession](/reference/android/net/ipsec/ike/IkeSession) setup succeeds.\n\nThis method does not indicate the first Child Session has been setup. Caller MUST refer to\nthe corresponding [ChildSessionCallback](/reference/android/net/ipsec/ike/ChildSessionCallback) for the Child Session setup result.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sessionConfiguration` | `IkeSessionConfiguration`: the configuration information of [IkeSession](/reference/android/net/ipsec/ike/IkeSession) negotiated during IKE setup. This value cannot be `null`. \u003cbr /\u003e |"]]