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-1622 Fix handling of non-downloadable schemas from remote netconf device
[controller.git]
/
opendaylight
/
md-sal
/
sal-netconf-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
connect
/
netconf
/
schema
/
NetconfRemoteSchemaYangSourceProvider.java
diff --git
a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
index dc90fd3826a4204861a0e4dd69fcbd6436cec9ad..5a528bc418ea386a04b428e047c58fe7d47c74bb 100644
(file)
--- a/
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
+++ b/
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
@@
-16,7
+16,6
@@
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.io.InputStream;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.io.InputStream;
-import java.util.concurrent.ExecutionException;
import org.apache.commons.io.IOUtils;
import org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil;
import org.opendaylight.controller.sal.connect.util.RemoteDeviceId;
import org.apache.commons.io.IOUtils;
import org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil;
import org.opendaylight.controller.sal.connect.util.RemoteDeviceId;
@@
-97,18
+96,18
@@
public final class NetconfRemoteSchemaYangSourceProvider implements SchemaSource
rpc.invokeRpc(GET_SCHEMA_QNAME, getSchemaRequest),
new ResultToYangSourceTransformer(id, sourceIdentifier, moduleName, revision));
rpc.invokeRpc(GET_SCHEMA_QNAME, getSchemaRequest),
new ResultToYangSourceTransformer(id, sourceIdentifier, moduleName, revision));
- // FIXME remove this get, it is only present to wait until source is retrieved
+ final CheckedFuture<YangTextSchemaSource, SchemaSourceException> checked = Futures.makeChecked(transformed, MAPPER);
+
+ // / FIXME remove this get, it is only present to wait until source is retrieved
// (goal is to limit concurrent schema download, since NetconfDevice listener does not handle concurrent messages properly)
try {
logger.trace("{}: Blocking for {}", id, sourceIdentifier);
// (goal is to limit concurrent schema download, since NetconfDevice listener does not handle concurrent messages properly)
try {
logger.trace("{}: Blocking for {}", id, sourceIdentifier);
- transformed.get();
- } catch (final InterruptedException e) {
- throw new RuntimeException(e);
- } catch (final ExecutionException e) {
- throw new IllegalStateException(id + ": Failed while getting source: " + sourceIdentifier, e);
+ checked.checkedGet();
+ } catch (final SchemaSourceException e) {
+ return Futures.immediateFailedCheckedFuture(e);
}
}
- return
Futures.makeChecked(transformed, MAPPER)
;
+ return
checked
;
}
/**
}
/**