git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[maven-release-plugin] copy for tag wamblee-utils-0.2.2
[utils]
/
system
/
general
/
src
/
main
/
java
/
org
/
wamblee
/
system
/
graph
/
component
/
ConnectRequiredProvidedEdgeFilter.java
diff --git
a/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java
b/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java
index f04b381f0abb3d0749d132d8a1d66cb4b0ec2b0b..a2f918774d3029501c831ff1b8c00df9a39c2ad1 100644
(file)
--- a/
system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java
+++ b/
system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 200
8
the original author or authors.
+ * Copyright 200
5-2010
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-12,67
+12,73
@@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.system.graph.component;
import org.wamblee.system.graph.Edge;
import org.wamblee.system.graph.EdgeFilter;
package org.wamblee.system.graph.component;
import org.wamblee.system.graph.Edge;
import org.wamblee.system.graph.EdgeFilter;
-import org.wamblee.system.graph.EdgeSelector;
-import org.wamblee.system.graph.Node;
/**
* Filter used to explicitly connect required and provided interfaces within a
* container.
*
* @author Erik Brakkee
/**
* Filter used to explicitly connect required and provided interfaces within a
* container.
*
* @author Erik Brakkee
- *
*/
public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter {
*/
public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter {
+ private String client;
+
+ private String required;
+
+ private String server;
- private String _client;
- private String _required;
- private String _server;
- private String _provided;
+ private String provided;
+ /**
+ * Creates a new ConnectRequiredProvidedEdgeFilter object.
+ *
+ */
public ConnectRequiredProvidedEdgeFilter(String aClient, String aRequired,
public ConnectRequiredProvidedEdgeFilter(String aClient, String aRequired,
- String aServer, String aProvided) {
- _client = aClient;
- _required = aRequired;
- _server = aServer;
- _provided = aProvided;
- if ( _client == null ) {
- throw new IllegalArgumentException("Client component must be specified");
+ String aServer, String aProvided) {
+ client = aClient;
+ required = aRequired;
+ server = aServer;
+ provided = aProvided;
+
+ if (client == null) {
+ throw new IllegalArgumentException(
+ "Client component must be specified");
}
}
@Override
public boolean isViolated(Edge aEdge) {
}
}
@Override
public boolean isViolated(Edge aEdge) {
- if (aEdge.getFrom() instanceof RequiredInterfaceNode
-
&&
aEdge.getTo() instanceof ProvidedInterfaceNode) {
+ if (aEdge.getFrom() instanceof RequiredInterfaceNode
&&
+ aEdge.getTo() instanceof ProvidedInterfaceNode) {
return isViolated((RequiredInterfaceNode) aEdge.getFrom(),
return isViolated((RequiredInterfaceNode) aEdge.getFrom(),
-
(ProvidedInterfaceNode) aEdge.getTo());
+ (ProvidedInterfaceNode) aEdge.getTo());
}
}
+
return false;
}
private boolean isViolated(RequiredInterfaceNode aFrom,
return false;
}
private boolean isViolated(RequiredInterfaceNode aFrom,
-
ProvidedInterfaceNode aTo) {
- if (
_client.equals(aFrom.getComponent().getName())
-
&& (_required == null || _
required.equals(aFrom.getRequired()
-
.getName()))) {
+ ProvidedInterfaceNode aTo) {
+ if (
client.equals(aFrom.getComponent().getName()) &&
+
((required == null) ||
required.equals(aFrom.getRequired()
+ .getName()))) {
// From part matches.
// From part matches.
- if (
_server == null ) {
+ if (
server == null) {
return true; // all connections are eliminated
}
return true; // all connections are eliminated
}
- if (_server.equals(aTo.getComponent().getName())
- && (_provided == null || _provided.equals(aTo.getProvided()
- .getName()))) {
+
+ if (server.equals(aTo.getComponent().getName()) &&
+ ((provided == null) || provided.equals(aTo.getProvided()
+ .getName()))) {
// to part matches also
return false;
// to part matches also
return false;
- }
- else {
+ } else {
// From matches and to doesn't so edgefilter is violated.
// From matches and to doesn't so edgefilter is violated.
- return true;
+ return true;
}
} else {
// From part does not match, restriction does not apply.
}
} else {
// From part does not match, restriction does not apply.