Package io.ably.lib.types
Class ChannelOptions
java.lang.Object
io.ably.lib.types.ChannelOptions
Passes additional properties to a
Channel
or Channel
object,
such as encryption, ChannelMode
and channel parameters.-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Determines whether callingChannel.subscribe
orPresence.subscribe
method should trigger an implicit attach.Requests encryption for this channel when not null, and specifies encryption-related parameters (such as algorithm, chaining mode, key length and key).boolean
Whether or not this ChannelOptions is encrypted.An array ofChannelMode
objects.Channel Parameters that configure the behavior of the channel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelOptions
fromCipherKey
(byte[] key) Deprecated.static ChannelOptions
fromCipherKey
(String base64Key) Deprecated.Internal; returns cipher params or generate defaultint
boolean
hasModes()
boolean
static ChannelOptions
withCipherKey
(byte[] key) Constructor withCipherKey, that takes a key only.static ChannelOptions
withCipherKey
(String base64Key) Constructor withCipherKey, that takes a key only.
-
Field Details
-
params
Channel Parameters that configure the behavior of the channel.Spec: TB2c
-
modes
An array ofChannelMode
objects.Spec: TB2d
-
cipherParams
Requests encryption for this channel when not null, and specifies encryption-related parameters (such as algorithm, chaining mode, key length and key). See an example.Spec: RSL5a, TB2b
-
encrypted
public boolean encryptedWhether or not this ChannelOptions is encrypted. -
attachOnSubscribe
public boolean attachOnSubscribeDetermines whether calling
Channel.subscribe
orPresence.subscribe
method should trigger an implicit attach.Defaults to
true
.Spec: TB4, RTL7g, RTL7h, RTP6d, RTP6e
-
-
Constructor Details
-
ChannelOptions
public ChannelOptions()
-
-
Method Details
-
hasModes
public boolean hasModes() -
hasParams
public boolean hasParams() -
getModeFlags
public int getModeFlags() -
fromCipherKey
Deprecated.Deprecated. Use withCipherKey(byte[]) instead.
Create ChannelOptions from the given cipher key.- Parameters:
-
key
- Byte array cipher key. - Returns:
- Created ChannelOptions.
- Throws:
-
AblyException
- If something goes wrong.
-
fromCipherKey
Deprecated.Deprecated. Use withCipherKey(String) instead.
Create ChannelOptions from the given cipher key.- Parameters:
-
base64Key
- The cipher key as a base64-encoded String, - Returns:
- Created ChannelOptions.
- Throws:
-
AblyException
- If something goes wrong.
-
withCipherKey
Constructor withCipherKey, that takes a key only.Spec: TB3
- Parameters:
-
key
- A private key used to encrypt and decrypt payloads. - Returns:
- A ChannelOptions object.
- Throws:
-
AblyException
- If something goes wrong.
-
withCipherKey
Constructor withCipherKey, that takes a key only.Spec: TB3
- Parameters:
-
base64Key
- A private key used to encrypt and decrypt payloads. - Returns:
- A ChannelOptions object.
- Throws:
-
AblyException
- If something goes wrong.
-
getCipherParamsOrDefault
Internal; returns cipher params or generate default- Throws:
AblyException
-