Skip to content

Commit 128e682

Browse files
docs: clarify v10 strategy API docs
1 parent c535d37 commit 128e682

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,17 @@ You can also **provide an [Unleash context](https://docs.getunleash.io/reference
110110

111111
### Activation strategies
112112

113-
The Java client comes with implementations for the built-in activation strategies provided by Unleash:
113+
The Java client supports Unleash built-in activation strategies (such as `default`, `userWithId`, `gradualRolloutRandom`, `gradualRolloutUserId`, `gradualRolloutSessionId`, `remoteAddress`, and `applicationHostname`).
114114

115-
- DefaultStrategy
116-
- UserWithIdStrategy
117-
- GradualRolloutRandomStrategy
118-
- GradualRolloutUserWithIdStrategy
119-
- GradualRolloutSessionIdStrategy
120-
- RemoteAddressStrategy
121-
- ApplicationHostnameStrategy
115+
As of v10, these built-ins are evaluated by the embedded Yggdrasil engine and are not exposed as public Java strategy classes in this SDK.
122116

123117
Read more about the strategies in the [activation strategies reference documentation](https://docs.getunleash.io/reference/activation-strategies).
124118

125119
#### Custom strategies
126-
You may also specify and implement your own strategy. The specification must be registered in the Unleash UI and
127-
you must register the strategy implementation when you set up Unleash.
120+
You may also specify and implement your own strategy. The specification must be registered in the Unleash UI and you must register the strategy implementation when you set up Unleash.
121+
122+
You can also provide a `fallbackStrategy` via `UnleashConfig` if the client receives a strategy
123+
name it does not recognize.
128124

129125
```java
130126
Strategy s1 = new MyAwesomeStrategy();

v10_MIGRATION_GUIDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ The Bootstrapping interface now requires an `Optional<String>` to be returned ra
1616

1717
The strategy interface has changed to only include the two methods `getName` and `isEnabled`. `isEnabled` now requires both a parameter map and an `UnleashContext`. This only affects users who are implementing custom or fallback strategies.
1818

19+
Built-in strategy classes from `io.getunleash.strategy` (for example
20+
`GradualRolloutRandomStrategy`, `GradualRolloutUserWithIdStrategy`, and
21+
`GradualRolloutSessionIdStrategy`) are no longer part of the Java SDK public API in v10.
22+
23+
These strategies are evaluated internally by Yggdrasil. There is no class-for-class replacement to import for built-ins; use the built-ins via Unleash configuration, and implement `Strategy` only for custom or fallback behavior.
24+
1925
## Events
2026

2127
The following subscriber functions are no longer available: `togglesBackedUp`, `toggleBackupRestored`, and `togglesBootstrapped`. Subscribing to `featuresBackedUp`, `featuresBackupRestored`, and `featuresBootstrapped` respectively serves the same purpose. These subscribers no longer yield events that contain the full feature flag definition, instead, they expose a `getFeatures` method which returns a list of lightweight Java objects containing the feature name, the type of flag, and the project it's bound to.

0 commit comments

Comments
 (0)