use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder in project genius by opendaylight.
the class IdManagerTest method testAllocateId.
@Test
public void testAllocateId() throws Exception {
CreateIdPoolInput createIdPoolInput = new CreateIdPoolInputBuilder().setHigh(ID_HIGH).setLow(ID_LOW).setPoolName(ID_POOL_NAME).build();
AllocateIdInput allocateIdInput = new AllocateIdInputBuilder().setIdKey(TEST_KEY1).setPoolName(ID_POOL_NAME).build();
idManagerService.createIdPool(createIdPoolInput);
assertEquals(idManagerService.allocateId(allocateIdInput).get().getResult().getIdValue().longValue(), 0L);
coordinatorEventsWaiter.awaitEventsConsumption();
validateIdPools(ExpectedAllocateIdObjects.idPoolParent(), ExpectedAllocateIdObjects.idPoolChild());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder in project genius by opendaylight.
the class InterfacemgrProvider method createIdPool.
private void createIdPool() {
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(IfmConstants.IFM_IDPOOL_NAME).setLow(IfmConstants.IFM_ID_POOL_START).setHigh(IfmConstants.IFM_ID_POOL_END).build();
// TODO: Error handling
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
try {
if (result != null && result.get().isSuccessful()) {
LOG.debug("Created IdPool for InterfaceMgr");
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to create idPool for InterfaceMgr", e);
}
}
Aggregations