Skip to content

Commit

Permalink
#38 versions up
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 18, 2017
1 parent 4f697de commit e21e6b7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,27 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>1.11.37</version>
<version>1.11.179</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.11.37</version>
<version>1.11.179</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudfront</artifactId>
<version>1.11.37</version>
<version>1.11.179</version>
</dependency>
<dependency>
<groupId>org.takes</groupId>
<artifactId>takes</artifactId>
<version>1.1</version>
<version>1.6</version>
</dependency>
<dependency>
<groupId>com.jcabi.incubator</groupId>
Expand All @@ -113,7 +113,7 @@
<dependency>
<groupId>org.cactoos</groupId>
<artifactId>cactoos</artifactId>
<version>0.11.4</version>
<version>0.13.4</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down Expand Up @@ -170,7 +170,7 @@
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-http</artifactId>
<version>1.16</version>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
Expand All @@ -185,7 +185,7 @@
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-matchers</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
Expand All @@ -196,7 +196,7 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.2</version>
<version>1.19.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -225,7 +225,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
<version>1.4.196</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/jare/cached/CdBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.concurrent.TimeUnit;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.cactoos.list.MappedIterable;
import org.cactoos.iterable.Mapped;

/**
* Cached Base.
Expand Down Expand Up @@ -64,7 +64,7 @@ public User user(final String name) {
@Override
@Cacheable(lifetime = 1, unit = TimeUnit.MINUTES)
public Iterable<Domain> domain(final String name) {
return new MappedIterable<>(
return new Mapped<>(
this.origin.domain(name),
CdDomain::new
);
Expand All @@ -73,7 +73,7 @@ public Iterable<Domain> domain(final String name) {
@Override
@Cacheable(unit = TimeUnit.HOURS, lifetime = 1)
public Iterable<Domain> all() {
return new MappedIterable<>(
return new Mapped<>(
this.origin.all(),
CdDomain::new
);
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/io/jare/tk/TkInvalidate.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
*/
package io.jare.tk;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.cloudfront.AmazonCloudFront;
import com.amazonaws.services.cloudfront.AmazonCloudFrontClient;
import com.amazonaws.services.cloudfront.AmazonCloudFrontClientBuilder;
import com.amazonaws.services.cloudfront.model.CreateInvalidationRequest;
import com.amazonaws.services.cloudfront.model.CreateInvalidationResult;
import com.amazonaws.services.cloudfront.model.InvalidationBatch;
Expand Down Expand Up @@ -80,9 +81,13 @@ public Response act(final Request req) throws IOException {
"UTF-8"
)
);
final AmazonCloudFront aws = new AmazonCloudFrontClient(
new BasicAWSCredentials(this.key, this.secret)
);
final AmazonCloudFront aws = AmazonCloudFrontClientBuilder.standard()
.withCredentials(
new AWSStaticCredentialsProvider(
new BasicAWSCredentials(this.key, this.secret)
)
)
.build();
final CreateInvalidationResult result = aws.createInvalidation(
new CreateInvalidationRequest(
"E2QC66VZY6F0QA",
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/jare/tk/TkRelay.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
import java.util.Iterator;
import java.util.Locale;
import java.util.regex.Pattern;
import org.cactoos.list.ConcatIterable;
import org.cactoos.list.SkippedIterable;
import org.cactoos.iterable.Skipped;
import org.takes.HttpException;
import org.takes.Request;
import org.takes.Response;
import org.takes.Take;
import org.takes.misc.Concat;
import org.takes.rq.RqHref;
import org.takes.rs.RsWithHeaders;
import org.takes.rs.RsWithoutHeader;
Expand Down Expand Up @@ -152,14 +152,14 @@ private static Request request(final Request req, final String path) {
return new Request() {
@Override
public Iterable<String> head() throws IOException {
return new ConcatIterable<String>(
return new Concat<String>(
Collections.singleton(
String.format(
"GET %s HTTP/1.1",
path
)
),
new SkippedIterable<>(req.head(), 1)
new Skipped<>(req.head(), 1)
);
}
@Override
Expand Down

0 comments on commit e21e6b7

Please sign in to comment.