use of org.forgerock.openam.upgrade.UpgradeHttpServletRequest in project OpenAM by OpenRock.
the class UpgradeServiceUtils method getUpgradeHttpServletRequest.
private static IHttpServletRequest getUpgradeHttpServletRequest(String basedir, SSOToken token) throws UpgradeException {
// need to reinitialize the tag swap property map with original install params
IHttpServletRequest requestFromFile = new UpgradeHttpServletRequest(basedir);
try {
Properties foo = ServerConfiguration.getServerInstance(token, WebtopNaming.getLocalServer());
requestFromFile.addParameter(SetupConstants.CONFIG_VAR_ENCRYPTION_KEY, foo.getProperty(Constants.ENC_PWD_PROPERTY));
String dbOption = (String) requestFromFile.getParameterMap().get(SetupConstants.CONFIG_VAR_DATA_STORE);
boolean embedded = dbOption.equals(SetupConstants.SMS_EMBED_DATASTORE);
if (!embedded) {
setUserAndPassword(requestFromFile, basedir);
}
} catch (Exception ex) {
DEBUG.error("Unable to initialise services defaults", ex);
throw new UpgradeException("Unable to initialise services defaults: " + ex.getMessage());
}
return requestFromFile;
}
Aggregations