Search in sources :

Example 1 with UpgradeHttpServletRequest

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;
}
Also used : UpgradeException(org.forgerock.openam.upgrade.UpgradeException) IHttpServletRequest(com.sun.identity.setup.IHttpServletRequest) Properties(java.util.Properties) SystemProperties(com.iplanet.am.util.SystemProperties) UpgradeException(org.forgerock.openam.upgrade.UpgradeException) IOException(java.io.IOException) UpgradeHttpServletRequest(org.forgerock.openam.upgrade.UpgradeHttpServletRequest)

Aggregations

SystemProperties (com.iplanet.am.util.SystemProperties)1 IHttpServletRequest (com.sun.identity.setup.IHttpServletRequest)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 UpgradeException (org.forgerock.openam.upgrade.UpgradeException)1 UpgradeHttpServletRequest (org.forgerock.openam.upgrade.UpgradeHttpServletRequest)1