Search in sources :

Example 1 with ReleaseIdInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder 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);
    }
}
Also used : ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) ExecutionException(java.util.concurrent.ExecutionException)

Example 2 with ReleaseIdInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder 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);
    }
}
Also used : ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) ExecutionException(java.util.concurrent.ExecutionException)

Example 3 with ReleaseIdInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder 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);
    }
}
Also used : ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) ExecutionException(java.util.concurrent.ExecutionException)

Example 4 with ReleaseIdInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder 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);
    }
}
Also used : ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput) ExecutionException(java.util.concurrent.ExecutionException)

Example 5 with ReleaseIdInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder 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");
}
Also used : ReleaseIdInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder) ReleaseIdInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput)

Aggregations

ReleaseIdInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder)17 ReleaseIdInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput)16 ExecutionException (java.util.concurrent.ExecutionException)12 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)12 UncheckedExecutionException (com.google.common.util.concurrent.UncheckedExecutionException)1 Test (org.junit.Test)1 AllocateIdInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput)1 AllocateIdInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder)1 CreateIdPoolInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput)1 CreateIdPoolInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder)1