f47739a55ded9134d166bc70b8da18d12d4b4bf0
[lispflowmapping.git] / mappingservice / shell / src / main / java / org / opendaylight / lispflowmapping / shell / LispAddKey.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc.  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.lispflowmapping.shell;
10
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell;
14
15 /**
16  * This class implements the "mappingservice:addkey" Karaf shell command.
17  *
18  * @author Lorand Jakab
19  *
20  */
21 @Command(scope = "mappingservice", name = "addkey", description = "Add an authentication key")
22 public class LispAddKey  extends OsgiCommandSupport {
23     private IMappingServiceShell mappingServiceShell;
24
25     @Override
26     protected Object doExecute() throws Exception {
27         mappingServiceShell.addDefaultKeyIPv4();
28         mappingServiceShell.addDefaultKeyIPv6();
29         return null;
30     }
31
32     public void setMappingServiceShell(IMappingServiceShell mappingServiceShell) {
33         this.mappingServiceShell = mappingServiceShell;
34     }
35 }