You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15-9
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,15 @@
3
3
4
4
All notable changes to the LaunchDarkly Java SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
5
5
6
+
# Note on future releases
7
+
8
+
The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now `java-server-sdk` rather than `java-client`.
9
+
10
+
The artifact names will also change. In the 4.6.3 release, the generated artifact was named `com.launchdarkly.client:launchdarkly-client`; in all future releases, it will be `com.launchdarkly.client:launchdarkly-java-server-sdk`.
11
+
6
12
## [4.6.3] - 2019-03-21
7
13
### Fixed
8
-
- The SDK uberjars contained some JSR305 annotation classes such as `javax.annotation.Nullable`. These have been removed. They were not being used in the public API anyway. ([#156](https://github.com/launchdarkly/java-client/issues/156))
14
+
- The SDK uberjars contained some JSR305 annotation classes such as `javax.annotation.Nullable`. These have been removed. They were not being used in the public API anyway. ([#156](https://github.com/launchdarkly/java-server-sdk/issues/156))
9
15
- If `track` or `identify` is called without a user, the SDK now logs a warning, and does not send an analytics event to LaunchDarkly (since it would not be processed without a user).
10
16
11
17
## [4.6.2] - 2019-02-21
@@ -45,7 +51,7 @@ It is now possible to inject feature flags into the client from local JSON or YA
45
51
46
52
## [4.4.1] - 2018-10-15
47
53
### Fixed:
48
-
- The SDK's Maven releases had a `pom.xml` that mistakenly referenced dependencies that are actually bundled (with shading) inside of our jar, resulting in those dependencies being redundantly downloaded and included (without shading) in the runtime classpath, which could cause conflicts. This has been fixed. ([#122](https://github.com/launchdarkly/java-client/issues/122))
54
+
- The SDK's Maven releases had a `pom.xml` that mistakenly referenced dependencies that are actually bundled (with shading) inside of our jar, resulting in those dependencies being redundantly downloaded and included (without shading) in the runtime classpath, which could cause conflicts. This has been fixed. ([#122](https://github.com/launchdarkly/java-server-sdk/issues/122))
49
55
50
56
## [4.4.0] - 2018-10-01
51
57
### Added:
@@ -67,7 +73,7 @@ It is now possible to inject feature flags into the client from local JSON or YA
67
73
## [4.3.0] - 2018-08-27
68
74
### Added:
69
75
- The new `LDClient` method `allFlagsState()` should be used instead of `allFlags()` if you are passing flag data to the front end for use with the JavaScript SDK. It preserves some flag metadata that the front end requires in order to send analytics events correctly. Versions 2.5.0 and above of the JavaScript SDK are able to use this metadata, but the output of `allFlagsState()` will still work with older versions.
70
-
- The `allFlagsState()` method also allows you to select only client-side-enabled flags to pass to the front end, by using the option `FlagsStateOption.CLIENT_SIDE_ONLY`. ([#112](https://github.com/launchdarkly/java-client/issues/112))
76
+
- The `allFlagsState()` method also allows you to select only client-side-enabled flags to pass to the front end, by using the option `FlagsStateOption.CLIENT_SIDE_ONLY`. ([#112](https://github.com/launchdarkly/java-server-sdk/issues/112))
71
77
- The new `LDClient` methods `boolVariationDetail`, `intVariationDetail`, `doubleVariationDetail`, `stringVariationDetail`, and `jsonVariationDetail` allow you to evaluate a feature flag (using the same parameters as you would for `boolVariation`, etc.) and receive more information about how the value was calculated. This information is returned in an `EvaluationDetail` object, which contains both the result value and an `EvaluationReason` which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules, or if the flag returned the default value due to an error.
72
78
73
79
### Fixed:
@@ -97,7 +103,7 @@ It is now possible to inject feature flags into the client from local JSON or YA
97
103
## [4.1.0] - 2018-05-15
98
104
99
105
### Added:
100
-
- The new user builder methods `customValues` and `privateCustomValues` allow you to add a custom user attribute with multiple JSON values of mixed types. ([#126](https://github.com/launchdarkly/java-client/issues/126))
106
+
- The new user builder methods `customValues` and `privateCustomValues` allow you to add a custom user attribute with multiple JSON values of mixed types. ([#126](https://github.com/launchdarkly/java-server-sdk/issues/126))
101
107
- The new constant `VersionedDataKind.ALL` is a list of all existing `VersionedDataKind` instances. This is mainly useful if you are writing a custom `FeatureStore` implementation.
102
108
103
109
## [4.0.0] - 2018-05-10
@@ -124,7 +130,7 @@ It is now possible to inject feature flags into the client from local JSON or YA
124
130
125
131
## [3.0.2] - 2018-03-01
126
132
### Fixed
127
-
- Improved performance when evaluating flags with custom attributes, by avoiding an unnecessary caught exception (thanks, [rbalamohan](https://github.com/launchdarkly/java-client/issues/113)).
133
+
- Improved performance when evaluating flags with custom attributes, by avoiding an unnecessary caught exception (thanks, [rbalamohan](https://github.com/launchdarkly/java-server-sdk/issues/113)).
128
134
129
135
130
136
## [3.0.1] - 2018-02-22
@@ -143,7 +149,7 @@ _This release was broken and should not be used._
143
149
144
150
## [2.6.1] - 2018-03-01
145
151
### Fixed
146
-
- Improved performance when evaluating flags with custom attributes, by avoiding an unnecessary caught exception (thanks, [rbalamohan](https://github.com/launchdarkly/java-client/issues/113)).
152
+
- Improved performance when evaluating flags with custom attributes, by avoiding an unnecessary caught exception (thanks, [rbalamohan](https://github.com/launchdarkly/java-server-sdk/issues/113)).
147
153
148
154
149
155
## [2.6.0] - 2018-02-12
@@ -223,7 +229,7 @@ _This release was broken and should not be used._
223
229
224
230
## [2.2.1] - 2017-04-25
225
231
### Fixed
226
-
-[#92](https://github.com/launchdarkly/java-client/issues/92) Regex `matches` targeting rules now include the user if
232
+
-[#92](https://github.com/launchdarkly/java-server-sdk/issues/92) Regex `matches` targeting rules now include the user if
227
233
a match is found anywhere in the attribute. Before fixing this bug, the entire attribute needed to match the pattern.
Contributing to the LaunchDarkly Server-side SDK for Java
2
2
================================================
3
+
4
+
LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.
5
+
6
+
## Submitting bug reports and feature requests
7
+
8
+
The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/java-server-sdk/issues) in the SDK repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days.
9
+
10
+
## Submitting pull requests
11
+
12
+
We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.
13
+
14
+
## Build instructions
15
+
16
+
### Prerequisites
17
+
18
+
The SDK builds with [Gradle](https://gradle.org/) and should be built against Java 7.
19
+
20
+
### Building
3
21
4
-
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.
5
-
6
-
7
-
Testing Proxy Settings
8
-
==================
9
-
Installation is your own journey, but your squid.conf file should have auth/access sections that look something like this:
22
+
To build the SDK without running any tests:
23
+
```
24
+
./gradlew jar
25
+
```
10
26
27
+
If you wish to clean your working directory between builds, you can clean it by running:
11
28
```
12
-
auth_param basic program /usr/local/Cellar/squid/3.5.6/libexec/basic_ncsa_auth <SQUID_DIR>/passwords
13
-
auth_param basic realm proxy
14
-
acl authenticated proxy_auth REQUIRED
15
-
http_access allow authenticated
16
-
# And finally deny all other access to this proxy
17
-
http_access deny all
29
+
./gradlew clean
18
30
```
19
31
20
-
The contents of the passwords file is:
32
+
If you wish to use your generated SDK artifact by another Maven/Gradle project such as [hello-java](https://github.com/launchdarkly/hello-java), you will likely want to publish the artifact to your local Maven repository so that your other project can access it.
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!
Three variants of the SDK jar are published to Maven:
16
22
17
-
* The default uberjar - the dependency that is shown below under "Quick setup". This contains the SDK classes, and all of the SDK's dependencies except for Gson and SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
23
+
* The default uberjar - this is accessible as `com.launchdarkly:launchdarkly-java-server-sdk:jar` and is the dependency used in the "[Getting started](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started)" section of the SDK reference guide as well as in the [`hello-java`](https://github.com/launchdarkly/hello-java) sample app. This variant contains the SDK classes, and all of the SDK's dependencies except for Gson and SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
18
24
* The extended uberjar - add `<classifier>all</classifier>` in Maven, or `:all` in Gradle. This is the same as the default uberjar except that Gson and SLF4J are also bundled, without shading (and are exported in OSGi).
19
25
* The "thin" jar - add `<classifier>thin</classifier>` in Maven, or `:thin` in Gradle. This contains _only_ the SDK classes.
20
26
21
-
Quick setup
27
+
Getting started
22
28
-----------
23
29
24
-
0. Add the Java SDK to your project
25
-
26
-
<!-- in Maven: -->
27
-
<dependency>
28
-
<groupId>com.launchdarkly</groupId>
29
-
<artifactId>launchdarkly-client</artifactId>
30
-
<version>4.6.3</version>
31
-
</dependency>
32
-
33
-
// or in Gradle:
34
-
"com.launchdarkly:launchdarkly-client:4.6.3"
35
-
36
-
1. Import the LaunchDarkly package:
37
-
38
-
import com.launchdarkly.client.*;
39
-
40
-
2. Create a new LDClient with your SDK key:
41
-
42
-
LDClient ldClient = new LDClient("YOUR_SDK_KEY");
43
-
44
-
Your first feature flag
45
-
-----------------------
46
-
47
-
1. Create a new feature flag on your [dashboard](https://app.launchdarkly.com)
48
-
2. In your application code, use the feature's key to check wthether the flag is on for each user:
Refer to the [SDK reference guide](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started) for instructions on getting started with using the SDK.
58
31
59
32
Logging
60
33
-------
@@ -68,7 +41,7 @@ Be aware of two considerations when enabling the DEBUG log level:
68
41
Using flag data from a file
69
42
---------------------------
70
43
71
-
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See <ahref="http://javadoc.io/page/com.launchdarkly/launchdarkly-client/latest/com/launchdarkly/client/files/FileComponents.html">FileComponents</a> for more details.
44
+
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See <ahref="http://javadoc.io/page/com.launchdarkly/launchdarkly-java-server-sdk/latest/com/launchdarkly/client/files/FileComponents.html">FileComponents</a> for more details.
72
45
73
46
DNS caching issues
74
47
------------------
@@ -80,18 +53,17 @@ Unlike some other languages, in Java the DNS caching behavior is controlled by t
80
53
Learn more
81
54
----------
82
55
83
-
Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](http://docs.launchdarkly.com/docs/java-sdk-reference) or our [Javadocs](http://launchdarkly.github.io/java-server-sdk/).
56
+
Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/java-sdk-reference) or our [code-generated API documentation](https://launchdarkly.github.io/java-server-sdk/).
84
57
85
58
Testing
86
59
-------
87
60
88
61
We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.
89
62
90
-
91
63
Contributing
92
64
------------
93
65
94
-
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.
66
+
We encourage pullrequests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.
95
67
96
68
About LaunchDarkly
97
69
-----------
@@ -101,22 +73,10 @@ About LaunchDarkly
101
73
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
102
74
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
103
75
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
116
77
* Explore LaunchDarkly
117
-
*[launchdarkly.com](http://www.launchdarkly.com/"LaunchDarkly Main Website") for more information
118
-
*[docs.launchdarkly.com](http://docs.launchdarkly.com/"LaunchDarkly Documentation") for our documentation and SDKs
119
-
*[apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/"LaunchDarkly API Documentation") for our API documentation
120
-
*[blog.launchdarkly.com](http://blog.launchdarkly.com/"LaunchDarkly Blog Documentation") for the latest product updates
78
+
*[launchdarkly.com](https://www.launchdarkly.com/"LaunchDarkly Main Website") for more information
79
+
*[docs.launchdarkly.com](https://docs.launchdarkly.com/"LaunchDarkly Documentation") for our documentation and SDK reference guides
80
+
*[apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/"LaunchDarkly API Documentation") for our API documentation
81
+
*[blog.launchdarkly.com](https://blog.launchdarkly.com/"LaunchDarkly Blog Documentation") for the latest product updates
121
82
*[Feature Flagging Guide](https://github.com/launchdarkly/featureflags/"Feature Flagging Guide") for best practices and strategies
0 commit comments