added feature topology manager shell
[controller.git] / opendaylight / topologymanager / shell / src / main / java / org / opendaylight / controller / topologymanager / shell / AddUserLink.java
1 /**
2 * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved.
3 *
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
7 */
8 package org.opendaylight.controller.topologymanager.shell;
9
10 import org.apache.felix.gogo.commands.Command;
11 import org.apache.felix.gogo.commands.Argument;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.controller.topologymanager.ITopologyManagerShell;
14
15 @Command(scope = "topologymanager", name = "addUserLink", description="Adds user link")
16 public class AddUserLink extends OsgiCommandSupport{
17     private ITopologyManagerShell topologyManager;
18
19     @Argument(index=0, name="name", description="name", required=true, multiValued=false)
20     String name = null;
21
22     @Argument(index=1, name="ncStr1", description="ncStr1", required=true, multiValued=false)
23     String ncStr1 = null;
24
25     @Argument(index=2, name="ncStr2", description="ncStr2", required=true, multiValued=false)
26     String ncStr2 = null;
27
28     @Override
29     protected Object doExecute() throws Exception {
30         for(String p : topologyManager.addUserLink(name, ncStr1, ncStr2)) {
31             System.out.println(p);
32         }
33         return null;
34     }
35
36     public void setTopologyManager(ITopologyManagerShell topologyManager){
37         this.topologyManager = topologyManager;
38     }
39 }