use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ManagersKey in project netvirt by opendaylight.
the class HwvtepHAUtil method buildManagersForHANode.
/**
* Transform child managers (Source) to HA managers using HA node path.
*
* @param childNode Child Node
* @param haGlobalCfg HA global config node
* @return Transformed managers
*/
public static List<Managers> buildManagersForHANode(Node childNode, Optional<Node> haGlobalCfg) {
Set<NodeId> nodeIds = new HashSet<>();
nodeIds.add(childNode.getNodeId());
List<NodeId> childNodeIds = getChildNodeIdsFromManagerOtherConfig(haGlobalCfg);
nodeIds.addAll(childNodeIds);
ManagersBuilder builder1 = new ManagersBuilder();
builder1.setKey(new ManagersKey(new Uri(MANAGER_KEY)));
List<ManagerOtherConfigs> otherConfigses = new ArrayList<>();
StringBuffer stringBuffer = new StringBuffer();
for (NodeId nodeId : nodeIds) {
stringBuffer.append(nodeId.getValue());
stringBuffer.append(",");
}
String children = stringBuffer.substring(0, stringBuffer.toString().length() - 1);
otherConfigses.add(getOtherConfigBuilder(HA_CHILDREN, children).build());
builder1.setManagerOtherConfigs(otherConfigses);
List<Managers> managers = new ArrayList<>();
managers.add(builder1.build());
return managers;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ManagersKey in project netvirt by opendaylight.
the class TestBuilders method buildManagers.
public static List<Managers> buildManagers() {
ManagersBuilder builder1 = new ManagersBuilder();
builder1.setKey(new ManagersKey(new Uri("test")));
List<ManagerOtherConfigs> otherConfigses = new ArrayList<>();
otherConfigses.add(buildOtherConfig("ha_enabled", "true"));
otherConfigses.add(buildOtherConfig("ha_id", "switchxyz"));
builder1.setManagerOtherConfigs(otherConfigses);
List<Managers> managers = new ArrayList<>();
managers.add(builder1.build());
return managers;
}
Aggregations