|
Sync Android SDK
0.9.0
|
Options are used to pass variable information to Document, Map, List and Stream opening functions. More...
Public Member Functions | |
| native Options | createWithUniqueName (String uniqueName) |
| Creates a new object with specified unique name, fails if the given name is already in use. More... | |
| native Options | withUniqueName (String uniqueName) |
| Creates a new object or opens an existing one with provided unique name. More... | |
| native Options | withUniqueName (String uniqueName, OpenMode mode) |
| Creates a new object or opens an existing one with provided unique name, also given a specific opening mode. More... | |
| native Options | openWithSidOrUniqueName (String sidOrUniqueName) |
| Opens an existing object with specified SID or unique name. More... | |
| native Options | withTtl (int ttl) |
| Set time to live for the Sync object in seconds. More... | |
Public Attributes | |
| final int | InfiniteDuration = 0 |
| Time to live for a Sync object, specifying no expiry. | |
Options are used to pass variable information to Document, Map, List and Stream opening functions.
Typical usage pattern:
| native Options com.twilio.sync.Options.createWithUniqueName | ( | String | uniqueName | ) |
Creates a new object with specified unique name, fails if the given name is already in use.
This method is the same as withUniqueName(String, OpenMode) with OpenMode#CREATE_NEW mode.
| uniqueName | Unique name to assign to entity upon creation. |
| native Options com.twilio.sync.Options.openWithSidOrUniqueName | ( | String | sidOrUniqueName | ) |
Opens an existing object with specified SID or unique name.
Implementation will automatically detect whether a SID or a unique name has been provided, and behave accordingly. This method is the same as withUniqueName(String, OpenMode) with OpenMode#OPEN_EXISTING mode.
| sidOrUniqueName | SID or unique name to find existing entity or to assign to new entity upon creation. |
| native Options com.twilio.sync.Options.withTtl | ( | int | ttl | ) |
Set time to live for the Sync object in seconds.
This TTL specifies the minimum time the object will live, sometime soon after this time the object will be deleted.
If time to live is not specified, object lives infinitely long.
TTL could be used in order to auto-recycle old unused objects, but it is not recommended to build some app logic like timers using ttl.
This setting works with all object types, however note that it is applicable only when creating an object. When (re)opening an existing object, new TTL is not applied, and instead an old setting is retained, in order to avoid unexpected read-only object change.
| ttl | Time to live in seconds from now or InfiniteDuration to indicate no expiry. |
| native Options com.twilio.sync.Options.withUniqueName | ( | String | uniqueName | ) |
Creates a new object or opens an existing one with provided unique name.
This method is the same as withUniqueName(String, OpenMode) with OpenMode#OPEN_OR_CREATE mode.
| uniqueName | Unique name to find existing entity or to assign to new entity upon creation. |
| native Options com.twilio.sync.Options.withUniqueName | ( | String | uniqueName, |
| OpenMode | mode | ||
| ) |
Creates a new object or opens an existing one with provided unique name, also given a specific opening mode.
| uniqueName | Unique name to find existing entity or to assign to new entity upon creation. |
| mode | Open mode, one of the constants OpenMode |