package org.opendaylight.netvirt.neutronvpn;
-import com.google.common.base.Optional;
-import javax.annotation.Nonnull;
+import java.util.Optional;
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.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.genius.mdsalutil.cache.DataObjectCache;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.genius.mdsalutil.cache.InstanceIdDataObjectCache;
import org.opendaylight.infrautils.caches.CacheProvider;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.hostconfig.rev150712.hostconfig.attributes.Hostconfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.hostconfig.rev150712.hostconfig.attributes.hostconfigs.Hostconfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.hostconfig.rev150712.hostconfig.attributes.hostconfigs.HostconfigKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@Singleton
-public class HostConfigCache extends DataObjectCache<Hostconfig> {
+public class HostConfigCache extends InstanceIdDataObjectCache<Hostconfig> {
@Inject
public HostConfigCache(DataBroker dataBroker, CacheProvider cacheProvider) {
super(Hostconfig.class, dataBroker, LogicalDatastoreType.OPERATIONAL,
cacheProvider);
}
- public Optional<Hostconfig> get(@Nonnull String hostId) throws ReadFailedException {
+ public Optional<Hostconfig> get(@NonNull String hostId) throws ReadFailedException {
InstanceIdentifier<Hostconfig> hostConfigPath = InstanceIdentifier.builder(Neutron.class)
.child(Hostconfigs.class)
.child(Hostconfig.class, new HostconfigKey(hostId, "ODL L2"))