2 * Copyright (c) 2017 Hewlett Packard Enterprise, Co. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netvirt.federation.plugin.identifiers;
10 import javax.annotation.PostConstruct;
11 import javax.inject.Inject;
12 import javax.inject.Singleton;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.netvirt.federation.plugin.FederationPluginConstants;
16 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
17 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
18 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
19 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 public class FederationTopologyHwvtepNodeIdentifier
25 implements FederationPluginIdentifier<Node, Topology, NetworkTopology> {
27 private static final Logger LOG = LoggerFactory.getLogger(FederationTopologyHwvtepNodeIdentifier.class);
30 public FederationTopologyHwvtepNodeIdentifier() {
31 FederationPluginIdentifierRegistry.registerIdentifier(
32 FederationPluginConstants.TOPOLOGY_HWVTEP_NODE_CONFIG_KEY, LogicalDatastoreType.CONFIGURATION, this);
33 FederationPluginIdentifierRegistry.registerIdentifier(
34 FederationPluginConstants.TOPOLOGY_HWVTEP_NODE_OPER_KEY, LogicalDatastoreType.OPERATIONAL, this);
39 LOG.info("{} start", getClass().getSimpleName());
43 public InstanceIdentifier<Node> getInstanceIdentifier() {
44 InstanceIdentifier<Node> nodeId = InstanceIdentifier.create(NetworkTopology.class)
45 .child(Topology.class, FederationPluginConstants.HWVTEP_TOPOLOGY_KEY).child(Node.class);
46 LOG.info("InstanceId: {}", nodeId);
51 public InstanceIdentifier<Topology> getParentInstanceIdentifier() {
52 return InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
53 FederationPluginConstants.HWVTEP_TOPOLOGY_KEY);
57 public InstanceIdentifier<NetworkTopology> getSubtreeInstanceIdentifier() {
58 return InstanceIdentifier.create(NetworkTopology.class);