Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge changes I805ec065,Idc9995b1
[controller.git]
/
opendaylight
/
md-sal
/
sal-rest-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
rest
/
impl
/
JsonMapper.java
diff --git
a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java
b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java
index 357b599ec75917bb7f4e9cbc91fe458c8fec8845..226eff44e133a7ad311253740d6d77ea28a1d411 100644
(file)
--- a/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java
+++ b/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java
@@
-134,7
+134,7
@@
class JsonMapper {
private DataSchemaNode findFirstSchemaForNode(Node<?> node, Set<DataSchemaNode> dataSchemaNode) {
for (DataSchemaNode dsn : dataSchemaNode) {
private DataSchemaNode findFirstSchemaForNode(Node<?> node, Set<DataSchemaNode> dataSchemaNode) {
for (DataSchemaNode dsn : dataSchemaNode) {
- if (node.getNodeType().
getLocalName().equals(dsn.getQName().getLocal
Name())) {
+ if (node.getNodeType().
equals(dsn.getQ
Name())) {
return dsn;
} else if (dsn instanceof ChoiceNode) {
for (ChoiceCaseNode choiceCase : ((ChoiceNode) dsn).getCases()) {
return dsn;
} else if (dsn instanceof ChoiceNode) {
for (ChoiceCaseNode choiceCase : ((ChoiceNode) dsn).getCases()) {
@@
-252,14
+252,18
@@
class JsonMapper {
result.append("/");
writeModuleNameAndIdentifier(result, identityValue);
result.append("/");
writeModuleNameAndIdentifier(result, identityValue);
- if (identityValue.getPredicates() != null) {
+ if (identityValue.getPredicates() != null
&& !identityValue.getPredicates().isEmpty()
) {
for (Predicate predicate : identityValue.getPredicates()) {
IdentityValue identityValuePredicate = predicate.getName();
result.append("[");
for (Predicate predicate : identityValue.getPredicates()) {
IdentityValue identityValuePredicate = predicate.getName();
result.append("[");
- writeModuleNameAndIdentifier(result, identityValuePredicate);
- result.append("=\"");
+ if (identityValuePredicate == null) {
+ result.append(".");
+ } else {
+ writeModuleNameAndIdentifier(result, identityValuePredicate);
+ }
+ result.append("='");
result.append(predicate.getValue());
result.append(predicate.getValue());
- result.append("
\"
");
+ result.append("
'
");
result.append("]");
}
}
result.append("]");
}
}
@@
-300,10
+304,16
@@
class JsonMapper {
String nameForOutput = node.getNodeType().getLocalName();
if (schema.isAugmenting()) {
ControllerContext contContext = ControllerContext.getInstance();
String nameForOutput = node.getNodeType().getLocalName();
if (schema.isAugmenting()) {
ControllerContext contContext = ControllerContext.getInstance();
- CharSequence moduleName;
- moduleName = contContext.toRestconfIdentifier(schema.getQName());
+ CharSequence moduleName = null;
+ if (mountPoint == null) {
+ moduleName = contContext.toRestconfIdentifier(schema.getQName());
+ } else {
+ moduleName = contContext.toRestconfIdentifier(mountPoint, schema.getQName());
+ }
if (moduleName != null) {
nameForOutput = moduleName.toString();
if (moduleName != null) {
nameForOutput = moduleName.toString();
+ } else {
+ logger.info("Module '{}' was not found in schema from mount point", schema.getQName());
}
}
writer.name(nameForOutput);
}
}
writer.name(nameForOutput);