Bug 6795 - Deprecated sal-dom-xsql
[controller.git] / opendaylight / md-sal / sal-karaf-xsql / src / main / java / org / opendaylight / controller / xsql / xsql.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. 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
9 package org.opendaylight.controller.xsql;
10
11 import org.apache.karaf.shell.commands.Argument;
12 import org.apache.karaf.shell.commands.Command;
13 import org.apache.karaf.shell.commands.Option;
14 import org.apache.karaf.shell.console.OsgiCommandSupport;
15 import org.opendaylight.controller.md.sal.dom.xsql.XSQLAdapter;
16
17 /**
18  * To be removed in Nitrogen
19  */
20 @Deprecated
21 @Command(scope = "odl", name = "xsql", description = "XSQL Karaf Command")
22 public class xsql extends OsgiCommandSupport {
23
24     @Option(name = "-o", aliases = { "--option" }, description = "An option to the command", required = false, multiValued = false)
25     private String option;
26
27     @Argument(name = "argument", description = "Argument to the command", required = false, multiValued = false)
28     private String argument;
29
30     protected Object doExecute() throws Exception {
31         if(argument==null){
32             System.out.println("Nothing to do..., please specify a command.");
33             return null;
34         }
35         XSQLAdapter.getInstance().processCommand(new StringBuffer(argument),
36                 System.out);
37         return null;
38     }
39 }