Skip to content

Commit

Permalink
#75 Update branch with newest master.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin.szymura committed May 14, 2020
1 parent 272c780 commit e76e7af
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions action/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
implementation(group = "io.vertx", name = "vertx-rx-java2")
implementation(group = "io.vertx", name = "vertx-circuit-breaker")
implementation(group = "io.vertx", name = "vertx-web-client")
implementation(group = "io.vertx", name = "vertx-redis-client")
implementation(group = "org.apache.commons", name = "commons-lang3")
implementation(group = "com.google.guava", name = "guava")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;

import io.reactivex.Maybe;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;

import io.knotx.fragments.action.api.Action;
import io.knotx.fragments.api.Fragment;
import io.knotx.fragments.handler.api.Action;
import io.knotx.fragments.handler.api.domain.FragmentContext;
import io.knotx.fragments.handler.api.domain.FragmentResult;
import io.knotx.fragments.api.FragmentContext;
import io.knotx.fragments.api.FragmentResult;
import io.knotx.server.api.context.ClientRequest;
import io.knotx.server.common.placeholders.PlaceholdersResolver;
import io.knotx.server.common.placeholders.SourceDefinitions;
Expand All @@ -42,7 +42,7 @@ public class CacheAction implements Action {

private final Cache cache;

public CacheAction(Action doAction, JsonObject config,
CacheAction(Action doAction, JsonObject config,
Cache cache) {
this.doAction = doAction;
this.config = config;
Expand All @@ -51,7 +51,8 @@ public CacheAction(Action doAction, JsonObject config,
}

@Override
public void apply(FragmentContext fragmentContext, Handler<AsyncResult<FragmentResult>> resultHandler) {
public void apply(FragmentContext fragmentContext,
Handler<AsyncResult<FragmentResult>> resultHandler) {
String cacheKey = getCacheKey(config, fragmentContext.getClientRequest());
cache.get(cacheKey)
.subscribe(cachedValue -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;


import io.reactivex.Maybe;
Expand All @@ -31,7 +31,7 @@ public class InMemoryCache implements Cache {

private final com.google.common.cache.Cache cache;

public InMemoryCache(JsonObject config) {
InMemoryCache(JsonObject config) {
cache = createCache(config);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;


import io.knotx.fragments.handler.api.Action;
import io.knotx.fragments.handler.api.ActionFactory;
import io.knotx.fragments.handler.api.Cacheable;
import io.knotx.fragments.action.api.Action;
import io.knotx.fragments.action.api.ActionFactory;
import io.knotx.fragments.action.api.Cacheable;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;

import io.reactivex.Maybe;
import io.vertx.core.Vertx;
Expand Down Expand Up @@ -111,4 +111,4 @@ private static Object valueToObject(String value) {
return value;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx.fragments.handler.action.cache;
package io.knotx.fragments.action.cache;

import io.knotx.fragments.handler.api.Action;
import io.knotx.fragments.handler.api.ActionFactory;
import io.knotx.fragments.action.api.Action;
import io.knotx.fragments.action.api.ActionFactory;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;

/**
* Action factory for caching fragment payload values on Redis server. Can be initialized with a configuration:
* Action factory for caching fragment payload values on Redis server. Can be initialized with a
* configuration:
* <pre>
* productDetails {
* factory = redis-cache
Expand Down Expand Up @@ -58,4 +59,4 @@ public String getName() {
public Action create(String alias, JsonObject config, Vertx vertx, Action doAction) {
return new CacheAction(doAction, config, new RedisCache(vertx, config));
}
}
}
1 change: 0 additions & 1 deletion task/handler/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies {
implementation(group = "io.vertx", name = "vertx-service-proxy")
implementation(group = "io.vertx", name = "vertx-rx-java2")
implementation(group = "io.vertx", name = "vertx-web-client")
implementation(group = "io.vertx", name = "vertx-redis-client")
implementation(group = "org.apache.commons", name = "commons-lang3")
implementation(group = "com.google.guava", name = "guava")

Expand Down

0 comments on commit e76e7af

Please sign in to comment.