Package io.ably.lib.types
Class ChannelOptions
java.lang.Object
io.ably.lib.types.ChannelOptions
public class ChannelOptions
extends java.lang.Object
Passes additional properties to a
Channel or Channel object,
such as encryption, ChannelMode and channel parameters.-
Field Summary
Fields Modifier and Type Field Description java.lang.ObjectcipherParamsRequests encryption for this channel when not null, and specifies encryption-related parameters (such as algorithm, chaining mode, key length and key).booleanencryptedWhether or not this ChannelOptions is encrypted.ChannelMode[]modesAn array ofChannelModeobjects.java.util.Map<java.lang.String,java.lang.String>paramsChannel Parameters that configure the behavior of the channel. -
Constructor Summary
Constructors Constructor Description ChannelOptions() -
Method Summary
Modifier and Type Method Description static ChannelOptionsfromCipherKey(byte[] key)Deprecated.static ChannelOptionsfromCipherKey(java.lang.String base64Key)Deprecated.Crypto.ChannelCiphergetCipher()Deprecated.Since version 1.2.11, this method (which was only ever intended for internal use within this library has been replaced bygetCipherSet().Crypto.ChannelCipherSetgetCipherSet()Internal; this method is not intended for use by application developers.intgetModeFlags()booleanhasModes()booleanhasParams()static ChannelOptionswithCipherKey(byte[] key)Constructor withCipherKey, that takes a key only.static ChannelOptionswithCipherKey(java.lang.String base64Key)Constructor withCipherKey, that takes a key only.
-
Field Details
-
params
public java.util.Map<java.lang.String,java.lang.String> paramsChannel Parameters that configure the behavior of the channel.Spec: TB2c
-
modes
An array ofChannelModeobjects.Spec: TB2d
-
cipherParams
public java.lang.Object cipherParamsRequests 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.
-
-
Constructor Details
-
ChannelOptions
public ChannelOptions()
-
-
Method Details
-
hasModes
public boolean hasModes() -
hasParams
public boolean hasParams() -
getModeFlags
public int getModeFlags() -
getCipher
Deprecated.Since version 1.2.11, this method (which was only ever intended for internal use within this library has been replaced bygetCipherSet(). It will be removed in the future.Returns a wrapper around the cipher set to be used for this channel. This wrapper is only available in this API to support customers who may have been using it in their applications with version 1.2.10 or before.- Throws:
AblyException
-
getCipherSet
Internal; this method is not intended for use by application developers. It may be changed or removed in future. Returns the cipher set to be used for encrypting and decrypting data on a channel, given the current state of this instance. On the first call to this method a new cipher set instance is created, with subsequent callers to this method being returned that same cipher set instance. This method is safe to be called from any thread.- Throws:
AblyException
-
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 public static ChannelOptions fromCipherKey(java.lang.String base64Key) throws AblyExceptionDeprecated.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.
-