InstanceIdentifier<VpnInstances> id = InstanceIdentifier.builder(VpnInstances.class).build();
Optional<VpnInstances> optVpnInstances = read(broker, LogicalDatastoreType.CONFIGURATION, id);
if (optVpnInstances.isPresent() && optVpnInstances.get().getVpnInstance() != null) {
- return optVpnInstances.get().getVpnInstance();
+ return new ArrayList<VpnInstance>(optVpnInstances.get().getVpnInstance().values());
} else {
return Collections.emptyList();
}
@Nullable
public static String getFirstVpnNameFromVpnInterface(final VpnInterface original) {
- List<VpnInstanceNames> optList = original.getVpnInstanceNames();
+ List<VpnInstanceNames> optList = new ArrayList<VpnInstanceNames>(original.getVpnInstanceNames().values());
if (optList != null && !optList.isEmpty()) {
return optList.get(0).getVpnName();
} else {