com.openexchange.admin.tools
Class AdminCache
java.lang.Object
com.openexchange.admin.tools.AdminCache
public class AdminCache
- extends java.lang.Object
Method Summary |
void |
closeConfigDBSqlStuff(java.sql.Connection con,
java.sql.PreparedStatement stmt)
|
void |
closeConfigDBSqlStuff(java.sql.Connection con,
java.sql.PreparedStatement stmt,
java.sql.ResultSet rs)
|
void |
closeContextSqlStuff(java.sql.Connection con,
int context_id)
|
void |
closeSimpleConnection(java.sql.Connection con)
|
boolean |
contextAuthenticationDisabled()
|
java.lang.String |
encryptPassword(PasswordMechObject user)
Encrypts password of a PasswordMechObject using the mechanism given
in passwordMech . |
boolean |
existsNamedAccessCombination(java.lang.String name)
|
java.util.HashMap<java.lang.String,UserModuleAccess> |
getAccessCombinationNames()
|
java.lang.String |
getAdminAuthMech(Context ctx)
|
Credentials |
getAdminCredentials(Context ctx)
|
java.sql.Connection |
getConnectionForConfigDB()
|
java.sql.Connection |
getConnectionForContext(int context_id)
|
java.sql.Connection |
getConnectionForContextNoTimeout(int contextId)
|
UserModuleAccess |
getDefaultUserModuleAccess()
return default UserModuleAccess if not specified upon creation |
Credentials |
getMasterCredentials()
|
UserModuleAccess |
getNamedAccessCombination(java.lang.String name)
|
java.lang.String |
getNameForAccessCombination(UserModuleAccess access_combination)
|
java.util.ArrayList<java.lang.String> |
getOXDBInitialQueries()
|
PropertyHandler |
getProperties()
|
java.sql.Connection |
getSimpleSqlConnection(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String driver)
|
void |
initAccessCombinations()
|
void |
initCache()
|
boolean |
isLockdb()
|
boolean |
isMasterAdmin(Credentials auth)
|
boolean |
masterAuthenticationDisabled()
|
static StorageException |
parseDataTruncation(java.sql.DataTruncation dt)
Parses the truncated fields out of the DataTruncation exception and
transforms this to a StorageException. |
boolean |
pushConnectionForConfigDB(java.sql.Connection con)
|
boolean |
pushConnectionForContext(int context_id,
java.sql.Connection con)
|
boolean |
pushConnectionForContextNoTimeout(int contextId,
java.sql.Connection con)
|
void |
removeAdminCredentials(Context ctx)
|
void |
setAdminCredentials(Context ctx,
java.lang.String authMech,
Credentials adminCredentials)
|
void |
setLockdb(boolean lockdb)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATA_TRUNCATION_ERROR_MSG
public static final java.lang.String DATA_TRUNCATION_ERROR_MSG
- See Also:
- Constant Field Values
PATTERN_REGEX_NORMAL
public static final java.lang.String PATTERN_REGEX_NORMAL
- See Also:
- Constant Field Values
PATTERN_REGEX_DELIMITER
public static final java.lang.String PATTERN_REGEX_DELIMITER
- See Also:
- Constant Field Values
PATTERN_REGEX_FUNCTION
public static final java.lang.String PATTERN_REGEX_FUNCTION
- See Also:
- Constant Field Values
AdminCache
public AdminCache()
initCache
public void initCache()
- Throws:
java.lang.ClassNotFoundException
OXGenericException
getDefaultUserModuleAccess
public UserModuleAccess getDefaultUserModuleAccess()
- return default
UserModuleAccess
if not specified upon creation
- Returns:
getAccessCombinationNames
public java.util.HashMap<java.lang.String,UserModuleAccess> getAccessCombinationNames()
getNamedAccessCombination
public UserModuleAccess getNamedAccessCombination(java.lang.String name)
existsNamedAccessCombination
public boolean existsNamedAccessCombination(java.lang.String name)
getNameForAccessCombination
public java.lang.String getNameForAccessCombination(UserModuleAccess access_combination)
initAccessCombinations
public void initAccessCombinations()
throws java.lang.ClassNotFoundException,
OXGenericException
- Throws:
java.lang.ClassNotFoundException
OXGenericException
getMasterCredentials
public Credentials getMasterCredentials()
getProperties
public PropertyHandler getProperties()
getConnectionForContext
public java.sql.Connection getConnectionForContext(int context_id)
throws PoolException
- Throws:
PoolException
getConnectionForContextNoTimeout
public java.sql.Connection getConnectionForContextNoTimeout(int contextId)
throws PoolException
- Throws:
PoolException
pushConnectionForContext
public boolean pushConnectionForContext(int context_id,
java.sql.Connection con)
throws PoolException
- Throws:
PoolException
pushConnectionForContextNoTimeout
public boolean pushConnectionForContextNoTimeout(int contextId,
java.sql.Connection con)
throws PoolException
- Throws:
PoolException
getConnectionForConfigDB
public java.sql.Connection getConnectionForConfigDB()
throws PoolException
- Throws:
PoolException
pushConnectionForConfigDB
public boolean pushConnectionForConfigDB(java.sql.Connection con)
throws PoolException
- Throws:
PoolException
getAdminCredentials
public final Credentials getAdminCredentials(Context ctx)
- Returns:
- the adminCredentials
getAdminAuthMech
public final java.lang.String getAdminAuthMech(Context ctx)
- Returns:
- authMech
setAdminCredentials
public final void setAdminCredentials(Context ctx,
java.lang.String authMech,
Credentials adminCredentials)
- Parameters:
adminCredentials
- the adminCredentials to set
removeAdminCredentials
public final void removeAdminCredentials(Context ctx)
- Parameters:
ctx
-
isLockdb
public final boolean isLockdb()
masterAuthenticationDisabled
public boolean masterAuthenticationDisabled()
contextAuthenticationDisabled
public boolean contextAuthenticationDisabled()
setLockdb
public final void setLockdb(boolean lockdb)
getOXDBInitialQueries
public java.util.ArrayList<java.lang.String> getOXDBInitialQueries()
throws OXGenericException
- Throws:
OXGenericException
getSimpleSqlConnection
public java.sql.Connection getSimpleSqlConnection(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String driver)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
- Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
closeSimpleConnection
public void closeSimpleConnection(java.sql.Connection con)
parseDataTruncation
public static final StorageException parseDataTruncation(java.sql.DataTruncation dt)
- Parses the truncated fields out of the DataTruncation exception and
transforms this to a StorageException.
encryptPassword
public java.lang.String encryptPassword(PasswordMechObject user)
throws StorageException,
java.security.NoSuchAlgorithmException,
java.io.UnsupportedEncodingException
- Encrypts password of a
PasswordMechObject
using the mechanism given
in passwordMech
.
If passwordMech
is null
, the default mechanism as configured
in User.properties
is used and set in the PasswordMechObject
instance.
- Parameters:
user
-
- Returns:
- the encrypted password
- Throws:
StorageException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException
closeConfigDBSqlStuff
public void closeConfigDBSqlStuff(java.sql.Connection con,
java.sql.PreparedStatement stmt,
java.sql.ResultSet rs)
closeConfigDBSqlStuff
public void closeConfigDBSqlStuff(java.sql.Connection con,
java.sql.PreparedStatement stmt)
closeContextSqlStuff
public void closeContextSqlStuff(java.sql.Connection con,
int context_id)
isMasterAdmin
public boolean isMasterAdmin(Credentials auth)