Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit f1a03e9

Browse files
committed
#403 Removing deprecated features
Will document this in the Wiki
1 parent dd6f62d commit f1a03e9

19 files changed

+45
-622
lines changed

src/main/java/com/marklogic/appdeployer/AppConfig.java

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ public class AppConfig {
149149
// Passed into the PayloadTokenReplacer that subclasses of AbstractCommand use
150150
private Map<String, String> customTokens = new HashMap<>();
151151

152-
@Deprecated
153-
private boolean createTriggersDatabase = false;
154-
155152
// Controls whether forests are created when a database is created
156153
private boolean createForests = true;
157154

@@ -611,18 +608,6 @@ public void setGroupName(String groupName) {
611608
this.groupName = groupName;
612609
}
613610

614-
/**
615-
* As of 3.3.0, this now returns the first ConfigDir in the List of ConfigsDir that this class now maintains.
616-
*
617-
* @return a {@code ConfigDir} instance that defines the location of the configuration directory (where files are
618-
* stored that are then loaded via MarkLogic Management API endpoints) as well as paths to specific
619-
* resources within that directory
620-
*/
621-
@Deprecated
622-
public ConfigDir getConfigDir() {
623-
return getFirstConfigDir();
624-
}
625-
626611
/**
627612
* Starting in 3.3.0, use this when you only care about the first ConfigDir in the List of ConfigDirs maintained by
628613
* this class.
@@ -1315,16 +1300,6 @@ public void setAppServicesTrustManager(X509TrustManager appServicesTrustManager)
13151300
this.appServicesTrustManager = appServicesTrustManager;
13161301
}
13171302

1318-
@Deprecated
1319-
public boolean isCreateTriggersDatabase() {
1320-
return createTriggersDatabase;
1321-
}
1322-
1323-
@Deprecated
1324-
public void setCreateTriggersDatabase(boolean createTriggerDatabase) {
1325-
this.createTriggersDatabase = createTriggerDatabase;
1326-
}
1327-
13281303
public ReplicaBuilderStrategy getReplicaBuilderStrategy() {
13291304
return replicaBuilderStrategy;
13301305
}
@@ -1373,30 +1348,6 @@ public void setSchemaPaths(List<String> schemaPaths) {
13731348
this.schemaPaths = schemaPaths;
13741349
}
13751350

1376-
/**
1377-
* With the 3.13.0 release, this should no longer be used, as it necessarily has to clear out the current list
1378-
* of schema paths in order to set the list to the single path passed in.
1379-
*
1380-
* @param path
1381-
*/
1382-
@Deprecated
1383-
public void setSchemasPath(String path) {
1384-
List<String> paths = new ArrayList<>();
1385-
paths.add(path);
1386-
setSchemaPaths(paths);
1387-
}
1388-
1389-
/**
1390-
* @return the last path in schemaPaths, if any exist
1391-
*/
1392-
@Deprecated
1393-
public String getSchemasPath() {
1394-
if (schemaPaths == null || schemaPaths.isEmpty()) {
1395-
return null;
1396-
}
1397-
return schemaPaths.get(schemaPaths.size() - 1);
1398-
}
1399-
14001351
public boolean isMergeResources() {
14011352
return mergeResources;
14021353
}
@@ -1437,22 +1388,6 @@ public void setCmaConfig(CmaConfig cmaConfig) {
14371388
this.cmaConfig = cmaConfig;
14381389
}
14391390

1440-
// Still used by DHF 4.3.x
1441-
@Deprecated
1442-
public void setDeployForestsWithCma(boolean b) {
1443-
getCmaConfig().setDeployForests(b);
1444-
}
1445-
@Deprecated
1446-
public void setDeployPrivilegesWithCma(boolean b) {
1447-
getCmaConfig().setDeployPrivileges(b);
1448-
}
1449-
@Deprecated
1450-
public void setDeployAmpsWithCma(boolean b) {
1451-
getCmaConfig().setDeployAmps(b);
1452-
}
1453-
// End of methods still used by DHF 4.3.x
1454-
1455-
14561391
public boolean isRestUseDefaultKeystore() {
14571392
return restUseDefaultKeystore;
14581393
}

src/main/java/com/marklogic/appdeployer/ConfigDir.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public class ConfigDir {
2121

2222
private String restApiPath = "rest-api.json";
2323

24-
@Deprecated
25-
private List<File> contentDatabaseFiles;
26-
2724
private File projectDir;
2825

2926
public static ConfigDir withProjectDir(File projectDir) {
@@ -43,7 +40,6 @@ public ConfigDir(File baseDir) {
4340

4441
public void setBaseDir(File baseDir) {
4542
this.baseDir = baseDir;
46-
initializeContentDatabaseFiles();
4743
}
4844

4945
public File getDatabasesDir() {
@@ -65,12 +61,6 @@ public List<File> getDatabaseResourceDirectories() {
6561
return new ArrayList<>();
6662
}
6763

68-
@Deprecated
69-
protected void initializeContentDatabaseFiles() {
70-
contentDatabaseFiles = new ArrayList<>();
71-
contentDatabaseFiles.add(new File(getDatabasesDir(), defaultContentDatabaseFilename));
72-
}
73-
7464
public File getRestApiFile() {
7565
return new File(baseDir, restApiPath);
7666
}
@@ -242,16 +232,6 @@ public File getBaseDir() {
242232
return baseDir;
243233
}
244234

245-
@Deprecated
246-
public List<File> getContentDatabaseFiles() {
247-
return contentDatabaseFiles;
248-
}
249-
250-
@Deprecated
251-
public void setContentDatabaseFiles(List<File> contentDatabaseFiles) {
252-
this.contentDatabaseFiles = contentDatabaseFiles;
253-
}
254-
255235
public String getDefaultContentDatabaseFilename() {
256236
return defaultContentDatabaseFilename;
257237
}

src/main/java/com/marklogic/appdeployer/DefaultAppConfigFactory.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public AppConfig newAppConfig() {
4242
}
4343
}
4444

45-
setDefaultsForDatabasesWithForestsOnOneHost(appConfig);
46-
4745
return appConfig;
4846
}
4947

@@ -875,32 +873,6 @@ protected ConfigDir buildConfigDir(String path) {
875873
return new ConfigDir(baseDir);
876874
}
877875

878-
/**
879-
* This was added in 3.11.0 to mirror the functionality of the now-deprecated DeployTriggersDatabaseCommand and
880-
* DeploySchemasDatabaseCommand classes. But the mlDatabasesWithForestsOnOneHost property is the better way of
881-
* handling this so that it's explicitly configured, rather than happening magically via setting mlAppName.
882-
*
883-
* @param appConfig
884-
*/
885-
@Deprecated
886-
protected void setDefaultsForDatabasesWithForestsOnOneHost(AppConfig appConfig) {
887-
Set<String> set = appConfig.getDatabasesWithForestsOnOneHost();
888-
if (set == null || set.isEmpty()) {
889-
set = new HashSet<>();
890-
final String triggersName = appConfig.getTriggersDatabaseName();
891-
if (triggersName != null) {
892-
set.add(triggersName);
893-
}
894-
final String schemasName = appConfig.getSchemasDatabaseName();
895-
if (schemasName != null) {
896-
set.add(schemasName);
897-
}
898-
if (!set.isEmpty()) {
899-
appConfig.setDatabasesWithForestsOnOneHost(set);
900-
}
901-
}
902-
}
903-
904876
protected List<String> buildPathListFromCommaDelimitedString(String prop) {
905877
String[] paths = prop.split(",");
906878
List<String> list = new ArrayList<>();

src/main/java/com/marklogic/appdeployer/command/SortOrderConstants.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public abstract class SortOrderConstants {
2727
// then the forests will be created on the correct hosts.
2828
public static Integer ASSIGN_HOSTS_TO_GROUPS = 95;
2929

30-
@Deprecated
31-
public static Integer DEPLOY_TRIGGERS_DATABASE = 100;
32-
@Deprecated
33-
public static Integer DEPLOY_SCHEMAS_DATABASE = 100;
34-
3530
public static Integer DEPLOY_OTHER_DATABASES = 120;
3631
public static Integer DEPLOY_FORESTS = 150;
3732
public static Integer DEPLOY_PARTITIONS = 170;
@@ -108,14 +103,8 @@ public abstract class SortOrderConstants {
108103
*/
109104
public static Integer DELETE_FOREST_REPLICAS = 8000;
110105

111-
public static Integer DELETE_CONTENT_DATABASES = 8100;
112106
public static Integer DELETE_OTHER_DATABASES = 8120;
113107

114-
@Deprecated
115-
public static Integer DELETE_TRIGGERS_DATABASE = 8140;
116-
@Deprecated
117-
public static Integer DELETE_SCHEMAS_DATABASE = 8160;
118-
119108
public static Integer DELETE_REST_API_SERVERS = 7000;
120109

121110
// Amps can reference roles and databases, so must delete amps before both (and before deleting REST API servers

src/main/java/com/marklogic/appdeployer/command/databases/DeployContentDatabasesCommand.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main/java/com/marklogic/appdeployer/command/databases/DeployOtherDatabasesCommand.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ public List<DatabasePlan> buildDatabasePlans(CommandContext context) {
153153
DatabasePlans databasePlan = new DatabasePlans();
154154

155155
for (ConfigDir configDir : context.getAppConfig().getConfigDirs()) {
156-
addLegacyContentDatabaseFiles(context, configDir, databasePlan);
157156
addDatabaseFiles(context, configDir, databasePlan);
158157
}
159158

@@ -168,42 +167,6 @@ public List<DatabasePlan> buildDatabasePlans(CommandContext context) {
168167
return databasePlans;
169168
}
170169

171-
/**
172-
* This processes the content database files as defined in the ConfigDir object. This approach dates back to the
173-
* 2.0 release of ml-app-deployer, where multiple files could be defined for the content database. Starting in
174-
* 3.14.0, multiple files will be detected and merged automatically for several resources, including database,
175-
* thus rendering this approach unnecessary. But it's being kept for backwards-compatibility purposes.
176-
*
177-
* @param context
178-
* @param configDir
179-
* @param databasePlans
180-
*/
181-
@Deprecated
182-
protected void addLegacyContentDatabaseFiles(CommandContext context, ConfigDir configDir, DatabasePlans databasePlans) {
183-
List<File> files = configDir.getContentDatabaseFiles();
184-
if (files != null && !files.isEmpty()) {
185-
for (File f : files) {
186-
// We're not using listFilesInDirectory, but should still apply the filename filter
187-
if (f != null && f.exists() && getResourceFilenameFilter().accept(f.getParentFile(), f.getName())) {
188-
String payload = copyFileToString(f, context);
189-
String databaseName = payloadParser.getPayloadFieldValue(payload, "database-name", false);
190-
if (databaseName != null) {
191-
if (databasePlans.getMainContentDatabaseName() == null) {
192-
databasePlans.setMainContentDatabaseName(databaseName);
193-
}
194-
if (databasePlans.getDatabasePlanMap().containsKey(databaseName)) {
195-
DatabasePlan ref = databasePlans.getDatabasePlanMap().get(databaseName);
196-
ref.addFile(f);
197-
ref.setMainContentDatabase(true);
198-
} else {
199-
databasePlans.getDatabasePlanMap().put(databaseName, new DatabasePlan(databaseName, f, true));
200-
}
201-
}
202-
}
203-
}
204-
}
205-
}
206-
207170
/**
208171
* @param context
209172
* @param configDir

src/main/java/com/marklogic/appdeployer/command/databases/DeploySchemasDatabaseCommand.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/java/com/marklogic/appdeployer/command/databases/DeployTriggersDatabaseCommand.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)