public class Options
extends java.lang.Object
SyncClient.openDocument(com.twilio.sync.Options, com.twilio.sync.DocumentObserver, com.twilio.sync.SuccessListener<com.twilio.sync.Document>)
SyncClient.openMap(com.twilio.sync.Options, com.twilio.sync.MapObserver, com.twilio.sync.SuccessListener<com.twilio.sync.Map>)
SyncClient.openList(com.twilio.sync.Options, com.twilio.sync.ListObserver, com.twilio.sync.SuccessListener<com.twilio.sync.List>)
SyncClient.openStream(com.twilio.sync.Options, com.twilio.sync.StreamObserver, com.twilio.sync.SuccessListener<com.twilio.sync.Stream>)
Typical usage pattern:
new Options().withUniqueName("myName")
Modifier and Type | Class and Description |
---|---|
static class |
Options.OpenMode |
static class |
Options.SynchronizationStrategy |
Constructor and Description |
---|
Options() |
Modifier and Type | Method and Description |
---|---|
Options |
createWithUniqueName(java.lang.String uniqueName)
Creates a new object with specified unique name, fails if the given name is already in use.
|
void |
dispose() |
Options.OpenMode |
getOpenMode() |
java.lang.String |
getSidOrUniqueName() |
Options.SynchronizationStrategy |
getSynchronizationStrategy() |
Options |
openWithSidOrUniqueName(java.lang.String sidOrUniqueName)
Opens an existing object with specified SID or unique name.
|
Options |
withStrategy(Options.SynchronizationStrategy strategy) |
Options |
withTtl(int ttl)
Specifies the Time-to-Live of the Sync object in seconds.
|
Options |
withUniqueName(java.lang.String uniqueName)
Creates a new object or opens an existing one with provided unique name.
|
Options |
withUniqueName(java.lang.String uniqueName,
Options.OpenMode mode)
Creates a new object or opens an existing one with provided unique name,
also given a specific opening mode.
|
public Options createWithUniqueName(java.lang.String uniqueName)
uniqueName
- Unique name to assign to entity upon creation.public Options withUniqueName(java.lang.String uniqueName)
uniqueName
- Unique name to find existing entity
or to assign to new entity upon creation.public Options withUniqueName(java.lang.String uniqueName, Options.OpenMode mode)
uniqueName
- Unique name to find existing entity
or to assign to new entity upon creation.mode
- Open mode, one of the constants @todo OpenModepublic Options openWithSidOrUniqueName(java.lang.String sidOrUniqueName)
sidOrUniqueName
- SID or unique name to find existing entity
or to assign to new entity upon creation.public Options withStrategy(Options.SynchronizationStrategy strategy)
public Options withTtl(int ttl)
public java.lang.String getSidOrUniqueName()
public Options.OpenMode getOpenMode()
public Options.SynchronizationStrategy getSynchronizationStrategy()
public void dispose()