- public static boolean isGetOperation(final QName rpc) {
- return NETCONF_URI.equals(rpc.getNamespace()) && rpc.getLocalName().equals(NETCONF_GET_QNAME.getLocalName());
- }
-
- public static boolean isGetConfigOperation(final QName rpc) {
- return NETCONF_URI.equals(rpc.getNamespace()) && rpc.getLocalName().equals(NETCONF_GET_CONFIG_QNAME.getLocalName());
- }
-
- public static boolean isDataEditOperation(final QName rpc) {
- return NETCONF_URI.equals(rpc.getNamespace())
- && rpc.getLocalName().equals(NETCONF_EDIT_CONFIG_QNAME.getLocalName());
- }
-
- /**
- * Creates artificial schema node for edit-config rpc. This artificial schema looks like:
- * <pre>
- * {@code
- * rpc
- * edit-config
- * config
- * // All schema nodes from remote schema
- * config
- * edit-config
- * rpc
- * }
- * </pre>
- *
- * This makes the translation of rpc edit-config request(especially the config node)
- * to xml use schema which is crucial for some types of nodes e.g. identity-ref.
- */
- public static DataNodeContainer createSchemaForEdit(final SchemaContext schemaContext) {
- final QName config = QName.create(NETCONF_EDIT_CONFIG_QNAME, "config");
- final QName editConfig = QName.create(NETCONF_EDIT_CONFIG_QNAME, "edit-config");
- final NodeContainerProxy configProxy = new NodeContainerProxy(config, schemaContext.getChildNodes());
- final NodeContainerProxy editConfigProxy = new NodeContainerProxy(editConfig, Sets.<DataSchemaNode>newHashSet(configProxy));
- return new NodeContainerProxy(NETCONF_RPC_QNAME, Sets.<DataSchemaNode>newHashSet(editConfigProxy));
+ public static ContainerSchemaNode createSchemaForDataRead(final SchemaContext schemaContext) {
+ final QName config = QName.create(NETCONF_EDIT_CONFIG_QNAME, "data");
+ return new NodeContainerProxy(config, schemaContext.getChildNodes());