Package io.ably.lib.types
Class ChannelOptions
- java.lang.Object
-
- io.ably.lib.types.ChannelOptions
-
public class ChannelOptions extends java.lang.ObjectPasses additional properties to aChannelorChannelobject, such as encryption,ChannelModeand 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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ChannelOptionsfromCipherKey(byte[] key)Deprecated.static ChannelOptionsfromCipherKey(java.lang.String base64Key)Deprecated.Crypto.CipherParamsgetCipherParamsOrDefault()Internal; returns cipher params or generate defaultintgetModeFlags()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 Detail
-
params
public java.util.Map<java.lang.String,java.lang.String> params
Channel Parameters that configure the behavior of the channel.Spec: TB2c
-
modes
public ChannelMode[] modes
An array ofChannelModeobjects.Spec: TB2d
-
cipherParams
public java.lang.Object 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 encrypted
Whether or not this ChannelOptions is encrypted.
-
-
Method Detail
-
hasModes
public boolean hasModes()
-
hasParams
public boolean hasParams()
-
getModeFlags
public int getModeFlags()
-
fromCipherKey
@Deprecated public static ChannelOptions fromCipherKey(byte[] key) throws AblyException
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 AblyException
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
public static ChannelOptions withCipherKey(byte[] key) throws AblyException
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
public static ChannelOptions withCipherKey(java.lang.String base64Key) throws AblyException
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
public Crypto.CipherParams getCipherParamsOrDefault() throws AblyException
Internal; returns cipher params or generate default- Throws:
AblyException
-
-