private Map<String, String> getNamespaceMap()
throws StoreException
{
long now = System.currentTimeMillis();
if (namespaces == null || !namespaces.isFresh(now)) {
NamespaceClient client = this.client.namespaces();
if (namespaces != null) {
client.ifNoneMatch(namespaces.getETag());
}
NamespaceResult result = client.list();
if (result == null) {
assert namespaces != null;
namespaces.refreshed(now, client.getMaxAge());
}
else {
namespaces = new CachedNamespaceResult(result.asMap(), client.getETag());
}
}
return namespaces.getNamespaces();
}