Skip to content

Commit

Permalink
Releasing 2.0.1
Browse files Browse the repository at this point in the history
Resolving the following:
* kontent-ai#64 MAJOR issue.  Ensuring that HttpResponses are always closed in finally block.
* kontent-ai#2 Added considerably more JavaDoc comments.  More can be done.
* kontent-ai#63 Updated unit test to validate BrokenLinkResolvers do not change
  web links.

Other:
* Added project lombok to autogen getters/setters/etc.
* Added lombok builders, especially useful for DeliveryOptions.
* Removing IOException throws from method signatures.  Now when an
  IOException occurs, it is wrapped in a KenticoIOException class which
  is a RuntimeException so consumers are not required to catch.
  • Loading branch information
aweigold committed Aug 5, 2018
1 parent bb20016 commit 845c928
Show file tree
Hide file tree
Showing 16 changed files with 162 additions and 43 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Javadocs](http://javadoc.io/badge/com.kenticocloud/delivery.svg)](http://javadoc.io/doc/com.kenticocloud/delivery)
[![SonarQube](http://img.shields.io/badge/SonarQube-Results-blue.svg)](https://sonarcloud.io/dashboard?id=com.kenticocloud%3Adelivery-sdk-java)
[![MavenCentral](http://img.shields.io/badge/Maven_Central-2.0.0-yellow.svg)](https://oss.sonatype.org/content/groups/public/com/kenticocloud/delivery/)
[![MavenCentral](http://img.shields.io/badge/Maven_Central-2.0.1-yellow.svg)](https://oss.sonatype.org/content/groups/public/com/kenticocloud/delivery/)
[![Forums](https://img.shields.io/badge/chat-on%20forums-orange.svg)](https://forums.kenticocloud.com)
[![Analytics](https://ga-beacon.appspot.com/UA-69014260-4/Kentico/delivery-sdk-java?pixel)](https://github.com/igrigorik/ga-beacon)

Expand All @@ -21,7 +21,7 @@ repositories {
}
dependencies {
compile('com.kenticocloud:delivery:2.0.0')
compile('com.kenticocloud:delivery:2.0.1')
}
```

Expand All @@ -30,7 +30,7 @@ Or via your Maven POM:
<dependency>
<groupId>com.kenticocloud</groupId>
<artifactId>delivery</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

Expand All @@ -53,6 +53,15 @@ You can also provide the project ID and other parameters by passing the [`Delive
* `setUsePreviewApi(boolean)` – determines whether to use the Delivery Preview API.
* `setWaitForLoadingNewContent(boolean)` – makes the client instance wait while fetching updated content, useful when acting upon [webhook calls](https://developer.kenticocloud.com/docs/webhooks#section-requesting-new-content).

The `DeliveryOptions.builder()` can also simplify creating a `DeliveryClient`:

```java
DeliveryClient client = new DeliveryClient(DeliveryOptions.builder()
.projectId("975bf280-fd91-488c-994c-2f04416e5ee3")
.productionApiKey("secured key")
.build());
```

Once you create a `DeliveryClient`, you can start querying your project repository by calling methods on the client instance. See [Basic querying](#basic-querying) for details.

### Filtering retrieved data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class AssetsElement extends Element<List<Asset>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
@lombok.Builder
@lombok.EqualsAndHashCode(exclude = {"modularContentProvider", "stronglyTypedContentItemConverter"})
@lombok.ToString(exclude = {"modularContentProvider", "stronglyTypedContentItemConverter"})
public class ContentItem {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
* @see DeliveryClient#getItem(String, List)
*/
@lombok.Getter
@lombok.ToString
@lombok.EqualsAndHashCode
@lombok.ToString(exclude = "stronglyTypedContentItemConverter")
@lombok.EqualsAndHashCode(exclude = "stronglyTypedContentItemConverter")
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
@lombok.Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
* @see DeliveryClient#getItem(String, List)
*/
@lombok.Getter
@lombok.ToString
@lombok.EqualsAndHashCode
@lombok.ToString(exclude = "stronglyTypedContentItemConverter")
@lombok.EqualsAndHashCode(exclude = "stronglyTypedContentItemConverter")
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
@lombok.Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class DateTimeElement extends Element<ZonedDateTime> {

static final String TYPE_VALUE = "date_time";

@JsonProperty("type")
String type;

/**
* The value of a Date &amp; time element is a string in the ISO 8601 format. If empty, the value is null.
*
Expand Down
4 changes: 2 additions & 2 deletions delivery/src/main/java/com/kenticocloud/delivery/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
})
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.EqualsAndHashCode
@lombok.ToString(exclude = "parent")
@lombok.EqualsAndHashCode(exclude = "parent")
@lombok.NoArgsConstructor
public abstract class Element<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class ModularContentElement extends Element<List<String>> {

static final String TYPE_VALUE = "modular_content";

@JsonProperty("type")
String type;

/**
* A list of {@link ContentItem} codenames
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class MultipleChoiceElement extends Element<List<Option>> {

static final String TYPE_VALUE = "multiple_choice";

@JsonProperty("type")
String type;

/**
* The value of the selected elements.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class NumberElement extends Element<Double> {

static final String TYPE_VALUE = "number";

@JsonProperty("type")
String type;

/**
* The value of a Number element is a decimal number. If empty, the value is null.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class RichTextElement extends TextElement {

static final String TYPE_VALUE = "rich_text";

@JsonProperty("type")
String type;

/**
* Images associated with this rich text element.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class TaxonomyElement extends Element<List<Taxonomy>> {

static final String TYPE_VALUE = "taxonomy";

@JsonProperty("type")
String type;

/**
* The name of the taxonomy group
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class TextElement extends Element<String> {

static final String TYPE_VALUE = "text";

@JsonProperty("type")
String type;

/**
* The value of a Text element is a string.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@
*/
@lombok.Getter
@lombok.Setter
@lombok.ToString
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
public class UrlSlugElement extends Element<String> {

static final String TYPE_VALUE = "url_slug";

@JsonProperty("type")
String type;

/**
* The value of URL slug elements is a string.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ public void testRetryStops() throws Exception {
});
HttpHost httpHost = this.start();
String testServerUri = httpHost.toURI() + "/%s";
DeliveryOptions deliveryOptions = new DeliveryOptions();
DeliveryOptions deliveryOptions = DeliveryOptions.builder()
.projectId(projectId)
.productionEndpoint(testServerUri)
.retryAttempts(1)
.build();
deliveryOptions.setProjectId(projectId);
deliveryOptions.setProductionEndpoint(testServerUri);
deliveryOptions.setRetryAttempts(1);
Expand Down
Loading

0 comments on commit 845c928

Please sign in to comment.