Enum BuiltinCompressions
- java.lang.Object
-
- java.lang.Enum<BuiltinCompressions>
-
- org.apache.sshd.common.compression.BuiltinCompressions
-
- All Implemented Interfaces:
Serializable
,Comparable<BuiltinCompressions>
,Supplier<Compression>
,BuiltinFactory<Compression>
,CompressionFactory
,CompressionInformation
,Factory<Compression>
,NamedFactory<Compression>
,NamedResource
,OptionalFeature
public enum BuiltinCompressions extends Enum<BuiltinCompressions> implements CompressionFactory
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BuiltinCompressions.Constants
static class
BuiltinCompressions.ParseResult
Holds the result ofparseCompressionsList(String)
-
Enum Constant Summary
Enum Constants Enum Constant Description delayedZlib
none
zlib
-
Field Summary
Fields Modifier and Type Field Description static Set<BuiltinCompressions>
VALUES
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuiltinCompressions
fromFactoryName(String name)
String
getName()
static NavigableSet<CompressionFactory>
getRegisteredExtensions()
boolean
isCompressionExecuted()
boolean
isDelayed()
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.boolean
isSupported()
static BuiltinCompressions.ParseResult
parseCompressionsList(String compressions)
static BuiltinCompressions.ParseResult
parseCompressionsList(String... compressions)
static BuiltinCompressions.ParseResult
parseCompressionsList(Collection<String> compressions)
static void
registerExtension(CompressionFactory extension)
Registered aNamedFactory
to be available besides the built-in ones when parsing configurationstatic CompressionFactory
resolveFactory(String name)
String
toString()
static CompressionFactory
unregisterExtension(String name)
Unregisters specified extensionstatic BuiltinCompressions
valueOf(String name)
Returns the enum constant of this type with the specified name.static BuiltinCompressions[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
none
public static final BuiltinCompressions none
-
zlib
public static final BuiltinCompressions zlib
-
delayedZlib
public static final BuiltinCompressions delayedZlib
-
-
Field Detail
-
VALUES
public static final Set<BuiltinCompressions> VALUES
-
-
Method Detail
-
values
public static BuiltinCompressions[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BuiltinCompressions c : BuiltinCompressions.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BuiltinCompressions valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
public final String getName()
- Specified by:
getName
in interfaceNamedResource
- 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 interfaceCompressionInformation
- Returns:
- if the compression is delayed after authentication or not
-
isCompressionExecuted
public boolean isCompressionExecuted()
- Specified by:
isCompressionExecuted
in interfaceCompressionInformation
- Returns:
true
if there is any compression executed by this "compressor" - special case for 'none'
-
toString
public final String toString()
- Overrides:
toString
in classEnum<BuiltinCompressions>
-
isSupported
public final boolean isSupported()
- Specified by:
isSupported
in interfaceOptionalFeature
-
registerExtension
public static void registerExtension(CompressionFactory extension)
Registered aNamedFactory
to be available besides the built-in ones when parsing configuration- Parameters:
extension
- The factory to register- Throws:
IllegalArgumentException
- if factory instance isnull
, 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 ifnull
/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 ifnull
/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
-
-