ITM impl Organize Imports for Checkstyle compliance
[genius.git] / itm / itm-impl / src / main / java / org / opendaylight / genius / itm / cli / DSShowCache.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.genius.itm.cli;
9
10 import org.apache.karaf.shell.commands.Argument;
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.genius.itm.api.IITMProvider;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 @Command(scope = "ds", name = "showcache", description = "view the cached data")
18 public class DSShowCache extends OsgiCommandSupport {
19     @Argument(index = 0, name = "CacheName", description = "CacheName", required = true, multiValued = false)
20     private String cacheName;
21     private static final Logger logger = LoggerFactory.getLogger(DSShowCache.class);
22     private IITMProvider itmProvider;
23
24     public void setItmProvider(IITMProvider itmProvider) {
25         this.itmProvider = itmProvider;
26     }
27
28     @Override
29     protected Object doExecute() throws Exception {
30         logger.debug("Executing show Cache command");
31         itmProvider.showCache(cacheName);
32         return null;
33     }
34
35 }