Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#inhmethods)

# IpSecManager.SecurityParameterIndex

*** ** * ** ***

` public static final class IpSecManager.SecurityParameterIndex `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/lang/AutoCloseable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.IpSecManager.SecurityParameterIndex |

<br />

*** ** * ** ***

This class represents a reserved SPI.

Objects of this type are used to track reserved security parameter indices. They can be obtained by calling `https://developer.android.com/reference/android/net/IpSecManager#allocateSecurityParameterIndex(java.net.InetAddress)` and must be released by calling `https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#close()` when they are no longer needed.

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#close()() ` Release an SPI that was previously reserved. |
| ` int` | ` https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#getSpi()() ` Get the underlying SPI held by this object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#toString()() ` Returns a string representation of the object. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/IpSecManager.SecurityParameterIndex#finalize()() ` Check that the SPI was closed properly. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/java/lang/AutoCloseable ` ` abstract void` ` https://developer.android.com/reference/java/lang/AutoCloseable#close()() `

Closes this resource, relinquishing any underlying resources.

## Public methods

### close

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void close ()
```

Release an SPI that was previously reserved.

Release an SPI for use by other users in the system. If a SecurityParameterIndex is applied to an IpSecTransform, it will become unusable for future transforms but should still be closed to ensure system resources are released.

<br />

### getSpi

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSpi ()
```

Get the underlying SPI held by this object.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### toString

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

## Protected methods

### finalize

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void finalize ()
```

Check that the SPI was closed properly.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable` |   |