All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.usecplugin.impl.InventoryUtility Maven / Gradle / Ivy

There is a newer version: 1.0.4-Beryllium-SR4
Show newest version
/*
 * Copyright (c) 2015 Tata Consultancy Services and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.usecplugin.impl;

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;

public final class InventoryUtility {
    public static final String OPENFLOW_NODE_PREFIX = "openflow:";

	/**
	 * @param nodeConnectorRef
	 * @return NodeId getNodeId
	 */

	public static NodeId getNodeId(NodeConnectorRef nodeConnectorRef) {
		return nodeConnectorRef.getValue()
	        .firstKeyOf(Node.class, NodeKey.class)
	        .getId();
	}

	/**
	 * @param nodeConnectorRef
	 * @return NodeConnectorId getNodeConnectorId
	 */

	public static NodeConnectorId getNodeConnectorId(NodeConnectorRef nodeConnectorRef) {
        return nodeConnectorRef.getValue()
            .firstKeyOf(NodeConnector.class, NodeConnectorKey.class)
            .getId();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy