Do not use currently-deprecated APIs
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / restconf / impl / ControllerContext.xtend
index 482dcf8e8b37e5427c2470122bae9a15e3189a84..2b9c78bb87a2134313676e0097f47e18ca8bd17e 100644 (file)
@@ -43,14 +43,14 @@ import org.opendaylight.yangtools.yang.model.api.ListSchemaNode
 import org.opendaylight.yangtools.yang.model.api.Module
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition
 import org.opendaylight.yangtools.yang.model.api.SchemaContext
-import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener
+import org.opendaylight.yangtools.yang.model.api.SchemaContextListener
 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition
 import org.slf4j.LoggerFactory
 
 import static com.google.common.base.Preconditions.*
 import static javax.ws.rs.core.Response.Status.*
 
-class ControllerContext implements SchemaServiceListener {
+class ControllerContext implements SchemaContextListener {
     val static LOG = LoggerFactory.getLogger(ControllerContext)
     val static ControllerContext INSTANCE = new ControllerContext
     val static NULL_VALUE = "null"
@@ -356,7 +356,6 @@ class ControllerContext implements SchemaServiceListener {
 
     private def toUriString(Object object) {
         if(object === null) return "";
-//        return object.toString.replace("/",URI_SLASH_PLACEHOLDER)
         return URLEncoder.encode(object.toString,URI_ENCODING_CHAR_SET)        
     }
     
@@ -620,6 +619,13 @@ class ControllerContext implements SchemaServiceListener {
             decodedPathArgs.add(URLDecoder.decode(pathArg, URI_ENCODING_CHAR_SET))
         }
         return decodedPathArgs
+    }
+
+    def urlPathArgDecode(String pathArg) {
+        if (pathArg !== null) {
+            return URLDecoder.decode(pathArg, URI_ENCODING_CHAR_SET)
+        }
+        return null
     }    
 
 }