# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

# 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.

See also:

- RFC 7296, Internet Key Exchange Protocol Version 2 (IKEv2)

## Summary

### Public methods
`abstract void` | `onClosed()` Called when the `IkeSession` is closed.
`default void` | `onClosedWithException(IkeException exception)` Called if `IkeSession` setup failed or `IkeSession` is closed because of a fatal error.
`default void` | `onError(IkeException exception)` Called if a recoverable error is encountered in an established `IkeSession`.
`abstract void` | `onOpened(IkeSessionConfiguration sessionConfiguration)` Called when the `IkeSession` setup succeeds.

## Public methods

### onClosed

    public abstract void onClosed ()

Called when the `IkeSession` is closed.

When the closure is caused by a local, fatal error, `onClosedWithException(android.net.ipsec.ike.exceptions.IkeException)` will be fired instead of this method.

### 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`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*