- RoutingTable addRpcs(final Collection<RouteIdentifier<?, ?, ?>> toAdd) {
- final Set<RouteIdentifier<?, ?, ?>> newRpcs = new HashSet<>(rpcs);
- newRpcs.addAll(toAdd);
- return new RoutingTable(rpcInvoker, newRpcs);
+ final NormalizedNodeDataInput nnin = NormalizedNodeDataInput.newDataInput(in);
+ final int size = nnin.readInt();
+ rpcs = new ArrayList<>(size);
+ for (int i = 0; i < size; ++i) {
+ // TODO: we should be able to get by with just a QName
+ rpcs.add(DOMRpcIdentifier.create(nnin.readSchemaNodeIdentifier().firstNodeIdentifier(),
+ nnin.readYangInstanceIdentifier()));
+ }
+ }
+
+ private Object readResolve() {
+ return new RoutingTable(opsInvoker, rpcs);
+ }