2 * Copyright (c) 2015 Huawei, Inc. 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
9 package org.opendaylight.nemo.renderer.cli.physicalnetwork;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.PhysicalNodeInstance;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.physical.network.rev151010.PhysicalPortInstance;
14 import java.io.BufferedReader;
15 import java.io.FileInputStream;
16 import java.io.IOException;
17 import java.io.InputStreamReader;
20 * Created by hj on 11/5/15.
24 protected static PhysicalNodeInstance.NodeType getNodeType(String strType){
27 return PhysicalNodeInstance.NodeType.Switch;
29 return PhysicalNodeInstance.NodeType.Router;
31 return PhysicalNodeInstance.NodeType.Firewall;
33 return PhysicalNodeInstance.NodeType.Loadbalancer;
37 protected static PhysicalPortInstance.PortType getPortType(String strType){
40 return PhysicalPortInstance.PortType.External;
42 return PhysicalPortInstance.PortType.Internal;
44 protected static String readFile(String Path){
45 BufferedReader reader = null;
48 FileInputStream fileInputStream = new FileInputStream(Path);
49 InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
50 reader = new BufferedReader(inputStreamReader);
51 String tempString = null;
52 while((tempString = reader.readLine()) != null){
53 laststr += tempString;
56 }catch(IOException e){
57 // TODO Auto-generated catch block
62 } catch (IOException e) {
63 // TODO Auto-generated catch block