Skip to content

Commit 213920e

Browse files
authored
fix: several fixes after review (#107)
1 parent 64171e6 commit 213920e

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

docs/audit-stores/community/couchbase-audit-store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Here's a comprehensive example showing the configuration:
8686

8787
```java
8888
// Create a Couchbase Target System
89-
CouchbaseTargetSystem couchbaseTargetSystem = new CouchbaseTargetSystem("couchbase", cluster, bucket);
89+
CouchbaseTargetSystem couchbaseTargetSystem = new CouchbaseTargetSystem("couchbase", cluster, "bucketName");
9090
// Audit store configuration (mandatory via constructor)
9191
var auditStore = CouchbaseSyncAuditStore.from(couchbaseTargetSystem)
9292
.withScopeName("custom-scope") // Optional configuration

docs/audit-stores/introduction.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ Register the audit store with the Flamingock builder:
4949
// Generic example - audit store configuration
5050
public class App {
5151
public static void main(String[] args) {
52+
53+
// TargetSystem
54+
var targetSystem = new MongoDBSyncTargetSystem("mongodb-ts", mongoClient, "dbName");
55+
5256
// Create your audit store connection
53-
var auditStore = new MongoDBSyncAuditStore(mongoClient, mongoDatabase);
57+
var auditStore = MongoDBSyncAuditStore.from(targetSystem);
5458

5559
// Register with Flamingock
5660
Flamingock.builder()
5761
.setAuditStore(auditStore) // Set the audit store
58-
.addTargetSystems(myTargetSystem)
62+
.addTargetSystems(targetSystem)
5963
.build()
6064
.run();
6165
}

docs/changes/apply-and-rollback-methods.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Your Change methods receive the dependencies they need as parameters - Flamingoc
1313

1414
```java
1515
@Apply
16-
public void configureBucket(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
16+
public void apply(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
1717

1818
}
1919

2020
@Rollback
21-
public void configureBucket(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
21+
public void rollback(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
2222

2323
}
2424
```

docs/flamingock-library-config/context-and-dependencies.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ Every target system provides two ways to add dependencies:
4848

4949
**Specific methods** - Each concrete implementation offers `.withXXX()` methods for common dependencies:
5050
```java
51-
var mongoTarget = new MongoDBSyncTargetSystem("user-db")
52-
.withDatabase(database) // MongoDB-specific method
53-
.withMongoClient(client); // MongoDB-specific method
51+
var mongoTarget = new MongoDBSyncTargetSystem("user-db", mongoClient, databaseName)
52+
.withReadConcern(ReadConcern.MAJORITY) // MongoDB specific method
53+
.withReadPreference(ReadPreference.primary()) // MongoDB specific method
54+
.withWriteConcern(WriteConcern.MAJORITY); // MongoDB specific method
5455
```
5556

5657
**Generic methods** - All target systems (including NonTransactionalTargetSystem) support generic dependency injection:

docs/flamingock-library-config/lock.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The lock mechanism is **mandatory** and is stored in your configured audit store
1818
| `lockQuitTryingAfterMillis` | `180000` (3 min) | How long to retry acquiring the lock if another instance holds it. |
1919
| `lockTryFrequencyMillis` | `1000` (1 sec) | Interval between attempts while waiting for the lock. |
2020
| `throwExceptionIfCannotObtainLock` | `true` | Whether Flamingock should fail if the lock can't be acquired. |
21-
| `enableRefreshDaemon` | `true` | Whether to run a background thread that periodically extends the lock. |
2221

2322

2423
## Why locking matters
@@ -59,7 +58,6 @@ Flamingock.builder()
5958
.setLockQuitTryingAfterMillis(300000)
6059
.setLockTryFrequencyMillis(2000)
6160
.setThrowExceptionIfCannotObtainLock(true)
62-
.setEnableRefreshDaemon(true)
6361
...
6462
```
6563

docs/get-started/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ For our example:
9090
- A Kafka cluster (`kafka`)
9191

9292
```java
93-
var sql = new SqlTargetSystem("mysql-inventory").withDatasource(ds);
93+
var sql = new SqlTargetSystem("mysql-inventory", mysqlDataSource);
9494
var s3 = new NonTransactionalTargetSystem("aws-s3-id");
9595
var kafka = new NonTransactionalTargetSystem("kafka-id");
9696
```

docs/target-systems/couchbase-target-system.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ implementation("com.couchbase.client:java-client:3.6.0")
4343
Configure the target system:
4444

4545
```java
46-
var couchbaseTarget = new CouchbaseTargetSystem("user-database-id", cluster, bucket);
46+
var couchbaseTarget = new CouchbaseTargetSystem("user-database-id", cluster, "userBucket");
4747
```
4848

49-
The constructor requires the target system name, Couchbase cluster, and bucket. Optional configurations can be added via `.withXXX()` methods.
49+
The constructor requires the target system name, Couchbase cluster, and bucket name. Optional configurations can be added via `.withXXX()` methods.
5050

5151
:::info Register Target System
5252
Once created, you need to register this target system with Flamingock. See [Registering target systems](introduction.md#registering-target-systems) for details.
@@ -63,7 +63,7 @@ These dependencies must be provided at target system creation time with **no glo
6363
| Dependency | Constructor Parameter | Description |
6464
|------------|----------------------|-------------|
6565
| `Cluster` | `cluster` | Couchbase cluster connection - **required** for both target system configuration and change execution |
66-
| `Bucket` | `bucket` | Target bucket instance - **required** for both target system configuration and change execution |
66+
| `String` | `bucketName` | Target bucket name - **required** for both target system configuration and change execution |
6767

6868
## Dependencies available to Changes
6969

@@ -79,7 +79,7 @@ Here's a comprehensive example showing the new architecture:
7979

8080
```java
8181
// Target system configuration (mandatory via constructor)
82-
var couchbaseTarget = new CouchbaseTargetSystem("user-database", productionCluster, userBucket)
82+
var couchbaseTarget = new CouchbaseTargetSystem("user-database", productionCluster, "userBucket")
8383
.addDependency(auditService); // Additional dependency for changes
8484

8585
// Global context with shared dependencies
@@ -92,11 +92,11 @@ Flamingock.builder()
9292

9393
**Target system configuration resolution:**
9494
- **Cluster**: Must be provided via constructor (`productionCluster`)
95-
- **Bucket**: Must be provided via constructor (`userBucket`)
95+
- **Bucket name**: Must be provided via constructor (`"userBucket"`)
9696

9797
**Change dependency resolution for Changes in "user-database":**
9898
- **Cluster**: From target system context (`productionCluster`)
99-
- **Bucket**: From target system context (`userBucket`)
99+
- **Bucket**: From target system context (derived from `productionCluster` + `"userBucket"`)
100100
- **TransactionAttemptContext**: From target system context (created by Flamingock)
101101
- **AuditService**: From target system additional dependencies
102102
- **EmailService**: From global context (fallback)

0 commit comments

Comments
 (0)