Class JCEKSPasswordAliasStore
- java.lang.Object
-
- org.glassfish.security.services.impl.JCEKSPasswordAliasStore
-
- All Implemented Interfaces:
org.glassfish.api.admin.PasswordAliasStore
- Direct Known Subclasses:
JCEKSDomainPasswordAliasStore
public class JCEKSPasswordAliasStore extends Object implements org.glassfish.api.admin.PasswordAliasStore
Provides the PasswordAliasStore behavior using a JCEKS keystore.The keystore is actually managed by the PasswordAdapter, to which this implementation currently delegates its work.
Note that this service is currently per-lookup. This is so that each use of the alias store gets the current on-disk information. Ideally we can change this when we can use Java 7 features, including the WatchService feature.
This class's methods are not synchronized because the PasswordAdapter's methods are. If this implementation changes so that it no longer delegates to those synchronized PasswordAdapter methods, then make sure that the implementation is thread-safe.
Note that the domain-scoped password alias store service class extends this class. As a service, that class will be instantiated using the no-args constructor. So the actual initialization of the class occurs in the init method. The domain-scoped service class invokes the init method itself. Any code that needs to create some other alias store can use the newInstance method to provide the location of the alias store file and the password.
- Author:
- tjquinn
-
-
Constructor Summary
Constructors Constructor Description JCEKSPasswordAliasStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(String alias)char[]get(String alias)protected voidinit(String pathToAliasStore, char[] storePassword)booleanisEmpty()Iterator<String>keys()static JCEKSPasswordAliasStorenewInstance(String pathToAliasStore, char[] storePassword)voidput(String alias, char[] password)voidputAll(Map<String,char[]> settings)voidputAll(org.glassfish.api.admin.PasswordAliasStore otherStore)voidremove(String alias)intsize()
-
-
-
Method Detail
-
init
protected final void init(String pathToAliasStore, char[] storePassword)
-
newInstance
public static JCEKSPasswordAliasStore newInstance(String pathToAliasStore, char[] storePassword)
-
clear
public void clear()
- Specified by:
clearin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
put
public void put(String alias, char[] password)
- Specified by:
putin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
putAll
public void putAll(org.glassfish.api.admin.PasswordAliasStore otherStore)
- Specified by:
putAllin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
putAll
public void putAll(Map<String,char[]> settings)
- Specified by:
putAllin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
remove
public void remove(String alias)
- Specified by:
removein interfaceorg.glassfish.api.admin.PasswordAliasStore
-
containsKey
public boolean containsKey(String alias)
- Specified by:
containsKeyin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
get
public char[] get(String alias)
- Specified by:
getin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
keys
public Iterator<String> keys()
- Specified by:
keysin interfaceorg.glassfish.api.admin.PasswordAliasStore
-
size
public int size()
- Specified by:
sizein interfaceorg.glassfish.api.admin.PasswordAliasStore
-
-