Stay organized with collections
Save and categorize content based on your preferences.
SecurityParameterIndex
class SecurityParameterIndex : AutoCloseable
This class represents a reserved SPI.
Objects of this type are used to track reserved security parameter indices. They can be obtained by calling android.net.IpSecManager#allocateSecurityParameterIndex and must be released by calling close()
when they are no longer needed.
Summary
Public methods |
Unit |
Release an SPI that was previously reserved.
|
Int |
Get the underlying SPI held by this object.
|
String |
|
Protected methods |
Unit |
Check that the SPI was closed properly.
|
Public methods
close
fun close(): Unit
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.
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
getSpi
fun getSpi(): Int
Get the underlying SPI held by this object.
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Protected methods
finalize
protected fun finalize(): Unit
Check that the SPI was closed properly.
Exceptions |
java.lang.Throwable |
the Exception raised by this method |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# IpSecManager.SecurityParameterIndex\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSecurityParameterIndex\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/IpSecManager.SecurityParameterIndex \"View this page in Java\") \n\n```\nclass SecurityParameterIndex : AutoCloseable\n```\n\n|---|------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.IpSecManager.SecurityParameterIndex](#) |\n\nThis class represents a reserved SPI.\n\nObjects of this type are used to track reserved security parameter indices. They can be obtained by calling android.net.IpSecManager#allocateSecurityParameterIndex and must be released by calling [close()](#close()) when they are no longer needed.\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------------------------------------------------|---------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [close](#close())`()` Release an SPI that was previously reserved. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getSpi](#getSpi())`()` Get the underlying SPI held by this object. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\n| Protected methods ||\n|------------------------------------------------------------------------------|---------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [finalize](#finalize())`()` Check that the SPI was closed properly. |\n\nPublic methods\n--------------\n\n### close\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun close(): Unit\n```\n\nRelease an SPI that was previously reserved.\n\nRelease 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.\n\n| Exceptions ||\n|-----------------------|-----------------------------------|\n| `java.lang.Exception` | if this resource cannot be closed |\n\n### getSpi\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSpi(): Int\n```\n\nGet the underlying SPI held by this object. \n\n### toString\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |\n\nProtected methods\n-----------------\n\n### finalize\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected fun finalize(): Unit\n```\n\nCheck that the SPI was closed properly.\n\n| Exceptions ||\n|-----------------------|---------------------------------------|\n| `java.lang.Throwable` | the `Exception` raised by this method |"]]