* DOMRpcService proxy that attaches reset-keepalive-task and schedule
* request-timeout-task to each RPC invocation.
*/
- private static final class KeepaliveDOMRpcService implements DOMRpcService {
+ public static final class KeepaliveDOMRpcService implements DOMRpcService {
private final DOMRpcService deviceRpc;
private ResetKeepalive resetKeepaliveTask;
this.executor = executor;
}
+ public DOMRpcService getDeviceRpc() {
+ return deviceRpc;
+ }
+
@Nonnull
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath type,
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
+import org.opendaylight.netconf.sal.connect.netconf.sal.KeepaliveSalFacade.KeepaliveDOMRpcService;
import org.opendaylight.netconf.sal.connect.netconf.sal.SchemalessNetconfDeviceRpc;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.copy.config.input.target.ConfigTarget;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.edit.config.input.EditContent;
public NetconfBaseOps(final DOMRpcService rpc, final SchemaContext schemaContext) {
this.rpc = rpc;
this.schemaContext = schemaContext;
- if (rpc instanceof SchemalessNetconfDeviceRpc) {
+
+ if ((rpc instanceof KeepaliveDOMRpcService)
+ && (((KeepaliveDOMRpcService) rpc).getDeviceRpc() instanceof SchemalessNetconfDeviceRpc)) {
this.transformer = new SchemalessRpcStructureTransformer();
} else {
this.transformer = new NetconfRpcStructureTransformer(schemaContext);
LOG.debug("Error parsing json input:", exception);
throw new RestconfDocumentedException("Error parsing json input: Failed to create new parse result data. "
- + "Are you creating multiple resources/subresources in POST request?");
+ + "Are you creating multiple resources/subresources in POST request?", exception);
}
LOG.debug("Error parsing json input", exception);
LOG.debug("Error parsing xml input", e);
throw new RestconfDocumentedException("Error parsing input: " + e.getMessage(), ErrorType.PROTOCOL,
- ErrorTag.MALFORMED_MESSAGE);
+ ErrorTag.MALFORMED_MESSAGE, e);
}
}
LOG.debug("Error parsing json input:", exception);
throw new RestconfDocumentedException("Error parsing json input: Failed to create new parse result data. "
- + "Are you creating multiple resources/subresources in POST request?");
+ + "Are you creating multiple resources/subresources in POST request?", exception);
}
LOG.debug("Error parsing json input", exception);
LOG.debug("Error parsing xml input", e);
throw new RestconfDocumentedException("Error parsing input: " + e.getMessage(), ErrorType.PROTOCOL,
- ErrorTag.MALFORMED_MESSAGE);
+ ErrorTag.MALFORMED_MESSAGE, e);
}
}