/** * Uninstalls the data hub configuration and server-side config files from MarkLogic * * @param listener - the callback method to receive status updates */ @Override public void uninstall(HubDeployStatusListener listener) { logger.warn("Uninstalling the Data Hub and Final Databases/Servers from MarkLogic"); HubAppDeployer finalDeployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener, hubConfig.newStagingClient()); finalDeployer.setCommands(buildListOfCommands()); finalDeployer.undeploy(hubConfig.getAppConfig()); }
/** * Installs the data hub configuration and server-side config files into MarkLogic * * @param listener - the callback method to receive status updates */ @Override public void install(HubDeployStatusListener listener) { if (!hubConfig.getHubProject().isInitialized()) { initProject(); } logger.warn("Installing the Data Hub into MarkLogic"); // in AWS setting this fails... // for now putting in try/catch try { AppConfig roleConfig = hubConfig.getAppConfig(); SimpleAppDeployer roleDeployer = new SimpleAppDeployer(getManageClient(), getAdminManager()); roleDeployer.setCommands(getSecurityCommandList()); roleDeployer.deploy(roleConfig); } catch (HttpServerErrorException e) { if (e.getStatusCode() == HttpStatus.SERVICE_UNAVAILABLE) { logger.warn("No manage client for security installs. Assuming DHS provisioning already threre"); } else { throw new DataHubConfigurationException(e); } } HubAppDeployer finalDeployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener, hubConfig.newStagingClient()); finalDeployer.setCommands(buildListOfCommands()); finalDeployer.deploy(hubConfig.getAppConfig()); }
/** * Note that this differs from how "mlUpdateIndexes" works in ml-gradle. This is not stripping out any "non-index" * properties from each payload - it's just updating every database. * * This does however disable forest creation which speeds up the process so that the only calls made are to * update the databases. */ @Override public void updateIndexes() { SimpleAppDeployer deployer = new SimpleAppDeployer(getManageClient(), getAdminManager()); deployer.setCommands(buildCommandMap().get("mlDatabaseCommands")); AppConfig appConfig = hubConfig.getAppConfig(); final boolean originalCreateForests = appConfig.isCreateForests(); final Pattern originalIncludePattern = appConfig.getResourceFilenamesIncludePattern(); try { appConfig.setCreateForests(false); if (hubConfig.getIsProvisionedEnvironment()) { appConfig.setResourceFilenamesIncludePattern(buildPatternForDatabasesToUpdateIndexesFor()); } deployer.deploy(hubConfig.getAppConfig()); } finally { appConfig.setCreateForests(originalCreateForests); appConfig.setResourceFilenamesIncludePattern(originalIncludePattern); } }