use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.
the class StatisticsImpl method releaseId.
private void releaseId(String idKey) {
ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(CountersServiceUtils.COUNTERS_PULL_NAME).setIdKey(idKey).build();
try {
Future<RpcResult<Void>> result = idManagerService.releaseId(idInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("RPC Call to release Id with Key {} returned with Errors {}", idKey, rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when releasing Id for key {}", idKey, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.
the class AclServiceUtils method releaseId.
public static void releaseId(IdManagerService idManager, String poolName, String idKey) {
ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build();
try {
Future<RpcResult<Void>> result = idManager.releaseId(idInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.error("RPC Call to release Id with Key {} from pool {} returned with Errors {}", idKey, poolName, rpcResult.getErrors());
} else {
LOG.debug("Released ACL ID with key: {} from pool: {}", idKey, poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Exception when releasing Id for key {} from pool {} ", idKey, poolName, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.
the class NatEvpnUtil method releaseLPortTagForRouter.
public static void releaseLPortTagForRouter(DataBroker dataBroker, IdManagerService idManager, String routerName) {
String rd = NatUtil.getVpnRd(dataBroker, routerName);
long l3Vni = NatEvpnUtil.getL3Vni(dataBroker, rd);
if (!NatEvpnUtil.isL3VpnOverVxLan(l3Vni)) {
LOG.info("releaseLPortTagForRouter : Router:{} is not part of L3VPNOverVxlan", routerName);
return;
}
ReleaseIdInput getIdInput = new ReleaseIdInputBuilder().setPoolName(IfmConstants.IFM_IDPOOL_NAME).setIdKey(routerName).build();
try {
Future<RpcResult<Void>> result = idManager.releaseId(getIdInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.error("releaseLPortTagForRouter:ID manager failed while releasing allocated lport_tag " + "for router {}. Exception {} ", routerName, rpcResult.getErrors());
return;
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("releaseLPortTagForRouter:ID : ID manager failed while releasing allocated lport_tag " + "for router {}.", routerName, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.
the class NatOverVxlanUtil method releaseVNI.
public static void releaseVNI(String vniKey, IdManagerService idManager) {
ReleaseIdInput releaseIdInput = new ReleaseIdInputBuilder().setPoolName(NatConstants.ODL_VNI_POOL_NAME).setIdKey(vniKey).build();
try {
Future<RpcResult<Void>> result = idManager.releaseId(releaseIdInput);
RpcResult<Void> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("releaseVNI : Unable to release ID {} from OpenDaylight VXLAN VNI range pool. Error {}", vniKey, rpcResult.getErrors());
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("releaseVNI : Exception in release VNI for Key {}", vniKey, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.
the class ElanUtils method releaseId.
public static void releaseId(IdManagerService idManager, String poolName, String idKey) {
ReleaseIdInput releaseIdInput = new ReleaseIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build();
JdkFutures.addErrorLogging(idManager.releaseId(releaseIdInput), LOG, "Release Id");
}
Aggregations