Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add ModuleInfoBackedContext loading strategy to RuntimeGeneratedMapping service.
[controller.git]
/
opendaylight
/
md-sal
/
sal-rest-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
restconf
/
impl
/
ControllerContext.xtend
diff --git
a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
index c2b82eae632290cc60d48df245d70fa1c583e8b8..f1d412cdb0082960aa02f93dcffbc3b5ba0ca6e3 100644
(file)
--- a/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
+++ b/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
@@
-57,6
+57,8
@@
class ControllerContext implements SchemaServiceListener {
val static MOUNT_MODULE = "yang-ext"
val static MOUNT_NODE = "mount"
public val static MOUNT = "yang-ext:mount"
val static MOUNT_MODULE = "yang-ext"
val static MOUNT_NODE = "mount"
public val static MOUNT = "yang-ext:mount"
+ val static URI_ENCODING_CHAR_SET = "ISO-8859-1"
+ val static URI_SLASH_PLACEHOLDER = "%2F";
@Property
var SchemaContext globalSchema;
@Property
var SchemaContext globalSchema;
@@
-98,7
+100,8
@@
class ControllerContext implements SchemaServiceListener {
private def InstanceIdWithSchemaNode toIdentifier(String restconfInstance, boolean toMountPointIdentifier) {
checkPreconditions
private def InstanceIdWithSchemaNode toIdentifier(String restconfInstance, boolean toMountPointIdentifier) {
checkPreconditions
- val pathArgs = Lists.newArrayList(Splitter.on("/").split(restconfInstance))
+ val encodedPathArgs = Lists.newArrayList(Splitter.on("/").split(restconfInstance))
+ val pathArgs = urlPathArgsDecode(encodedPathArgs)
pathArgs.omitFirstAndLastEmptyString
if (pathArgs.empty) {
return null;
pathArgs.omitFirstAndLastEmptyString
if (pathArgs.empty) {
return null;
@@
-353,7
+356,8
@@
class ControllerContext implements SchemaServiceListener {
private def toUriString(Object object) {
if(object === null) return "";
private def toUriString(Object object) {
if(object === null) return "";
- return URLEncoder.encode(object.toString)
+// return object.toString.replace("/",URI_SLASH_PLACEHOLDER)
+ return URLEncoder.encode(object.toString,URI_ENCODING_CHAR_SET)
}
private def InstanceIdWithSchemaNode collectPathArguments(InstanceIdentifierBuilder builder, List<String> strings,
}
private def InstanceIdWithSchemaNode collectPathArguments(InstanceIdentifierBuilder builder, List<String> strings,
@@
-606,4
+610,13
@@
class ControllerContext implements SchemaServiceListener {
}
}
}
}
+
+ def urlPathArgsDecode(List<String> strings) {
+ val List<String> decodedPathArgs = new ArrayList();
+ for (pathArg : strings) {
+ decodedPathArgs.add(URLDecoder.decode(pathArg, URI_ENCODING_CHAR_SET))
+ }
+ return decodedPathArgs
+ }
+
}
}