X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-docgen%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fdoc%2Fimpl%2FBaseYangSwaggerGenerator.java;h=a261f2380782a1867e88493b1980174668c061bb;hp=5d0f3612e4f3c931c39199a0f180461b8430e0f8;hb=1466ba2e1c9768365d2cc3dfe72bbc7d26cf943d;hpb=4069cc0308f8fd76fffdbf6b010b2d4e25537a95 diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java index 5d0f3612e4..a261f23807 100644 --- a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java +++ b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/BaseYangSwaggerGenerator.java @@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory; public class BaseYangSwaggerGenerator { - private static Logger _logger = LoggerFactory.getLogger(BaseYangSwaggerGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(BaseYangSwaggerGenerator.class); protected static final String API_VERSION = "1.0.0"; protected static final String SWAGGER_VERSION = "1.2"; @@ -84,19 +84,19 @@ public class BaseYangSwaggerGenerator { List resources = new ArrayList<>(modules.size()); - _logger.info("Modules found [{}]", modules.size()); + LOG.info("Modules found [{}]", modules.size()); for (Module module : modules) { String revisionString = SIMPLE_DATE_FORMAT.format(module.getRevision()); Resource resource = new Resource(); - _logger.debug("Working on [{},{}]...", module.getName(), revisionString); + LOG.debug("Working on [{},{}]...", module.getName(), revisionString); ApiDeclaration doc = getApiDeclaration(module.getName(), revisionString, uriInfo, schemaContext, context); if (doc != null) { resource.setPath(generatePath(uriInfo, module.getName(), revisionString)); resources.add(resource); } else { - _logger.debug("Could not generate doc for {},{}", module.getName(), revisionString); + LOG.debug("Could not generate doc for {},{}", module.getName(), revisionString); } } @@ -158,11 +158,11 @@ public class BaseYangSwaggerGenerator { List apis = new ArrayList(); Collection dataSchemaNodes = m.getChildNodes(); - _logger.debug("child nodes size [{}]", dataSchemaNodes.size()); + LOG.debug("child nodes size [{}]", dataSchemaNodes.size()); for (DataSchemaNode node : dataSchemaNodes) { if ((node instanceof ListSchemaNode) || (node instanceof ContainerSchemaNode)) { - _logger.debug("Is Configuration node [{}] [{}]", node.isConfiguration(), node.getQName().getLocalName()); + LOG.debug("Is Configuration node [{}] [{}]", node.isConfiguration(), node.getQName().getLocalName()); List pathParams = new ArrayList(); String resourcePath = getDataStorePath("/config/", context); @@ -173,15 +173,15 @@ public class BaseYangSwaggerGenerator { resourcePath = getDataStorePath("/operational/", context); addApis(node, apis, resourcePath, pathParams, schemaContext, false); } + } - Set rpcs = m.getRpcs(); - for (RpcDefinition rpcDefinition : rpcs) { - String resourcePath = getDataStorePath("/operations/", context); - addRpcs(rpcDefinition, apis, resourcePath, schemaContext); - } + Set rpcs = m.getRpcs(); + for (RpcDefinition rpcDefinition : rpcs) { + String resourcePath = getDataStorePath("/operations/", context); + addRpcs(rpcDefinition, apis, resourcePath, schemaContext); } - _logger.debug("Number of APIs found [{}]", apis.size()); + LOG.debug("Number of APIs found [{}]", apis.size()); if (!apis.isEmpty()) { doc.setApis(apis); @@ -190,8 +190,8 @@ public class BaseYangSwaggerGenerator { try { models = jsonConverter.convertToJsonSchema(m, schemaContext); doc.setModels(models); - if (_logger.isDebugEnabled()) { - _logger.debug(mapper.writeValueAsString(doc)); + if (LOG.isDebugEnabled()) { + LOG.debug(mapper.writeValueAsString(doc)); } } catch (IOException | JSONException e) { e.printStackTrace(); @@ -240,7 +240,7 @@ public class BaseYangSwaggerGenerator { List pathParams = new ArrayList(parentPathParams); String resourcePath = parentPath + createPath(node, pathParams, schemaContext) + "/"; - _logger.debug("Adding path: [{}]", resourcePath); + LOG.debug("Adding path: [{}]", resourcePath); api.setPath(resourcePath); Iterable childSchemaNodes = Collections. emptySet();