Package anbxj

Class Channel_Settings

java.lang.Object
anbxj.Channel_Settings
All Implemented Interfaces:
Serializable

public class Channel_Settings extends Object implements Serializable
Represents settings for a communication channel. Implements java.io.Serializable to support serialization.
See Also:
  • Constructor Details

    • Channel_Settings

      public Channel_Settings(Channel_SSLChannelType ct, Channel_Roles cr, String host, int port, String sslContext)
      Channel_Settings Constructor
      Parameters:
      ct - channel type: SSL or not
      cr - channel role (client or server)
      host - IP address of the remote server (if role is client)
      port - port (both client an server)
      sslContext - the sslContext parameter (e.g. TLSv1.2, TLSv1.3)
    • Channel_Settings

      public Channel_Settings(Channel_Roles cr, String host, int port)
      PLAIN channel settings
      Parameters:
      cr - channel role (client or server)
      host - IP address of the remote server (if role is client)
      port - port (both client an server)
    • Channel_Settings

      public Channel_Settings(Channel_SSLChannelType ct, Channel_Roles cr, String host, int port)
      Standard channel settings, without SSL context specification
      Parameters:
      ct - channel type: SSL or not
      cr - channel role (client or server)
      host - IP address of the remote server (if role is client)
      port - port (both client an server)
  • Method Details

    • getChannelRole

      public Channel_Roles getChannelRole()
      Gets the role of the channel.
      Returns:
      The role of the channel.
    • getChannelType

      public Channel_SSLChannelType getChannelType()
      Gets the type of the channel.
      Returns:
      The type of the channel.
    • getSSLContextAlgorithm

      public String getSSLContextAlgorithm()
      Gets the type of the channel.
      Returns:
      The type of the channel.
    • getEnabledCipherSuites

      public String[] getEnabledCipherSuites(String[] supported)
      Returns the cipher suites that should be enabled for this channel's SSL type, determined from the full set of supported suites.

      The filtering logic is delegated to Channel_SSLChannelUtils.filterCipherSuites(Channel_SSLChannelType, String[]).

      Parameters:
      supported - all cipher suites supported by the SSL engine (e.g. from SSLSocket.getSupportedCipherSuites())
      Returns:
      the subset of cipher suites to enable for this channel; may be an empty array if no suites match the channel type
    • getHost

      public String getHost()
      Gets the host of the channel.
      Returns:
      The host of the channel.
    • getPort

      public int getPort()
      Gets the port of the channel.
      Returns:
      The port of the channel.
    • isAuthenticatedChannel

      public boolean isAuthenticatedChannel()
      Checks if the channel is authenticated.
      Returns:
      True if the channel is authenticated, false otherwise.
    • isSecretChannel

      public boolean isSecretChannel()
      Checks if the channel is secret.
      Returns:
      True if the channel is secret, false otherwise.
    • toString

      public String toString()
      Generates a string representation of the channel settings.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the channel settings.