public class DeployHubDatabaseCommand
extends com.marklogic.appdeployer.command.databases.DeployDatabaseCommand
Constructor and Description |
---|
DeployHubDatabaseCommand(HubConfig hubConfig,
java.io.File databaseFile,
java.lang.String databaseFilename)
In order for sorting to work correctly via DeployDatabaseCommandComparator, must call setDatabaseFile so that
the parent getPayload method is able to find the correct File to read from.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(com.marklogic.appdeployer.command.CommandContext context) |
protected java.lang.String |
getPayload(com.marklogic.appdeployer.command.CommandContext context) |
boolean |
isRemoveSchemaAndTriggersDatabaseSettings() |
protected com.fasterxml.jackson.databind.node.ObjectNode |
mergePayloadWithEntityConfigFileIfItExists(com.marklogic.appdeployer.command.CommandContext context,
com.fasterxml.jackson.databind.node.ObjectNode payloadNode)
When either staging-database.json or final-database.json is processed (and in the case of staging-database.json,
it could be under the hub config or user config directory), need to check to see if a same-named file is in the
entity config directory, where entity-specific database configuration is written.
|
protected java.lang.String |
preparePayloadBeforeSubmitting(com.marklogic.appdeployer.command.CommandContext context,
java.lang.String payload) |
void |
setMergeEntityConfigFiles(boolean mergeEntityConfigFiles) |
void |
setMergeExistingArrayProperties(boolean mergeExistingArrayProperties) |
void |
setRemoveSchemaAndTriggersDatabaseSettings(boolean removeSchemaAndTriggersDatabaseSettings) |
buildDefaultDatabasePayload, buildDeployForestsCommand, buildPayload, buildPayloadForSaving, customForestsExist, deploySubDatabases, getDatabaseFilename, getDatabaseName, getDatabasesToNotUndeploy, getDeployForestsCommand, getForestDeleteLevel, getForestFilename, getForestsPerHost, getSuperDatabaseName, getUndoSortOrder, isCheckForCustomForests, isCreateDatabaseWithoutFile, isCreateForestsOnEachHost, isPostponeForestCreation, isSubDatabase, newDatabaseManageForDeleting, setCheckForCustomForests, setCreateDatabaseWithoutFile, setCreateForestsOnEachHost, setDatabaseFile, setDatabaseFilename, setDatabaseName, setDatabasesToNotUndeploy, setDeployDatabaseCommandFactory, setForestFilename, setForestsPerHost, setPayload, setPostponeForestCreation, setSubDatabase, setSuperDatabaseName, setUndoSortOrder, shouldCreateForests, toString, undo
adjustPayloadBeforeSavingResource, adjustResourceManagerForPayload, afterResourceSaved, cmaEndpointExists, convertPayloadToObjectNode, convertXmlPayloadToJsonIfNecessary, copyFileToString, copyFileToString, deployConfiguration, determineDatabaseNameForDatabaseResourceDirectory, getBiPredicateForMergingResources, getContextKeyForResourcesToSave, getExecuteSortOrder, getPayloadParser, getResourceClassType, getResourceFilenameFilter, getResourceIdPropertyName, isStoreResourceIdsAsCustomTokens, isSupportsResourceMerging, listFilesInDirectory, logResourceDirectoryNotFound, mergeResources, readResourceFromFile, resourceMergingIsSupported, saveMergedResources, saveResource, saveResource, setExecuteSortOrder, setFilenamesToIgnore, setIncrementalMode, setPayloadTokenReplacer, setResourceClassType, setResourceFilenameFilter, setResourceFilenamesExcludePattern, setResourceFilenamesIncludePattern, setResourceIdPropertyName, setStoreResourceIdsAsCustomTokens, setSupportsResourceMerging, storeResourceInCommandContextMap, storeTokenForResourceId
public DeployHubDatabaseCommand(HubConfig hubConfig, java.io.File databaseFile, java.lang.String databaseFilename)
Otherwise, if this class only has a filename, the parent getPayload method will check every ConfigDir to find a match, with the last one winning. In the case of DHF, that means the user config directory. This can be a problem, as a user is not likely to define schema-database/triggers-database in e.g. a staging-database.json file in the user config directory. That will then cause the ordering of database commands to be incorrect, which will likely cause an error when databases are deployed and they don't yet exist.
hubConfig
- a hubConfig objectdatabaseFile
- database file objectdatabaseFilename
- name of the database filepublic void execute(com.marklogic.appdeployer.command.CommandContext context)
execute
in interface com.marklogic.appdeployer.command.Command
execute
in class com.marklogic.appdeployer.command.databases.DeployDatabaseCommand
protected java.lang.String getPayload(com.marklogic.appdeployer.command.CommandContext context)
getPayload
in class com.marklogic.appdeployer.command.databases.DeployDatabaseCommand
protected java.lang.String preparePayloadBeforeSubmitting(com.marklogic.appdeployer.command.CommandContext context, java.lang.String payload)
protected com.fasterxml.jackson.databind.node.ObjectNode mergePayloadWithEntityConfigFileIfItExists(com.marklogic.appdeployer.command.CommandContext context, com.fasterxml.jackson.databind.node.ObjectNode payloadNode) throws java.io.IOException
payloadNode
- java.io.IOException
public void setMergeEntityConfigFiles(boolean mergeEntityConfigFiles)
public void setRemoveSchemaAndTriggersDatabaseSettings(boolean removeSchemaAndTriggersDatabaseSettings)
public boolean isRemoveSchemaAndTriggersDatabaseSettings()
public void setMergeExistingArrayProperties(boolean mergeExistingArrayProperties)