public final class NetconfRemoteSchemaYangSourceProvider implements SchemaSourceProvider<YangTextSchemaSource> {
- private static final Logger logger = LoggerFactory.getLogger(NetconfRemoteSchemaYangSourceProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NetconfRemoteSchemaYangSourceProvider.class);
private static final ExceptionMapper<SchemaSourceException> MAPPER = new ExceptionMapper<SchemaSourceException>(
"schemaDownload", SchemaSourceException.class) {
final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> builder = Builders.containerBuilder();
builder.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(NetconfMessageTransformUtil.GET_SCHEMA_QNAME))
- .withChild(identifier)
- .withChild(format);
+ .withChild(identifier).withChild(format);
if(revision.isPresent()) {
final QName revisionQName = QName.cachedReference(QName.create(NetconfMessageTransformUtil.GET_SCHEMA_QNAME, "version"));
final Optional<String> revision = Optional.fromNullable(formattedRevision);
final NormalizedNode<?, ?> getSchemaRequest = createGetSchemaRequest(moduleName, revision);
- logger.trace("{}: Loading YANG schema source for {}:{}", id, moduleName, revision);
+ LOG.trace("{}: Loading YANG schema source for {}:{}", id, moduleName,
+ revision);
final ListenableFuture<YangTextSchemaSource> transformed = Futures.transform(
rpc.invokeRpc(SchemaPath.create(true, NetconfMessageTransformUtil.GET_SCHEMA_QNAME), getSchemaRequest),
// (goal is to limit concurrent schema download, since NetconfDevice listener does not handle concurrent messages properly)
// TODO retest this
try {
- logger.trace("{}: Blocking for {}", id, sourceIdentifier);
+ LOG.trace("{}: Blocking for {}", id, sourceIdentifier);
checked.checkedGet();
} catch (final SchemaSourceException e) {
return Futures.immediateFailedCheckedFuture(e);
Preconditions.checkState(schemaString.isPresent(),
"%s: Unexpected response to get-schema, schema not present in message for: %s", id, sourceIdentifier);
- logger.debug("{}: YANG Schema successfully retrieved for {}:{}", id, moduleName, revision);
+ LOG.debug("{}: YANG Schema successfully retrieved for {}:{}",
+ id, moduleName, revision);
return new NetconfYangTextSchemaSource(id, sourceIdentifier, schemaString);
}
- logger.warn("{}: YANG schema was not successfully retrieved for {}. Errors: {}", id, sourceIdentifier,
- input.getErrors());
+ LOG.warn(
+ "{}: YANG schema was not successfully retrieved for {}. Errors: {}",
+ id, sourceIdentifier, input.getErrors());
throw new IllegalStateException(String.format(
"%s: YANG schema was not successfully retrieved for %s. Errors: %s", id, sourceIdentifier,