Package org.apache.sshd.common
Interface AttributeRepository
-
- All Known Subinterfaces:
AttributeStore,SessionContext
public interface AttributeRepository- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAttributeRepository.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 Collection<AttributeRepository.AttributeKey<?>>attributeKeys()<T> TgetAttribute(AttributeRepository.AttributeKey<T> key)Returns the value of the user-defined attribute.intgetAttributesCount()static AttributeRepositoryofAttributesMap(Map<AttributeRepository.AttributeKey<?>,?> attributes)static <A> AttributeRepositoryofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)default <T> TresolveAttribute(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:
nullif 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:
nullif there is no value associated with the specified key either in this repository or any of its ancestors (if any available)
-
attributeKeys
Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
- Returns:
- A
Collectionsnapshot of all the currently registered attributes in the repository
-
ofKeyValuePair
static <A> AttributeRepository ofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)
-
ofAttributesMap
static AttributeRepository ofAttributesMap(Map<AttributeRepository.AttributeKey<?>,?> attributes)
-
-