@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement xml) throws DocumentedException {
final GetSchemaEntry entry;
entry = new GetSchemaEntry(xml);
final String schema;
try {
schema = cap.getSchemaForCapability(entry.identifier, entry.version);
} catch (final IllegalStateException e) {
final Map<String, String> errorInfo = Maps.newHashMap();
errorInfo.put(entry.identifier, e.getMessage());
LOG.warn("Rpc error: {}", DocumentedException.ErrorTag.operation_failed, e);
throw new DocumentedException(e.getMessage(), DocumentedException.ErrorType.application,
DocumentedException.ErrorTag.operation_failed,
DocumentedException.ErrorSeverity.error, errorInfo);
}
final Element getSchemaResult;
getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema,
Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING));
LOG.trace("{} operation successful", GET_SCHEMA);
return getSchemaResult;
}