Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 499: Initial implementation of data tree modifications
[controller.git]
/
opendaylight
/
md-sal
/
compatibility
/
sal-compatibility
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
compatibility
/
FlowProgrammerAdapter.xtend
diff --git
a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
index fac12ee10d642f3acb0cad9057c699e10d9446fd..8a0874ee3123da1d919db48a5d32e476afb839fc 100644
(file)
--- a/
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
+++ b/
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
@@
-199,9
+199,11
@@
class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowLi
}
private def Future<RpcResult<TransactionStatus>> internalModifyFlowAsync(Node node, Flow oldFlow, Flow newFlow, long rid) {
}
private def Future<RpcResult<TransactionStatus>> internalModifyFlowAsync(Node node, Flow oldFlow, Flow newFlow, long rid) {
- va
l
flowId = getCache().remove(oldFlow);
+ va
r
flowId = getCache().remove(oldFlow);
if(flowId == null){
if(flowId == null){
- throw new IllegalArgumentException("oldFlow is unknown");
+ LOG.error("oldFlow not found in cache : " + oldFlow.hashCode);
+ flowId = UUID.randomUUID();
+ getCache().put(oldFlow, flowId);
}
getCache().put(newFlow, flowId);
}
getCache().put(newFlow, flowId);
@@
-212,7
+214,9
@@
class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowLi
private def Future<RpcResult<TransactionStatus>> internalRemoveFlowAsync(Node node, Flow adflow, long rid){
val flowId = getCache().remove(adflow);
if(flowId == null){
private def Future<RpcResult<TransactionStatus>> internalRemoveFlowAsync(Node node, Flow adflow, long rid){
val flowId = getCache().remove(adflow);
if(flowId == null){
- throw new IllegalArgumentException("adflow is unknown");
+ //throw new IllegalArgumentException("adflow not found in cache : " + adflow.hashCode);
+ LOG.error("adflow not found in cache : " + adflow.hashCode);
+ return null;
}
val flow = adflow.toMDFlow(flowId.toString());
val modification = this._dataBrokerService.beginTransaction();
}
val flow = adflow.toMDFlow(flowId.toString());
val modification = this._dataBrokerService.beginTransaction();
@@
-227,6
+231,10
@@
class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowLi
}
private def toFutureStatus(Future<RpcResult<TransactionStatus>> future){
}
private def toFutureStatus(Future<RpcResult<TransactionStatus>> future){
+ if(future == null){
+ return toStatus(true);
+ }
+
try {
val result = future.get();
return toStatus(result);
try {
val result = future.get();
return toStatus(result);