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
  • 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)