Package org.apache.sshd.common
Interface AttributeRepository
-
- All Known Subinterfaces:
AttributeStore
,Channel
,ClientChannel
,ClientFactoryManager
,ClientSession
,FactoryManager
,ServerChannel
,ServerFactoryManager
,ServerSession
,Session
,SessionContext
- All Known Implementing Classes:
AbstractChannel
,AbstractClientChannel
,AbstractClientSession
,AbstractFactoryManager
,AbstractServerChannel
,AbstractServerSession
,AbstractSession
,AgentForwardedChannel
,ChannelAgentForwarding
,ChannelDirectTcpip
,ChannelExec
,ChannelForwardedX11
,ChannelSession
,ChannelSession
,ChannelShell
,ChannelSubsystem
,ClientSessionImpl
,DefaultSftpClient.SftpChannelSubsystem
,DirectoryHandle
,FileHandle
,Handle
,PtyCapableChannelSession
,ServerSessionImpl
,SessionHelper
,SshClient
,SshServer
,TcpipClientChannel
,TcpipServerChannel
public interface AttributeRepository
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AttributeRepository.AttributeKey<T>
Type safe key for storage of user attributes.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Collection<AttributeRepository.AttributeKey<?>>
attributeKeys()
<T> T
getAttribute(AttributeRepository.AttributeKey<T> key)
Returns the value of the user-defined attribute.int
getAttributesCount()
static AttributeRepository
ofAttributesMap(java.util.Map<AttributeRepository.AttributeKey<?>,?> attributes)
static <A> AttributeRepository
ofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)
default <T> T
resolveAttribute(AttributeRepository.AttributeKey<T> key)
Attempts to resolve the associated value by going up the store's hierarchy (if any)
-
-
-
Method Detail
-
getAttributesCount
int getAttributesCount()
- Returns:
- Current number of user-defined attributes stored in the repository
-
getAttribute
<T> T getAttribute(AttributeRepository.AttributeKey<T> key)
Returns the value of the user-defined attribute.- Type Parameters:
T
- The generic attribute type- Parameters:
key
- The key of the attribute; must not benull
.- Returns:
null
if there is no value associated with the specified key
-
resolveAttribute
default <T> T resolveAttribute(AttributeRepository.AttributeKey<T> key)
Attempts to resolve the associated value by going up the store's hierarchy (if any)- Type Parameters:
T
- The generic attribute type- Parameters:
key
- The key of the attribute; must not benull
.- Returns:
null
if there is no value associated with the specified key either in this repository or any of its ancestors (if any available)
-
attributeKeys
java.util.Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
- Returns:
- A
Collection
snapshot of all the currently registered attributes in the repository
-
ofKeyValuePair
static <A> AttributeRepository ofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)
-
ofAttributesMap
static AttributeRepository ofAttributesMap(java.util.Map<AttributeRepository.AttributeKey<?>,?> attributes)
-
-