|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--wtanaka.praya.gale.KeyCache
Cache for public and private keys. The cache consists of three parts:
Return to
or the Praya Homepage
| Field Summary | |
private java.io.File |
m_confDir
location of ~/.gale/ |
private java.lang.String |
m_defaultDomain
default domain |
private java.util.Hashtable |
m_private
Map of Location (id) into GalePrivateKey |
private java.util.Hashtable |
m_public
Map of Location (id) into GalePublicKey |
private java.io.File |
m_sysDir
location of GALE_SYS_DIR |
private static KeyCache |
s_singleton
|
| Constructor Summary | |
KeyCache()
Constructor |
|
| Method Summary | |
void |
addKey(GalePrivateKey key)
Adds a key to the cache. |
void |
addKey(GalePublicKey key)
Adds a key to the cache. |
private java.lang.String |
generateFilename()
Tries to generate a unique filename. |
static KeyCache |
getInstance()
Returns the singleton instance, instantiating it if it doesn't already exist. |
GalePublicKey |
getKey(java.lang.String id)
Deprecated. use getPublic(Location) instead. |
GalePrivateKey |
getPrivate(Location id)
Retrieve a private key. |
GalePublicKey |
getPublic(Location id)
Retrieve a public key. |
static java.io.File[] |
getSearchOrderForPrivateKey(Location key,
java.io.File sysDir,
java.io.File confDir)
Generates the list of files to search for a given public key. |
static java.io.File[] |
getSearchOrderForPublicKey(Location key,
java.io.File sysDir,
java.io.File confDir)
Generates the list of files to search for a given public key. |
static java.io.File[] |
getWriteOrderForPrivateKey(Location key,
java.io.File sysDir,
java.io.File confDir)
Generates the list of files to attempt to write a private key to. |
static java.io.File[] |
getWriteOrderForPublicKey(Location key,
java.io.File sysDir,
java.io.File confDir)
Generates the list of files to attempt to write a public key to. |
private static java.lang.String |
hexEncode(byte[] bytes)
|
private static void |
initSingleton()
Helper method which ensures that the singleton instance is instantiated. |
GalePrivateKey |
removePrivateFromMemory(Location id)
Removes a key from the memory cache. |
GalePublicKey |
removePublicFromMemory(Location id)
Removes a key from the memory cache. |
void |
setConfDir(java.io.File confDir)
Sets the ~/.gale/ directory |
void |
setDefaultDomain(java.lang.String defaultDomain)
sets the default domain for locations |
void |
setSysDir(java.io.File sysDir)
Sets the GALE_SYS_DIR directory |
void |
waitForFirstPublic(long timeout,
Location[] id)
Waits for the first of the given keys to come back for a maximum of timeout milliseconds. |
void |
waitForPublic(long timeout,
Location id)
Waits for a single public key. |
void |
waitForPublic(long timeout,
java.lang.String id)
Deprecated. use waitForPublic (long, Location) instead. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static KeyCache s_singleton
private java.util.Hashtable m_public
private java.util.Hashtable m_private
private java.io.File m_sysDir
private java.io.File m_confDir
private java.lang.String m_defaultDomain
| Constructor Detail |
public KeyCache()
| Method Detail |
private static void initSingleton()
public static KeyCache getInstance()
private static final java.lang.String hexEncode(byte[] bytes)
private java.lang.String generateFilename()
public void addKey(GalePublicKey key)
public void addKey(GalePrivateKey key)
public GalePublicKey removePublicFromMemory(Location id)
public GalePrivateKey removePrivateFromMemory(Location id)
public GalePublicKey getKey(java.lang.String id)
public GalePublicKey getPublic(Location id)
public GalePrivateKey getPrivate(Location id)
id - the location for which this method should retrieve a
private key.public void setDefaultDomain(java.lang.String defaultDomain)
public void setSysDir(java.io.File sysDir)
public void setConfDir(java.io.File confDir)
public void waitForPublic(long timeout,
java.lang.String id)
public void waitForPublic(long timeout,
Location id)
public void waitForFirstPublic(long timeout,
Location[] id)
public static java.io.File[] getSearchOrderForPublicKey(Location key,
java.io.File sysDir,
java.io.File confDir)
public static java.io.File[] getSearchOrderForPrivateKey(Location key,
java.io.File sysDir,
java.io.File confDir)
public static java.io.File[] getWriteOrderForPublicKey(Location key,
java.io.File sysDir,
java.io.File confDir)
public static java.io.File[] getWriteOrderForPrivateKey(Location key,
java.io.File sysDir,
java.io.File confDir)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||