Skip to content

Commit 645849c

Browse files
authored
refactor: removed Mongock wrong references (#392)
1 parent 054f6da commit 645849c

File tree

6 files changed

+13
-24
lines changed

6 files changed

+13
-24
lines changed

core/flamingock-core/src/main/java/io/flamingock/internal/core/configuration/core/CoreConfiguration.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.util.Map;
2323

2424
import static io.flamingock.internal.util.Constants.DEFAULT_LOCK_ACQUIRED_FOR_MILLIS;
25-
import static io.flamingock.internal.util.Constants.DEFAULT_MIGRATION_AUTHOR;
2625
import static io.flamingock.internal.util.Constants.DEFAULT_QUIT_TRYING_AFTER_MILLIS;
2726
import static io.flamingock.internal.util.Constants.DEFAULT_TRY_FREQUENCY_MILLIS;
2827

@@ -32,7 +31,7 @@ public class CoreConfiguration implements CoreConfigurable {
3231

3332

3433
/**
35-
* If false, will disable Mongock. Default true
34+
* If false, will disable Flamingock. Default true
3635
*/
3736
private boolean enabled = true;
3837

@@ -42,18 +41,10 @@ public class CoreConfiguration implements CoreConfigurable {
4241
private String serviceIdentifier = null;
4342

4443
/**
45-
* Map for custom data you want to attach to your migration
44+
* Map for custom data you want to attach to your change
4645
*/
4746
private Map<String, Object> metadata = new HashMap<>();
4847

49-
/**
50-
* From version 5, author is not a mandatory field, but still needed for backward compatibility. This is why Mongock
51-
* has provided this field, so you can set the author once and forget about it.
52-
* <p>
53-
* Default value: default_author
54-
*/
55-
private String defaultAuthor = DEFAULT_MIGRATION_AUTHOR;
56-
5748
public LockConfiguration getLockConfiguration() {
5849
return lockConfiguration;
5950
}
@@ -157,22 +148,22 @@ public static class LockConfiguration {
157148
private long lockAcquiredForMillis = DEFAULT_LOCK_ACQUIRED_FOR_MILLIS;
158149

159150
/**
160-
* The time after what Mongock will quit trying to acquire the lock in case it's acquired by another process.
151+
* The time after what Flamingock will quit trying to acquire the lock in case it's acquired by another process.
161152
* Default 3 minutes.
162153
* Minimum 0, which means won't wait whatsoever.
163154
*/
164155
private long lockQuitTryingAfterMillis = DEFAULT_QUIT_TRYING_AFTER_MILLIS;
165156

166157
/**
167158
* In case the lock is held by another process, it indicates the frequency to try to acquire it.
168-
* Regardless of this value, the longest Mongock will wait if until the current lock's expiration.
159+
* Regardless of this value, the longest Flamingock will wait if until the current lock's expiration.
169160
* Default 1 second.
170161
* Minimum 500 millis.
171162
*/
172163
private long lockTryFrequencyMillis = DEFAULT_TRY_FREQUENCY_MILLIS;
173164

174165
/**
175-
* Flamingock will throw MongockException if lock can not be obtained. Default true
166+
* Flamingock will throw FlamingockException if lock can not be obtained. Default true
176167
*/
177168
private boolean throwExceptionIfCannotObtainLock = true;
178169

core/flamingock-core/src/main/java/io/flamingock/internal/core/runtime/ExecutionRuntime.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ private static void logMethodWithArguments(String methodName, List<Object> chang
176176

177177
private static String getParameterType(Object obj) {
178178
String className = obj != null ? obj.getClass().getName() : "{null argument}";
179-
int mongockProxyPrefixIndex = className.indexOf(Constants.PROXY_MONGOCK_PREFIX);
180-
if (mongockProxyPrefixIndex > 0) {
181-
return className.substring(0, mongockProxyPrefixIndex);
179+
int flamingockProxyPrefixIndex = className.indexOf(Constants.PROXY_FLAMINGOCK_PREFIX);
180+
if (flamingockProxyPrefixIndex > 0) {
181+
return className.substring(0, flamingockProxyPrefixIndex);
182182
} else {
183183
return className;
184184
}

core/flamingock-core/src/main/java/io/flamingock/internal/core/runtime/proxy/LockGuardProxyFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class LockGuardProxyFactory implements GuardProxyFactory {
3737

3838
static {
3939
ProxyFactory.nameGenerator = new ProxyFactory.UniqueName() {
40-
private final String sep = Constants.PROXY_MONGOCK_PREFIX + Integer.toHexString(this.hashCode() & 0xfff) + "_";
40+
private final String sep = Constants.PROXY_FLAMINGOCK_PREFIX + Integer.toHexString(this.hashCode() & 0xfff) + "_";
4141
private int counter = 0;
4242

4343
@Override

core/importer/flamingock-importer-mongodb-tests/src/test/java/io/flamingock/importer/mongodb/legacy/ClientInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.flamingock.api.annotations.Apply;
2020
import io.mongock.api.annotations.BeforeExecution;
2121

22-
@Change(id = "client-initializer", order = "1", author = "mongock")
22+
@Change(id = "client-initializer", order = "1", author = "flamingock-team")
2323
public class ClientInitializer {
2424

2525
@BeforeExecution

core/importer/flamingock-importer-mongodb-tests/src/test/java/io/flamingock/importer/mongodb/legacy/ClientUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.flamingock.api.annotations.Apply;
2020
import io.mongock.api.annotations.BeforeExecution;
2121

22-
@Change(id = "client-updater", order = "2", author = "mongock")
22+
@Change(id = "client-updater", order = "2", author = "flamingock-team")
2323
public class ClientUpdater {
2424

2525
@BeforeExecution

utils/general-util/src/main/java/io/flamingock/internal/util/Constants.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
package io.flamingock.internal.util;
1717

1818
public final class Constants {
19-
public static final String LEGACY_MIGRATION_NAME = "legacy-migration";
20-
public static final String PROXY_MONGOCK_PREFIX = "_$$_mongock_";
21-
public static final String CLI_PROFILE = "mongock-cli-profile";
19+
public static final String PROXY_FLAMINGOCK_PREFIX = "_$$_flamingock_";
20+
public static final String CLI_PROFILE = "flamingock-cli-profile";
2221
public static final String NON_CLI_PROFILE = "!" + CLI_PROFILE;
2322

24-
public static final String DEFAULT_MIGRATION_AUTHOR = "default_author";
2523
public static long DEFAULT_LOCK_ACQUIRED_FOR_MILLIS = 60 * 1000L;//1 minute
2624
public static long DEFAULT_QUIT_TRYING_AFTER_MILLIS = 3 * 60 * 1000L;//3 minutes
2725
public static long DEFAULT_TRY_FREQUENCY_MILLIS = 1000L;//1 second

0 commit comments

Comments
 (0)