*/
package org.opendaylight.netvirt.elan.recovery.impl;
+import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
+
import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
import javax.inject.Singleton;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netvirt.elan.internal.ElanServiceProvider;
import org.opendaylight.netvirt.elan.utils.ElanUtils;
import org.opendaylight.serviceutils.srm.ServiceRecoveryInterface;
.getElanInterfaceConfigurationDataPathId(entityId);
try {
LOG.trace("deleting elan interface {}", entityId);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.delete(LogicalDatastoreType.CONFIGURATION, elanInterfaceId)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ tx -> tx.delete(elanInterfaceId)).get();
LOG.trace("recreating elan interface {}, {}", entityId, elanInterface);
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- tx -> tx.put(LogicalDatastoreType.CONFIGURATION, elanInterfaceId, elanInterface)).get();
+ txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
+ tx -> tx.put(elanInterfaceId, elanInterface)).get();
} catch (InterruptedException | ExecutionException e) {
LOG.error("Service recovery failed for elan interface {}", entityId, e);
}
}
}
- private String buildServiceRegistryKey() {
+ private static String buildServiceRegistryKey() {
return NetvirtElanInterface.class.toString();
}
}