Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions authorization/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand All @@ -22,6 +23,7 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
Expand All @@ -34,22 +36,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
19 changes: 2 additions & 17 deletions certificate-authority/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand All @@ -22,6 +23,7 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
Expand All @@ -34,22 +36,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
19 changes: 2 additions & 17 deletions choreographer/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand All @@ -22,6 +23,7 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
Expand All @@ -34,22 +36,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import org.apache.logging.log4j.Logger;
import org.springframework.util.Assert;

import eu.arrowhead.core.choreographer.graph.Node;
import eu.arrowhead.common.dto.internal.ChoreographerSessionStepStartCondition;

public class EdgeBuilderStepGraphNormalizer implements StepGraphNormalizer {

//=================================================================================================
Expand Down Expand Up @@ -52,7 +55,7 @@ public StepGraph normalizeStepGraph(final StepGraph graph) {
private StepGraph shallowCopyStepGraph(final StepGraph graph) {
final StepGraph result = new StepGraph();
for (final Node node : graph.getSteps()) {
result.getSteps().add(new Node(node.getName()));
result.getSteps().add(new Node(node.getName(), node.getStartCondition()));
}

return result;
Expand Down Expand Up @@ -140,6 +143,12 @@ private boolean isRedundantRoute(final List<String> candidateRoute, final List<L
//-------------------------------------------------------------------------------------------------
private boolean isRedundantRouteImpl(final List<String> candidateRoute, final List<String> verifiedRoute) {
int lastIndex = -1;

// final Node lastNode = candidateRoute.get(0);
// if(lastNode.getIsStartConditionAND()) {
// return false;
// }

for (int i = 0; i < candidateRoute.size(); ++i) {
final String node = candidateRoute.get(i);
int index = verifiedRoute.indexOf(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.apache.commons.lang3.tuple.Pair;
import org.springframework.util.Assert;
import eu.arrowhead.core.choreographer.graph.Node;

public class EdgeDestroyerStepGraphNormalizer implements StepGraphNormalizer {

Expand Down Expand Up @@ -104,7 +105,8 @@ private List<Pair<Node,Node>> findRemovableRoutes(final List<List<Node>> routes)
final List<Pair<Node,Node>> routeRemovables = new ArrayList<>();
for (int i = 0; i < route.size() - 1; i++) {
final int idxInLongest = longest.indexOf(route.get(i));
if (!longest.get(idxInLongest + 1).equals(route.get(i + 1))) {
final Node lastNode = route.get(i);
if ((!longest.get(idxInLongest + 1).equals(route.get(i + 1))) && lastNode.getIsStartConditionAND() ) {
routeRemovables.add(Pair.of(route.get(i + 1), route.get(i))); //Because route is backward, so the result will Pair(from,to)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,74 @@

import java.util.HashSet;
import java.util.Set;
import eu.arrowhead.common.dto.internal.ChoreographerSessionStepStartCondition;

public class Node {
//=================================================================================================

// =================================================================================================
// members

protected final String name;
protected final ChoreographerSessionStepStartCondition startCondition;
protected final Set<Node> nextNodes = new HashSet<>();
protected final Set<Node> prevNodes = new HashSet<>();
//=================================================================================================

// =================================================================================================
// methods

//-------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
public Node(final String name) {
this.name = name;
this.startCondition = ChoreographerSessionStepStartCondition.AND;
}

// -------------------------------------------------------------------------------------------------
public Node(final String name, final ChoreographerSessionStepStartCondition condition) {
this.name = name;
this.startCondition = condition;

}

// -------------------------------------------------------------------------------------------------
public String getName() {
return name;
}

public ChoreographerSessionStepStartCondition getStartCondition() {
return startCondition;
}

//-------------------------------------------------------------------------------------------------
public String getName() { return name; }
public Set<Node> getNextNodes() { return nextNodes; }
public Set<Node> getPrevNodes() { return prevNodes; }
public Boolean getIsStartConditionAND() {
switch (startCondition) {
case TRUE: {
return false;
}
case FALSE: {
return false;
}
case OR: {
return false;
}
default:
return true;
}
}

public Set<Node> getNextNodes() {
return nextNodes;
}

public Set<Node> getPrevNodes() {
return prevNodes;
}

//-------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
@Override
public String toString() {
return "Node [name=" + name + "]";
}

//-------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
@Override
public int hashCode() {
final int prime = 31;
Expand All @@ -40,7 +78,7 @@ public int hashCode() {
return result;
}

//-------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
@Override
public boolean equals(Object obj) {
if (this == obj) {
Expand Down
Loading