Support listing of cache names via REST

Change-Id: Ibab22bfa1e69f87a5918b2f250e22f0bcce132d9
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-05-28 12:04:17 +02:00
parent 37cc41a930
commit 8dd941266f
6 changed files with 174 additions and 29 deletions

View File

@@ -118,7 +118,7 @@ final class ShowCaches extends SshCommand {
}
@Override
protected void run() {
protected void run() throws UnloggedFailure {
nw = columns - 50;
Date now = new Date();
stdout.format(
@@ -182,12 +182,11 @@ final class ShowCaches extends SshCommand {
}
private Collection<CacheInfo> getCaches() {
Map<String, CacheInfo> caches = listCaches.get().apply(new ConfigResource());
@SuppressWarnings("unchecked")
Map<String, CacheInfo> caches =
(Map<String, CacheInfo>) listCaches.get().apply(new ConfigResource());
for (Map.Entry<String, CacheInfo> entry : caches.entrySet()) {
CacheInfo cache = entry.getValue();
if (cache.type == null) {
cache.type = CacheType.MEM;
}
cache.name = entry.getKey();
}
return caches.values();