Enum Class BuiltinCompressions

java.lang.Object
java.lang.Enum<BuiltinCompressions>
org.apache.sshd.common.compression.BuiltinCompressions
All Implemented Interfaces:
Serializable, Comparable<BuiltinCompressions>, Constable, Supplier<Compression>, BuiltinFactory<Compression>, CompressionFactory, CompressionInformation, Factory<Compression>, NamedFactory<Compression>, NamedResource, OptionalFeature

public enum BuiltinCompressions extends Enum<BuiltinCompressions> implements CompressionFactory
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • BuiltinCompressions

      private BuiltinCompressions(String n)
  • Method Details

    • values

      public static BuiltinCompressions[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BuiltinCompressions valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public final String getName()
      Specified by:
      getName in interface NamedResource
      Returns:
      The resource name
    • isDelayed

      public boolean isDelayed()
      Description copied from interface: CompressionInformation
      Delayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.
      Specified by:
      isDelayed in interface CompressionInformation
      Returns:
      if the compression is delayed after authentication or not
    • isCompressionExecuted

      public boolean isCompressionExecuted()
      Specified by:
      isCompressionExecuted in interface CompressionInformation
      Returns:
      true if there is any compression executed by this "compressor" - special case for 'none'
    • toString

      public final String toString()
      Overrides:
      toString in class Enum<BuiltinCompressions>
    • isSupported

      public final boolean isSupported()
      Specified by:
      isSupported in interface OptionalFeature
    • registerExtension

      public static void registerExtension(CompressionFactory extension)
      Registered a NamedFactory to be available besides the built-in ones when parsing configuration
      Parameters:
      extension - The factory to register
      Throws:
      IllegalArgumentException - if factory instance is null, or overrides a built-in one or overrides another registered factory with the same name (case insensitive).
    • getRegisteredExtensions

      public static NavigableSet<CompressionFactory> getRegisteredExtensions()
      Returns:
      A SortedSet of the currently registered extensions, sorted according to the factory name (case insensitive)
    • unregisterExtension

      public static CompressionFactory unregisterExtension(String name)
      Unregisters specified extension
      Parameters:
      name - The factory name - ignored if null/empty
      Returns:
      The registered extension - null if not found
    • fromFactoryName

      public static BuiltinCompressions fromFactoryName(String name)
    • parseCompressionsList

      public static BuiltinCompressions.ParseResult parseCompressionsList(String compressions)
      Parameters:
      compressions - A comma-separated list of Compressions' names - ignored if null/empty
      Returns:
      A BuiltinCompressions.ParseResult containing the successfully parsed factories and the unknown ones. Note: it is up to caller to ensure that the lists do not contain duplicates
    • parseCompressionsList

      public static BuiltinCompressions.ParseResult parseCompressionsList(String... compressions)
    • parseCompressionsList

      public static BuiltinCompressions.ParseResult parseCompressionsList(Collection<String> compressions)
    • resolveFactory

      public static CompressionFactory resolveFactory(String name)
      Parameters:
      name - The factory name
      Returns:
      The factory or null if it is neither a built-in one or a registered extension