Top Inners Methods
org.apache.sshd.common

public Interface AttributeRepository

Known Direct Subinterfaces
org.apache.sshd.common.AttributeStore
Imports
java.util.Collection, .Collections, .HashSet, .Map, .Objects, org.apache.sshd.common.util.MapEntryUtils

Author
Apache MINA SSHD Project

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AttributeRepository.AttributeKey<
type of value stored in the attribute.
T
>

Type safe key for storage of user attributes.

Method Summary

Modifier and TypeMethod and Description
public Collection<AttributeRepository.AttributeKey<?>>

Returns:

A Collection snapshot of all the currently registered attributes in the repository
attributeKeys
()

public <
The generic attribute type
T
>
T

Returns:

null if there is no value associated with the specified key
getAttribute
(AttributeRepository.AttributeKey<T>
The key of the attribute; must not be null.
key
)

Returns the value of the user-defined attribute.

public int

Returns:

Current number of user-defined attributes stored in the repository
getAttributesCount
()

public static AttributeRepository
public static <A> AttributeRepository
public default <
The generic attribute type
T
>
T

Returns:

null if there is no value associated with the specified key either in this repository or any of its ancestors (if any available)
resolveAttribute
(AttributeRepository.AttributeKey<T>
The key of the attribute; must not be null.
key
)

Attempts to resolve the associated value by going up the store's hierarchy (if any)

Method Detail

attributeKeysback to summary
public Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
Returns:Collection<AttributeRepository.AttributeKey<?>>

A Collection snapshot of all the currently registered attributes in the repository

getAttributeback to summary
public <T> T getAttribute(AttributeRepository.AttributeKey<T> key)

Returns the value of the user-defined attribute.

Parameters
<T>
The generic attribute type
key:AttributeRepository.AttributeKey<T>

The key of the attribute; must not be null.

Returns:T

null if there is no value associated with the specified key

getAttributesCountback to summary
public int getAttributesCount()
Returns:int

Current number of user-defined attributes stored in the repository

ofAttributesMapback to summary
public static AttributeRepository ofAttributesMap(Map<AttributeRepository.AttributeKey<?>, ?> attributes)
ofKeyValuePairback to summary
public static <A> AttributeRepository ofKeyValuePair(AttributeRepository.AttributeKey<A> key, A value)
resolveAttributeback to summary
public default <T> T resolveAttribute(AttributeRepository.AttributeKey<T> key)

Attempts to resolve the associated value by going up the store's hierarchy (if any)

Parameters
<T>
The generic attribute type
key:AttributeRepository.AttributeKey<T>

The key of the attribute; must not be null.

Returns:T

null if there is no value associated with the specified key either in this repository or any of its ancestors (if any available)

org.apache.sshd.common back to summary

public Class AttributeRepository.AttributeKey<T>

extends Object
Class Inheritance
Type Parameters
<T>
type of value stored in the attribute.

Type safe key for storage of user attributes. Typically it is used as a static variable that is shared between the producer and the consumer. To further restrict access the setting or getting it from the store one can add static get/set methods e.g:

public static final AttributeKey<MyValue> MY_KEY = new AttributeKey<MyValue>();

public static MyValue getMyValue(Session s) {
  return s.getAttribute(MY_KEY);
}

public static void setMyValue(Session s, MyValue value) {
  s.setAttribute(MY_KEY, value);
}

Author
Apache MINA SSHD Project

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AttributeKeyback to summary
public AttributeKey()