use of org.jboss.hal.meta.security.SecurityContext in project console by hal.
the class UpdateDatabaseTask method call.
@SuppressWarnings("unchecked")
public Completable call(LookupContext context) {
if (context.updateDatabase()) {
Stopwatch watch = Stopwatch.createStarted();
for (Map.Entry<ResourceAddress, ResourceDescription> entry : context.toResourceDescriptionDatabase.entrySet()) {
ResourceAddress address = entry.getKey();
ResourceDescription resourceDescription = entry.getValue();
workerChannel.postResourceDescription(address, resourceDescription, context.recursive);
}
for (Map.Entry<ResourceAddress, SecurityContext> entry : context.toSecurityContextDatabase.entrySet()) {
ResourceAddress address = entry.getKey();
SecurityContext securityContext = entry.getValue();
workerChannel.postSecurityContext(address, securityContext, context.recursive);
}
logger.debug("Posted {} resource descriptions and {} security contexts to the databases in {} ms", context.toResourceDescriptionDatabase.size(), context.toSecurityContextDatabase.size(), watch.stop().elapsed(MILLISECONDS));
}
return Completable.complete();
}
use of org.jboss.hal.meta.security.SecurityContext in project console by hal.
the class UpdateRegistryTask method call.
@Override
public Completable call(LookupContext context) {
if (context.updateRegistry()) {
for (Map.Entry<ResourceAddress, ResourceDescription> entry : context.toResourceDescriptionRegistry.entrySet()) {
ResourceAddress address = entry.getKey();
ResourceDescription resourceDescription = entry.getValue();
resourceDescriptionRegistry.add(address, resourceDescription, context.recursive);
}
for (Map.Entry<ResourceAddress, SecurityContext> entry : context.toSecurityContextRegistry.entrySet()) {
ResourceAddress address = entry.getKey();
SecurityContext securityContext = entry.getValue();
securityContextRegistry.add(address, securityContext, context.recursive);
}
logger.debug("Added {} resource descriptions and {} security contexts to the registries", context.toResourceDescriptionRegistry.size(), context.toSecurityContextRegistry.size());
}
return Completable.complete();
}
Aggregations