23 package org.sleuthkit.autopsy.centralrepository.datamodel;
25 import java.util.HashMap;
27 import java.util.logging.Level;
42 private static final String
PASSWORD_KEY =
"db.postgresql.password";
44 private static final String
PORT_KEY =
"db.postgresql.port";
45 private static final String
USER_KEY =
"db.postgresql.user";
46 private static final String
DBNAME_KEY =
"db.postgresql.dbName";
47 private static final String
HOST_KEY =
"db.postgresql.host";
49 private static final String
MODULE_KEY =
"CentralRepository";
76 if (value == null || value.isEmpty())
83 LOGGER.log(Level.WARNING,
"There was an error in converting central repo postgres settings", e);
103 CaseDbConnectionInfo muConn;
107 LOGGER.log(Level.SEVERE,
"Failed to import settings from multi-user settings.", ex);
139 String passwordHex = keyVals.get(PASSWORD_KEY);
140 if (passwordHex != null) {
145 LOGGER.log(Level.WARNING,
"Failed to convert password from hex text to text.", ex);
149 final String finalPassword = password;
161 Map<String, String> map =
new HashMap<String, String>();
162 map.put(HOST_KEY, settings.
getHost());
163 map.put(PORT_KEY, Integer.toString(settings.
getPort()));
164 map.put(DBNAME_KEY, settings.
getDbName());
170 LOGGER.log(Level.SEVERE,
"Failed to convert password from text to hex text.", ex);
183 return saved.
equals(settings);
void setPassword(String password)
PostgresConnectionSettings loadCustomSettings()
boolean areCustomSettingsChanged(PostgresConnectionSettings settings)
boolean equals(Object obj)
static final String DBNAME_KEY
void setHost(String host)
void setDbName(String dbName)
static CaseDbConnectionInfo getDatabaseConnectionInfo()
static final String MODULE_KEY
CentralRepoPostgresSettingsUtil()
void setBulkThreshold(int bulkThreshold)
void setUserName(String userName)
static synchronized CentralRepoPostgresSettingsUtil getInstance()
static final String USER_KEY
PostgresConnectionSettings loadMultiUserSettings()
void setValOrLog(ValueSetter setter, String value)
static final String PASSWORD_KEY
static CentralRepoPostgresSettingsUtil instance
static synchronized void setConfigSettings(String moduleName, Map< String, String > settings)
void saveCustomSettings(PostgresConnectionSettings settings)
static final Logger LOGGER
synchronized static Logger getLogger(String name)
static final String PORT_KEY
static final String HOST_KEY
static String convertTextToHexText(String property)
static synchronized Map< String, String > getConfigSettings(String moduleName)
static final String BULK_THRESHOLD_KEY
static String convertHexTextToText(String property)