X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fclustering%2Fservices_implementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fservices_implementation%2Finternal%2FClusterManagerCLI.java;fp=opendaylight%2Fclustering%2Fservices_implementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fservices_implementation%2Finternal%2FClusterManagerCLI.java;h=0000000000000000000000000000000000000000;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hp=402b8530888fdbb0ff673190a6db68cfa224082e;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b;p=controller.git diff --git a/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManagerCLI.java b/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManagerCLI.java deleted file mode 100644 index 402b853088..0000000000 --- a/opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManagerCLI.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.clustering.services_implementation.internal; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.concurrent.ConcurrentMap; - -import org.apache.felix.service.command.Descriptor; -import org.infinispan.AdvancedCache; -import org.infinispan.distribution.DistributionManager; -import org.opendaylight.controller.clustering.services.IClusterContainerServices; -import org.opendaylight.controller.sal.utils.ServiceHelper; -import org.osgi.framework.ServiceRegistration; - -public class ClusterManagerCLI { - @SuppressWarnings("rawtypes") - private ServiceRegistration sr = null; - - public void init() { - } - - public void destroy() { - } - - public void start() { - final Dictionary props = new Hashtable(); - props.put("osgi.command.scope", "odpcontroller"); - props.put("osgi.command.function", new String[] { "getContainerAdvancedCacheInfo" }); - this.sr = ServiceHelper.registerGlobalServiceWReg(ClusterManagerCLI.class, this, props); - } - - public void stop() { - if (this.sr != null) { - this.sr.unregister(); - this.sr = null; - } - } - - @Descriptor("Get advanced cache infos") - public void getContainerAdvancedCacheInfo(@Descriptor("Container for the cache to be fetched") String container, - @Descriptor("cache to get information about") String cacheName) { - IClusterContainerServices s = - (IClusterContainerServices) ServiceHelper.getInstance(IClusterContainerServices.class, container, this); - if (s == null) { - System.out.println("Could not get an handle to the container cluster service:" + container); - return; - } - if (!s.existCache(cacheName)) { - System.out.println("Could not get cache named:" + cacheName); - } - ConcurrentMap aC = s.getCache(cacheName); - if (aC == null) { - System.out.println("Could not get cache named:" + cacheName); - return; - } - if (aC instanceof AdvancedCache) { - @SuppressWarnings("rawtypes") - AdvancedCache advCache = (AdvancedCache) aC; - System.out.println("AdvancedCache retrieved!"); - DistributionManager dMgr = advCache.getDistributionManager(); - if (dMgr == null) { - return; - } - System.out.println("Routing Table for the Hash:" + dMgr.getConsistentHash() - .getRoutingTableAsString()); - System.out.println("Get Members:" + dMgr.getConsistentHash() - .getMembers()); - } - } -}