public abstract class AbstractAuthHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
AUTH_VALUE_MAP_KEY |
static long |
DEFAULT_LOCK_DELAY |
static int |
DEFAULT_LOCK_TRY |
static long |
DEFAULT_LOCK_WAIT |
protected static java.lang.String |
SERVER_ADDRESS_MAP_KEY |
protected static java.lang.String |
USER_NAME_MAP_KEY |
Constructor and Description |
---|
AbstractAuthHelper() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getFileEntries(java.io.File authFile)
Get all the auth entries found in the specified auth file.
|
protected static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getMemoryEntries(java.util.Map<java.lang.String,java.lang.String> authMap)
Get all the auth entries found in the specified auth store in memory.
|
protected static java.util.Map<java.lang.String,java.lang.String> |
getMemoryEntry(java.lang.String userName,
java.lang.String serverAddress,
java.util.Map<java.lang.String,java.lang.String> authMap)
Get the auth entry in the specified auth map that matches the specified
user name and server address.
|
protected static void |
saveFileEntry(java.lang.String userName,
java.lang.String serverAddress,
java.lang.String authValue,
java.io.File authFile,
int lockTry,
long lockDelay,
long lockWait)
Save the specified parameters as an entry into the specified auth file.
|
protected static void |
saveMemoryEntry(java.lang.String userName,
java.lang.String serverAddress,
java.lang.String authValue,
java.util.Map<java.lang.String,java.lang.String> authMap)
Save the specified parameters as an entry into the specified auth map.
|
public static final int DEFAULT_LOCK_TRY
public static final long DEFAULT_LOCK_DELAY
public static final long DEFAULT_LOCK_WAIT
protected static final java.lang.String SERVER_ADDRESS_MAP_KEY
protected static final java.lang.String USER_NAME_MAP_KEY
protected static final java.lang.String AUTH_VALUE_MAP_KEY
protected static java.util.Map<java.lang.String,java.lang.String> getMemoryEntry(java.lang.String userName, java.lang.String serverAddress, java.util.Map<java.lang.String,java.lang.String> authMap)
userName
- userNameserverAddress
- serverAddressauthMap
- authMapprotected static java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMemoryEntries(java.util.Map<java.lang.String,java.lang.String> authMap)
authMap
- authMapprotected static void saveMemoryEntry(java.lang.String userName, java.lang.String serverAddress, java.lang.String authValue, java.util.Map<java.lang.String,java.lang.String> authMap)
userName
- - non-null user nameserverAddress
- - non-null server addressauthValue
- - possibly null auth valueauthMap
- - non-null auth mapprotected static java.util.List<java.util.Map<java.lang.String,java.lang.String>> getFileEntries(java.io.File authFile) throws java.io.IOException
authFile
- authFilejava.io.IOException
- - io exception from reading auth fileprotected static void saveFileEntry(java.lang.String userName, java.lang.String serverAddress, java.lang.String authValue, java.io.File authFile, int lockTry, long lockDelay, long lockWait) throws java.io.IOException
userName
- - non-null user nameserverAddress
- - non-null server addressauthValue
- - possibly null auth valueauthFile
- - non-null filelockTry
- lockTrylockDelay
- lockDelaylockWait
- lockWaitjava.io.IOException
- on error