Search in sources :

Example 6 with SecurityContext

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();
}
Also used : ResourceAddress(org.jboss.hal.dmr.ResourceAddress) ResourceDescription(org.jboss.hal.meta.description.ResourceDescription) Stopwatch(com.google.common.base.Stopwatch) SecurityContext(org.jboss.hal.meta.security.SecurityContext) Map(java.util.Map)

Example 7 with SecurityContext

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();
}
Also used : ResourceAddress(org.jboss.hal.dmr.ResourceAddress) ResourceDescription(org.jboss.hal.meta.description.ResourceDescription) SecurityContext(org.jboss.hal.meta.security.SecurityContext) Map(java.util.Map)

Aggregations

SecurityContext (org.jboss.hal.meta.security.SecurityContext)7 ResourceDescription (org.jboss.hal.meta.description.ResourceDescription)6 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)4 Map (java.util.Map)3 ModelNode (org.jboss.hal.dmr.ModelNode)3 JsIgnore (jsinterop.annotations.JsIgnore)2 Property (org.jboss.hal.dmr.Property)2 StaticResourceDescription (org.jboss.hal.meta.description.StaticResourceDescription)2 Stopwatch (com.google.common.base.Stopwatch)1 HashSet (java.util.HashSet)1 JsProperty (jsinterop.annotations.JsProperty)1 FormItem (org.jboss.hal.ballroom.form.FormItem)1 AddressTemplate (org.jboss.hal.meta.AddressTemplate)1 Constraint (org.jboss.hal.meta.security.Constraint)1 Completable (rx.Completable)1