Skip to content

Commit

Permalink
PR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Sep 26, 2023
1 parent 93d1a01 commit 065bcab
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ maven/mavencentral/com.jcraft/jzlib/1.1.3, BSD-2-Clause, approved, CQ6218
maven/mavencentral/com.lmax/disruptor/3.4.4, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.networknt/json-schema-validator/1.0.76, Apache-2.0, approved, CQ22638
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.28, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.32, , restricted, clearlydefined
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.32, Apache-2.0, approved, #10561
maven/mavencentral/com.puppycrawl.tools/checkstyle/10.0, LGPL-2.1-or-later, approved, #7936
maven/mavencentral/com.samskivert/jmustache/1.15, BSD-2-Clause, approved, clearlydefined
maven/mavencentral/com.squareup.okhttp3/okhttp-dnsoverhttps/4.11.0, Apache-2.0, approved, clearlydefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
import java.time.Clock;
import java.util.Objects;

/**
* Abstraction that provides a common ground for state machine manager implementation.
*
* @param <E> the entity type.
* @param <S> the store type.
*/
public abstract class AbstractStateEntityManager<E extends StatefulEntity<E>, S extends StateEntityStore<E>> implements StateEntityManager {

public static final long DEFAULT_ITERATION_WAIT = 1000;
Expand Down Expand Up @@ -66,7 +72,7 @@ public void stop() {
}

/**
* configure the State Machine Manager builder
* configures the State Machine Manager builder
*
* @param builder the builder.
* @return the builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
import static org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntryStates.STARTED;
import static org.eclipse.edc.spi.persistence.StateEntityStore.hasState;

/**
* Implementation of the {@link PolicyMonitorManager}
*/
public class PolicyMonitorManagerImpl extends AbstractStateEntityManager<PolicyMonitorEntry, PolicyMonitorStore>
implements PolicyMonitorManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import java.util.List;
import java.util.UUID;

/**
* In-memory implementation of the {@link PolicyMonitorStore}
*/
public class InMemoryPolicyMonitorStore implements PolicyMonitorStore {

private final InMemoryStatefulEntityStore<PolicyMonitorEntry> store;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import static org.eclipse.edc.connector.transfer.spi.types.TransferProcess.Type.PROVIDER;

/**
* Event subscriber that will start monitoring a transfer process whenever it gets started and it's a PROVIDER one.
*/
public class StartMonitoring implements EventSubscriber {

private final PolicyMonitorManager manager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package org.eclipse.edc.spi.entity;

/**
* Is a long-running process that takes care of managing entity and their status.
* A long-running process that manages entities and their states
*/
public interface StateEntityManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import static org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntryStates.FAILED;
import static org.eclipse.edc.connector.policy.monitor.spi.PolicyMonitorEntryStates.STARTED;

/**
* Entity that represent a transfer process into the Policy Monitor context.
*/
public class PolicyMonitorEntry extends StatefulEntity<PolicyMonitorEntry> {

private String contractId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

import java.util.Arrays;

/**
* States for the {@link PolicyMonitorEntry} entity.
*/
public enum PolicyMonitorEntryStates {
STARTED(100),
COMPLETED(200),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import org.eclipse.edc.spi.entity.StateEntityManager;

/**
* Takes care to iterate over the ongoing transfers verifying their policy, completing them whenever the policy
* cannot be evaluated anymore.
* Iterates over ongoing transfers, verifying their policies and completing when the policy can no longer be evaluated.
*/
public interface PolicyMonitorManager extends StateEntityManager {

Expand Down

0 comments on commit 065bcab

Please sign in to comment.