@Test public void buildRpcReplyData() throws Exception { String data = "<boards xmlns=\"urn:huawei:params:xml:ns:yang:huawei-board\">\n" + " <board>\n" + " <name>0.9</name>\n" + " <description>H901MPLB_0_9</description>\n" + " </board>\n" + " <board>\n" + " <name>0.10</name>\n" + " <description>H901PILA_0_10</description>\n" + " </board>\n" + "</boards>"; List<Node> nodes = new ArrayList<>(); Document document = AggregatorUtils.stringToDocument(data); nodes.add(document.getFirstChild()); String reply = NetconfRpcReplyMessage.buildRpcReplyDataV10(MESSAGE_ID, nodes); assertTrue(reply.contains("huawei-board")); assertTrue(reply.contains(V10)); reply = NetconfRpcReplyMessage.buildRpcReplyDataV11(MESSAGE_ID, nodes); assertTrue(reply.contains("H901MPLB_0_9")); assertTrue(reply.contains(V11)); }
public static <T extends RpcReply> String buildRpcReplyData(Class<T> replyClass, String messageId, List<Object> objects) { return buildRpcReplyContext(replyClass, messageId, reply -> { Data data = new Data(); data.setObjects(objects); reply.setData(data); }); }
NetconfRpcReplyMessage extends NetconfPayload { public static <T extends RpcReply> String buildRpcReplyData(Class<T> replyClass, String messageId, List<Object> objects) { return buildRpcReplyContext(replyClass, messageId, reply -> { Data data = new Data(); data.setObjects(objects); reply.setData(data); }); } }
NetconfRpcReplyMessage extends NetconfPayload { public static <T extends RpcReply> String buildRpcReplyData(Class<T> replyClass, String messageId, List<Object> objects) { return buildRpcReplyContext(replyClass, messageId, reply -> { Data data = new Data(); data.setObjects(objects); reply.setData(data); }); } private  NetconfRpcReplyMessage();  NetconfRpcReplyMessage(String netconfMessage); }
NetconfRpcReplyMessage extends NetconfPayload { public static <T extends RpcReply> String buildRpcReplyData(Class<T> replyClass, String messageId, List<Object> objects) { return buildRpcReplyContext(replyClass, messageId, reply -> { Data data = new Data(); data.setObjects(objects); reply.setData(data); }); } private  NetconfRpcReplyMessage();  NetconfRpcReplyMessage(String netconfMessage); static List<Object> getRpcReplyPayloadObjects(RpcReply rpcReply); static List<Document> getRpcReplyPayloads(RpcReply rpcReply); static RpcReply getRpcReply(String netconfMessage); RpcReply getRpcReply(); static String buildRpcReplyOkV10(String messageId); static String buildRpcReplyOkV11(String messageId); static String buildRpcReplyDataV10(String messageId, List<Node> nodes); static String buildRpcReplyDataV11(String messageId, List<Node> nodes); static String buildRpcReplyErrorV10(String messageId, RpcError rpcError); static String buildRpcReplyErrorV11(String messageId, RpcError rpcError); static String buildRpcReplyOk(Class<T> replyClass, String messageId); static String buildRpcReplyData(Class<T> replyClass,
                                                                String messageId, List<Object> objects); static String buildRpcReplyError(Class<T> replyClass,
                                                                 String messageId, RpcError rpcError); }
NetconfRpcReplyMessage extends NetconfPayload { public static <T extends RpcReply> String buildRpcReplyData(Class<T> replyClass, String messageId, List<Object> objects) { return buildRpcReplyContext(replyClass, messageId, reply -> { Data data = new Data(); data.setObjects(objects); reply.setData(data); }); } private  NetconfRpcReplyMessage();  NetconfRpcReplyMessage(String netconfMessage); static List<Object> getRpcReplyPayloadObjects(RpcReply rpcReply); static List<Document> getRpcReplyPayloads(RpcReply rpcReply); static RpcReply getRpcReply(String netconfMessage); RpcReply getRpcReply(); static String buildRpcReplyOkV10(String messageId); static String buildRpcReplyOkV11(String messageId); static String buildRpcReplyDataV10(String messageId, List<Node> nodes); static String buildRpcReplyDataV11(String messageId, List<Node> nodes); static String buildRpcReplyErrorV10(String messageId, RpcError rpcError); static String buildRpcReplyErrorV11(String messageId, RpcError rpcError); static String buildRpcReplyOk(Class<T> replyClass, String messageId); static String buildRpcReplyData(Class<T> replyClass,
                                                                String messageId, List<Object> objects); static String buildRpcReplyError(Class<T> replyClass,
                                                                 String messageId, RpcError rpcError);  }