Interface AttributeRepository

All Known Subinterfaces:
AttributeStore, SessionContext

public interface AttributeRepository
Author:
Apache MINA SSHD Project
  • Method Details

    • 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 be null.
      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 be null.
      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

      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(Map<AttributeRepository.AttributeKey<?>,?> attributes)