Search in sources :

Example 11 with ReleaseIdInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.

the class NaptManager method removePortFromPool.

void removePortFromPool(String internalIpPort, String externalIp) {
    LOG.debug("removePortFromPool : method called");
    ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(externalIp).setIdKey(internalIpPort).build();
    try {
        Future<RpcResult<Void>> result = idManager.releaseId(idInput);
        RpcResult<Void> rpcResult = result.get();
        if (!rpcResult.isSuccessful()) {
            LOG.error("removePortFromPool : idmanager failed to remove port from pool {}", rpcResult.getErrors());
        }
        LOG.debug("removePortFromPool : Removed port from pool for InternalIpPort {} with externalIp {}", internalIpPort, externalIp);
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("removePortFromPool : idmanager failed when removing entry in pool with key {} with Exception", internalIpPort, 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) UncheckedExecutionException(com.google.common.util.concurrent.UncheckedExecutionException) ExecutionException(java.util.concurrent.ExecutionException)

Example 12 with ReleaseIdInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.

the class FibUtil method releaseId.

void releaseId(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 Get Unique Id for key {} returned with Errors {}", idKey, rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.warn("Exception when getting Unique 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 13 with ReleaseIdInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.

the class NexthopManager method removeNextHopPointer.

protected void removeNextHopPointer(String nexthopKey) {
    ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(NEXTHOP_ID_POOL_NAME).setIdKey(nexthopKey).build();
    try {
        Future<RpcResult<Void>> result = idManager.releaseId(idInput);
        RpcResult<Void> rpcResult = result.get();
        if (!rpcResult.isSuccessful()) {
            LOG.error("RPC Call to Get Unique Id for nexthopKey {} returned with Errors {}", nexthopKey, rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.warn("Exception when getting Unique Id for key {}", nexthopKey, 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 14 with ReleaseIdInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.

the class NeutronvpnUtils method releaseRDId.

protected void releaseRDId(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 Get Unique Id returned with errors for poolname {} and ID Key {}: {}", poolName, idKey, rpcResult.getErrors());
        } else {
            LOG.info("ID {} for RD released successfully", idKey);
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("Exception when trying to release ID for poolname {} and ID Key {}", poolName, 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 15 with ReleaseIdInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput in project netvirt by opendaylight.

the class PolicyIdManager method releaseId.

private void releaseId(String key, String poolName) {
    idCache.get(poolName).remove(key);
    ReleaseIdInput idInput = new ReleaseIdInputBuilder().setPoolName(poolName).setIdKey(key).build();
    try {
        Future<RpcResult<Void>> result = idManager.releaseId(idInput);
        RpcResult<Void> rpcResult = result.get();
        if (!rpcResult.isSuccessful()) {
            LOG.warn("RPC Call to release {} returned with Errors {}", key, rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.warn("Exception thrown while releasing id for key {}", key);
    }
}
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)

Aggregations

ReleaseIdInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput)16 ReleaseIdInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder)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