public class Installer
extends java.lang.Object
To mimic how DHF is installed locally, this installer will first initialize a DHF project in the directory in which the installer is run. Properties will then be read from the gradle.properties and gradle-local.properties files that are generated.
Because those properties are not intended to suffice for installation - specifically, mlUsername and mlPassword are not expected to be set - a client can override any DHF property via JVM props when running the installer. For example:
java -DmlUsername=someuser -PmlPassword=somepassword -jar marklogic-data-hub-(version).jar
Constructor and Description |
---|
Installer(DataHub dataHub,
HubConfigImpl hubConfig) |
Modifier and Type | Method and Description |
---|---|
protected void |
initializeProject(java.io.File projectDir)
The intended use case is that an executable DHF jar can be run from any directory, which means we need to first
initialize a DHF project (specifically, generating the gradle.properties file) and then refresh HubConfig based
on those properties and anything a client passed in via JVM props.
|
void |
install(java.io.File projectDir) |
static void |
main(java.lang.String[] args) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
readJsonFromFile(java.io.File file) |
protected void |
removeEmptyRangeIndexArrayFromFinalDatabaseFile(java.io.File projectDir)
This is needed until DHFPROD-2547 is fixed.
|
protected void |
removePasswordsFromUserFiles(java.io.File projectDir,
HubConfigImpl hubConfig)
If a user already exists, we don't want to overwrite its password.
|
protected void |
writeJsonToFile(com.fasterxml.jackson.databind.node.ObjectNode node,
java.io.File file) |
public Installer(DataHub dataHub, HubConfigImpl hubConfig)
public static void main(java.lang.String[] args)
public void install(java.io.File projectDir)
protected void initializeProject(java.io.File projectDir)
projectDir
- protected void removeEmptyRangeIndexArrayFromFinalDatabaseFile(java.io.File projectDir)
protected void removePasswordsFromUserFiles(java.io.File projectDir, HubConfigImpl hubConfig)
protected com.fasterxml.jackson.databind.node.ObjectNode readJsonFromFile(java.io.File file)
protected void writeJsonToFile(com.fasterxml.jackson.databind.node.ObjectNode node, java.io.File file)