| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
DataHubImpl() |
DataHubImpl(com.marklogic.hub.HubClient hubClient)
Only use this constructor for the clearUserData operation, which does not depend on a HubConfig.
|
DataHubImpl(HubConfig hubConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
java.util.Map<java.lang.String,java.util.List<com.marklogic.appdeployer.command.Command>> |
buildCommandMap() |
java.util.List<com.marklogic.appdeployer.command.Command> |
buildCommandsForDeployingToReplica() |
java.util.List<com.marklogic.appdeployer.command.Command> |
buildListOfCommands() |
protected java.util.regex.Pattern |
buildPatternForDatabasesToUpdateIndexesFor()
In a provisioned environment, only the databases defined by this pattern can be updated.
|
void |
clearUserArtifacts() |
void |
clearUserData()
Clear "user data", which is anything that's not a user or hub artifact.
|
void |
clearUserModules()
Removes user's modules from the modules db
|
void |
clearUserModules(java.util.List<java.lang.String> resourceNamesToNotDelete) |
void |
clearUserSchemas() |
protected com.marklogic.mgmt.resource.appservers.ServerManager |
constructServerManager(HubConfig hubConfig)
Need to account for the group name in case the user has overridden the name of the "Default" group.
|
protected void |
disableSomeCmaUsage(com.marklogic.appdeployer.AppConfig appConfig)
Turns off CMA for some resources that have bbugs in ML 9.0-7/8.
|
FlowRunner |
getFlowRunner()
Creates and returns the FlowRunner object using the datahub's autowired hubconfig
|
HubConfig |
getHubConfig() |
java.lang.String |
getPortInUseBy(com.marklogic.hub.DatabaseKind kind)
Returns name of what is using the port
|
java.util.List<com.marklogic.appdeployer.command.Command> |
getSecurityCommandList() |
java.lang.String |
getServerVersion()
Returns the string presentation of the server version, eg: "9.03-1"
|
void |
initProject()
Initializes the project on disk, creates scaffold project code
|
void |
install()
Installs the data hub configuration and server-side config files into MarkLogic
|
InstallInfo |
isInstalled()
Determines if the data hub is installed in MarkLogic
|
boolean |
isPortInUse(com.marklogic.hub.DatabaseKind kind)
Checks to see if the port is in use
|
boolean |
isSafeToInstall()
Checks to make sure all the versions and database in a valid configuration with version check
Must be run as a user with sufficient privileges to install a data hub.
|
boolean |
isServerVersionOk()
Checks to see if the datahub and server versions are compatible
|
boolean |
isServerVersionValid(java.lang.String versionString)
Validates the MarkLogic server to ensure compatibility with the hub
|
protected void |
prepareProjectBeforeUpgrading(HubProject hubProject,
java.lang.String newDataHubVersion)
The expectation is that a user has upgraded build.gradle to use a newer version of DHF but has not yet updated
mlDHFVersion in gradle.properties.
|
java.util.Map<java.lang.String,java.lang.Object> |
runPreInstallCheck()
Runs the pre-install check for the datahub populating the object
with variables necessary to perform the install.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
runPreInstallCheck(com.marklogic.mgmt.resource.appservers.ServerManager serverManager)
This overloaded version was added to facilitate mock testing - i.e.
|
void |
setHubConfig(HubConfigImpl hubConfig) |
void |
setVersions(Versions versions) |
void |
updateIndexes()
Note that this differs from how "mlUpdateIndexes" works in ml-gradle.
|
boolean |
upgradeHub()
Upgrades the installed datahub on the server to this version of the DataHub
Must be run as a user with sufficient privileges to install a data hub.
|
protected void |
verifyLocalProjectIs430OrGreater()
Per DHFPROD-4912, instead of depending on mlDHFVersion, this logic takes advantage of the fact that the
hub-internal-config triggers - including ml-dh-entity-create.json - had their permissions modified in the 4.3.0
release.
|
public DataHubImpl()
public DataHubImpl(HubConfig hubConfig)
public DataHubImpl(com.marklogic.hub.HubClient hubClient)
hubClient - public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprotected com.marklogic.mgmt.resource.appservers.ServerManager constructServerManager(HubConfig hubConfig)
hubConfig - hubConfig objectpublic FlowRunner getFlowRunner()
DataHubgetFlowRunner in interface DataHubpublic InstallInfo isInstalled() throws org.springframework.web.client.ResourceAccessException
DataHubisInstalled in interface DataHuborg.springframework.web.client.ResourceAccessExceptionpublic boolean isServerVersionValid(java.lang.String versionString)
DataHubisServerVersionValid in interface DataHubversionString - - the version of the server to validatepublic void initProject()
DataHubinitProject in interface DataHubpublic void clearUserModules()
DataHubclearUserModules in interface DataHubpublic void clearUserModules(java.util.List<java.lang.String> resourceNamesToNotDelete)
resourceNamesToNotDelete - optional list of names of resources that should not be deleted; can be null;
introduced for the sake of DHF tests so that marklogic-unit-test will not be deletedpublic void clearUserArtifacts()
public java.util.List<com.marklogic.appdeployer.command.Command> buildListOfCommands()
public java.util.List<com.marklogic.appdeployer.command.Command> getSecurityCommandList()
public java.util.Map<java.lang.String,java.lang.Object> runPreInstallCheck()
DataHubrunPreInstallCheck in interface DataHubprotected java.util.Map<java.lang.String,java.lang.Object> runPreInstallCheck(com.marklogic.mgmt.resource.appservers.ServerManager serverManager)
serverManager - public void install()
protected void disableSomeCmaUsage(com.marklogic.appdeployer.AppConfig appConfig)
appConfig - public void updateIndexes()
updateIndexes in interface DataHubprotected java.util.regex.Pattern buildPatternForDatabasesToUpdateIndexesFor()
public java.util.List<com.marklogic.appdeployer.command.Command> buildCommandsForDeployingToReplica()
public java.util.Map<java.lang.String,java.util.List<com.marklogic.appdeployer.command.Command>> buildCommandMap()
public boolean isSafeToInstall()
DataHubisSafeToInstall in interface DataHubpublic boolean isPortInUse(com.marklogic.hub.DatabaseKind kind)
DataHubisPortInUse in interface DataHubkind - - the DatabaseKind enum value (ex STAGING or JOB)public java.lang.String getPortInUseBy(com.marklogic.hub.DatabaseKind kind)
DataHubgetPortInUseBy in interface DataHubkind - - the DatabaseKind enum value (ex STAGING or JOB)public boolean isServerVersionOk()
DataHubisServerVersionOk in interface DataHubpublic java.lang.String getServerVersion()
DataHubgetServerVersion in interface DataHubpublic boolean upgradeHub()
DataHubupgradeHub in interface DataHubprotected void verifyLocalProjectIs430OrGreater()
protected void prepareProjectBeforeUpgrading(HubProject hubProject, java.lang.String newDataHubVersion) throws java.io.IOException
hubProject - newDataHubVersion - java.io.IOExceptionpublic void setHubConfig(HubConfigImpl hubConfig)
public HubConfig getHubConfig()
public void setVersions(Versions versions)
public void clearUserData()
public void clearUserSchemas()