| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
static java.lang.String |
MIN_UPGRADE_VERSION |
| Constructor and Description |
|---|
DataHubImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<com.marklogic.appdeployer.command.Command> |
buildCommandListForDeployingToDhs() |
java.util.Map<java.lang.String,java.util.List<com.marklogic.appdeployer.command.Command>> |
buildCommandMap() |
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 |
clearDatabase(java.lang.String database)
Clears the database of all documents
|
void |
clearUserModules()
Removes user's modules from the modules db
|
protected com.marklogic.mgmt.resource.appservers.ServerManager |
constructServerManager(com.marklogic.mgmt.ManageClient manageClient,
HubConfig hubConfig)
Need to account for the group name in case the user has overridden the name of the "Default" group.
|
void |
deleteDocument(java.lang.String uri,
DatabaseKind databaseKind)
Deletes document based on supplied doc uri in supplied database
|
void |
deployToDhs(HubDeployStatusListener listener)
Install user project files into a DHS instance.
|
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
|
java.lang.String |
getPortInUseBy(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
|
void |
install(HubDeployStatusListener listener)
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(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 |
prepareAppConfigForDeployingToDhs(HubConfig hubConfig) |
protected void |
prepareProjectBeforeUpgrading(HubProject hubProject,
java.lang.String currentDhfVersion)
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.HashMap<java.lang.String,java.lang.Boolean> |
runPreInstallCheck()
Runs the pre-install check for the datahub populating the object
with variables necessary to perform the install.
|
void |
setHubConfig(HubConfigImpl hubConfig) |
protected void |
setKnownValuesForDhsDeployment(HubConfig hubConfig)
Per DHFPROD-2897, these are known values in a DHS installation that can be set so that they override any changes
the user may have made for their on-premise installation.
|
void |
setPortInUseBy(DatabaseKind kind,
java.lang.String usedBy)
Sets what appserver name is using the port
|
void |
setServerManager(com.marklogic.mgmt.resource.appservers.ServerManager manager) |
void |
setServerVersion(java.lang.String serverVersion)
Sets the server version holder on the datahub object - currently unused
|
void |
setServerVersionOk(boolean serverVersionOk)
Sets true or false if the server version is okay with this version of DHF
|
void |
setVersions(Versions versions) |
void |
uninstall()
Uninstalls the data hub configuration and server-side config files from MarkLogic
|
void |
uninstall(HubDeployStatusListener listener)
Uninstalls the data hub configuration and server-side config files from MarkLogic
|
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.
|
void |
wireClient() |
protected final org.slf4j.Logger logger
public static java.lang.String MIN_UPGRADE_VERSION
@PostConstruct public void wireClient()
protected com.marklogic.mgmt.resource.appservers.ServerManager constructServerManager(com.marklogic.mgmt.ManageClient manageClient,
HubConfig hubConfig)
manageClient - manageClient objecthubConfig - hubConfig objectpublic void clearDatabase(java.lang.String database)
DataHubclearDatabase in interface DataHubdatabase - - the name of the database in string formpublic void setServerManager(com.marklogic.mgmt.resource.appservers.ServerManager manager)
public 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 deleteDocument(java.lang.String uri,
DatabaseKind databaseKind)
DataHubdeleteDocument in interface DataHuburi - - document uridatabaseKind - - database typepublic java.util.List<com.marklogic.appdeployer.command.Command> buildListOfCommands()
public java.util.List<com.marklogic.appdeployer.command.Command> getSecurityCommandList()
public java.util.HashMap<java.lang.String,java.lang.Boolean> runPreInstallCheck()
DataHubrunPreInstallCheck in interface DataHubpublic void install()
public void install(HubDeployStatusListener listener)
protected void disableSomeCmaUsage(com.marklogic.appdeployer.AppConfig appConfig)
appConfig - public void deployToDhs(HubDeployStatusListener listener)
DataHubdeployToDhs in interface DataHubprotected void prepareAppConfigForDeployingToDhs(HubConfig hubConfig)
protected void setKnownValuesForDhsDeployment(HubConfig hubConfig)
hubConfig - protected java.util.List<com.marklogic.appdeployer.command.Command> buildCommandListForDeployingToDhs()
public void updateIndexes()
updateIndexes in interface DataHubprotected java.util.regex.Pattern buildPatternForDatabasesToUpdateIndexesFor()
public void uninstall()
public void uninstall(HubDeployStatusListener listener)
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(DatabaseKind kind)
DataHubisPortInUse in interface DataHubkind - - the DatabaseKind enum value (ex STAGING or JOB)public void setPortInUseBy(DatabaseKind kind, java.lang.String usedBy)
DataHubsetPortInUseBy in interface DataHubkind - - the DatabaseKind enum value (ex STAGING or JOB)usedBy - - string name of what is using the portpublic java.lang.String getPortInUseBy(DatabaseKind kind)
DataHubgetPortInUseBy in interface DataHubkind - - the DatabaseKind enum value (ex STAGING or JOB)public boolean isServerVersionOk()
DataHubisServerVersionOk in interface DataHubpublic void setServerVersionOk(boolean serverVersionOk)
DataHubsetServerVersionOk in interface DataHubserverVersionOk - - true if it compatible or false if it is notpublic java.lang.String getServerVersion()
DataHubgetServerVersion in interface DataHubpublic void setServerVersion(java.lang.String serverVersion)
DataHubsetServerVersion in interface DataHubserverVersion - - server version as a string, eg: "9.03-1"public boolean upgradeHub()
throws CantUpgradeException
DataHubupgradeHub in interface DataHubCantUpgradeException - - exception thrown when an upgrade can't happenprotected void prepareProjectBeforeUpgrading(HubProject hubProject, java.lang.String currentDhfVersion) throws java.io.IOException
hubProject - currentDhfVersion - java.io.IOExceptionpublic void setHubConfig(HubConfigImpl hubConfig)
public void setVersions(Versions versions)