Interface PropertyResolver
-
- All Known Subinterfaces:
Channel,ClientChannel,ClientFactoryManager,ClientSession,ConnectionService,FactoryManager,SecurityProviderRegistrar,ServerChannel,ServerFactoryManager,ServerSession,Service,Session,SessionContext,SessionHeartbeatController
- All Known Implementing Classes:
AbstractChannel,AbstractClientChannel,AbstractClientSession,AbstractConnectionService,AbstractFactoryManager,AbstractSecurityProviderRegistrar,AbstractServerChannel,AbstractServerSession,AbstractSession,AgentForwardedChannel,AgentForwardedChannel,AsyncCapableClientChannel,BouncyCastleSecurityProviderRegistrar,ChannelAgentForwarding,ChannelAgentForwarding,ChannelDirectTcpip,ChannelExec,ChannelForwardedX11,ChannelSession,ChannelSession,ChannelShell,ChannelSubsystem,ClientConnectionService,ClientSessionImpl,ClientUserAuthService,DefaultSftpClient.SftpChannelSubsystem,EdDSASecurityProviderRegistrar,PtyCapableChannelSession,ServerConnectionService,ServerSessionImpl,ServerUserAuthService,SessionHelper,SshClient,SshServer,SunJCESecurityProviderRegistrar,TcpipClientChannel,TcpipServerChannel
public interface PropertyResolverIndicates an entity that can be configured using properties. The properties are simple name-value pairs where the actual value type depends on the property. Some automatic conversions may be available - e.g., from a string to a numeric orbooleanvalue, or frominttolong, etc.. Note: implementations may decide to use case insensitive property names, therefore it is highly discouraged to use names that differ from each other only in case sensitivity. Also, implementations may choose to trim whitespaces, thus such are also highly discouraged.
-
-
Field Summary
Fields Modifier and Type Field Description static PropertyResolverEMPTYAn "empty" resolver with no properties and no parent
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.BooleangetBoolean(java.lang.String name)default booleangetBooleanProperty(java.lang.String name, boolean def)default java.nio.charset.CharsetgetCharset(java.lang.String name, java.nio.charset.Charset defaultValue)default java.lang.IntegergetInteger(java.lang.String name)default intgetIntProperty(java.lang.String name, int def)default java.lang.LonggetLong(java.lang.String name)default longgetLongProperty(java.lang.String name, long def)default java.lang.ObjectgetObject(java.lang.String name)PropertyResolvergetParentPropertyResolver()java.util.Map<java.lang.String,java.lang.Object>getProperties()A map of properties that can be used to configure the SSH server or client.default java.lang.StringgetString(java.lang.String name)default java.lang.StringgetStringProperty(java.lang.String name, java.lang.String def)default booleanisEmpty()static booleanisEmpty(PropertyResolver resolver)
-
-
-
Field Detail
-
EMPTY
static final PropertyResolver EMPTY
An "empty" resolver with no properties and no parent
-
-
Method Detail
-
getParentPropertyResolver
PropertyResolver getParentPropertyResolver()
- Returns:
- The parent resolver that can be used to query for missing properties -
nullif no parent
-
getProperties
java.util.Map<java.lang.String,java.lang.Object> getProperties()
A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean, String, etc.... If it doesn't, thetoString()result of the mapped value is used to convert it to the required type. E.g., if the mapped value is the string "1234" and the expected value is alongthen it will be parsed into one. Also, if the mapped value is anIntegerbut alongis expected, then it will be converted into one.- Returns:
- a valid
Mapcontaining configuration values, nevernull. Note: may be immutable.
-
isEmpty
default boolean isEmpty()
-
getLongProperty
default long getLongProperty(java.lang.String name, long def)
-
getLong
default java.lang.Long getLong(java.lang.String name)
-
getIntProperty
default int getIntProperty(java.lang.String name, int def)
-
getInteger
default java.lang.Integer getInteger(java.lang.String name)
-
getBooleanProperty
default boolean getBooleanProperty(java.lang.String name, boolean def)
-
getBoolean
default java.lang.Boolean getBoolean(java.lang.String name)
-
getStringProperty
default java.lang.String getStringProperty(java.lang.String name, java.lang.String def)
-
getString
default java.lang.String getString(java.lang.String name)
-
getObject
default java.lang.Object getObject(java.lang.String name)
-
getCharset
default java.nio.charset.Charset getCharset(java.lang.String name, java.nio.charset.Charset defaultValue)
-
isEmpty
static boolean isEmpty(PropertyResolver resolver)
-
-