Package org.glassfish.api.admin
Interface PasswordAliasStore
-
@Contract public interface PasswordAliasStore
Represents a fully-functional password alias store.If the implementation holds the aliases and passwords in memory, it handles loading and saving the in-memory contents from and to persistent storage, at the discretion of the implementer. For example, loading would typically happen when the password alias store implementation is first instantiated, although an implementation could choose to load lazily on first read. Saving is at the discretion of the implementer as well, although to maximize reliability the implementation should persist changes as they occur. The
) methods can help optimize that.
- Author:
- tjquinn
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Deletes all password aliases from the store.boolean
containsKey(String alias)
Reports whether the store contains the specified alias.char[]
get(String alias)
Returns the password associated with the specified alias.boolean
isEmpty()
Reports whether the alias store is empty.Iterator<String>
keys()
Returns an Iterator over aliases present in the alias store.void
put(String alias, char[] password)
Insert a new alias with the specified password, or assigns a new password to an existing alias.void
putAll(Map<String,char[]> settings)
Adds a group of alias/password pairs in a single operation.void
putAll(PasswordAliasStore otherStore)
Adds all alias/password pairs from the specified store to this store.void
remove(String alias)
Removes the specified alias (and the associated password) from the password alias store.int
size()
Reports the number of aliases present in the store.
-
-
-
Method Detail
-
containsKey
boolean containsKey(String alias)
Reports whether the store contains the specified alias.- Parameters:
alias
- the alias to check for- Returns:
- true if the alias appears in the store; false otherwise
-
get
char[] get(String alias)
Returns the password associated with the specified alias.- Parameters:
alias
- the alias of interest- Returns:
- the password for that alias, if the store contains the alias; null otherwise
-
isEmpty
boolean isEmpty()
Reports whether the alias store is empty.- Returns:
-
size
int size()
Reports the number of aliases present in the store.- Returns:
-
clear
void clear()
Deletes all password aliases from the store.
-
put
void put(String alias, char[] password)
Insert a new alias with the specified password, or assigns a new password to an existing alias.- Parameters:
alias
- the alias to create or reassignpassword
- the password to be associated with the alias
-
putAll
void putAll(PasswordAliasStore otherStore)
Adds all alias/password pairs from the specified store to this store.- Parameters:
otherStore
- the alias store from which to get entries
-
putAll
void putAll(Map<String,char[]> settings)
Adds a group of alias/password pairs in a single operation.Callers might prefer to invoke this method once rather than invoking
) repeatedly, for example if an implementation persists each change as it is made.
- Parameters:
settings
- the alias/password pairs to add
-
remove
void remove(String alias)
Removes the specified alias (and the associated password) from the password alias store.- Parameters:
alias
- the alias to be removed
-
-