Search in sources :

Example 1 with CredentialReferenceWriteAttributeHandler

use of org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler in project wildfly by wildfly.

the class AuthTokenResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    ResourceDescriptor descriptor = this.configurator.apply(new ResourceDescriptor(this.getResourceDescriptionResolver())).addAttribute(Attribute.SHARED_SECRET, new CredentialReferenceWriteAttributeHandler(Attribute.SHARED_SECRET.getDefinition())).addCapabilities(Capability.class);
    new SimpleResourceRegistration(descriptor, new SimpleResourceServiceHandler(this.serviceConfiguratorFactory)).register(registration);
    return registration;
}
Also used : CredentialReferenceWriteAttributeHandler(org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 2 with CredentialReferenceWriteAttributeHandler

use of org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler in project wildfly by wildfly.

the class BridgeDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registry) {
    ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES);
    CredentialReferenceWriteAttributeHandler credentialReferenceWriteAttributeHandler = new CredentialReferenceWriteAttributeHandler(CREDENTIAL_REFERENCE);
    for (AttributeDefinition attr : ATTRIBUTES) {
        if (!attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) {
            if (attr.equals(CREDENTIAL_REFERENCE)) {
                registry.registerReadWriteAttribute(attr, null, credentialReferenceWriteAttributeHandler);
            } else {
                registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
            }
        }
    }
    BridgeControlHandler.INSTANCE.registerAttributes(registry);
}
Also used : CredentialReferenceWriteAttributeHandler(org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler) StringListAttributeDefinition(org.jboss.as.controller.StringListAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) PrimitiveListAttributeDefinition(org.jboss.as.controller.PrimitiveListAttributeDefinition) ObjectTypeAttributeDefinition(org.jboss.as.controller.ObjectTypeAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 3 with CredentialReferenceWriteAttributeHandler

use of org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler in project wildfly by wildfly.

the class ApplicationSecurityDomainSingleSignOnDefinition method registerOperations.

@Override
public void registerOperations(ManagementResourceRegistration registration) {
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(EnumSet.complementOf(EnumSet.of(Attribute.CREDENTIAL))).addAttribute(Attribute.CREDENTIAL, new CredentialReferenceWriteAttributeHandler(Attribute.CREDENTIAL.getDefinition())).addAttributes(SingleSignOnDefinition.Attribute.class).addCapabilities(Capability.class);
    new ReloadRequiredResourceRegistration(descriptor).register(registration);
}
Also used : CredentialReferenceWriteAttributeHandler(org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler) ReloadRequiredResourceRegistration(org.jboss.as.clustering.controller.ReloadRequiredResourceRegistration) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 4 with CredentialReferenceWriteAttributeHandler

use of org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler in project wildfly by wildfly.

the class JMSBridgeDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registry) {
    ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES);
    CredentialReferenceWriteAttributeHandler credentialReferenceWriteAttributeHandler = new CredentialReferenceWriteAttributeHandler(SOURCE_CREDENTIAL_REFERENCE, TARGET_CREDENTIAL_REFERENCE);
    for (AttributeDefinition attr : ATTRIBUTES) {
        if (attr.equals(SOURCE_CREDENTIAL_REFERENCE) || attr.equals(TARGET_CREDENTIAL_REFERENCE)) {
            registry.registerReadWriteAttribute(attr, null, credentialReferenceWriteAttributeHandler);
        } else {
            registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
        }
    }
    for (AttributeDefinition attr : READONLY_ATTRIBUTES) {
        registry.registerReadOnlyAttribute(attr, JMSBridgeHandler.INSTANCE);
    }
    for (AttributeDefinition attr : METRICS) {
        registry.registerMetric(attr, JMSBridgeHandler.READ_ONLY_INSTANCE);
    }
}
Also used : CredentialReferenceWriteAttributeHandler(org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) PropertiesAttributeDefinition(org.jboss.as.controller.PropertiesAttributeDefinition) ObjectTypeAttributeDefinition(org.jboss.as.controller.ObjectTypeAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 5 with CredentialReferenceWriteAttributeHandler

use of org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler in project wildfly by wildfly.

the class PooledConnectionFactoryDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registry) {
    Collection<AttributeDefinition> definitions = getAttributes();
    ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(definitions);
    CredentialReferenceWriteAttributeHandler credentialReferenceWriteAttributeHandler = new CredentialReferenceWriteAttributeHandler(CREDENTIAL_REFERENCE);
    for (AttributeDefinition attr : definitions) {
        if (!attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) {
            if (deployed) {
                registry.registerReadOnlyAttribute(attr, PooledConnectionFactoryConfigurationRuntimeHandler.INSTANCE);
            } else {
                if (attr.equals(CREDENTIAL_REFERENCE)) {
                    registry.registerReadWriteAttribute(attr, null, credentialReferenceWriteAttributeHandler);
                } else {
                    registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
                }
            }
        }
    }
}
Also used : CredentialReferenceWriteAttributeHandler(org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler) StringListAttributeDefinition(org.jboss.as.controller.StringListAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) SimpleMapAttributeDefinition(org.jboss.as.controller.SimpleMapAttributeDefinition) PrimitiveListAttributeDefinition(org.jboss.as.controller.PrimitiveListAttributeDefinition) SimpleListAttributeDefinition(org.jboss.as.controller.SimpleListAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Aggregations

CredentialReferenceWriteAttributeHandler (org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler)6 ReloadRequiredWriteAttributeHandler (org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)4 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)4 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)3 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)2 ObjectTypeAttributeDefinition (org.jboss.as.controller.ObjectTypeAttributeDefinition)2 PrimitiveListAttributeDefinition (org.jboss.as.controller.PrimitiveListAttributeDefinition)2 PropertiesAttributeDefinition (org.jboss.as.controller.PropertiesAttributeDefinition)2 StringListAttributeDefinition (org.jboss.as.controller.StringListAttributeDefinition)2 ReloadRequiredResourceRegistration (org.jboss.as.clustering.controller.ReloadRequiredResourceRegistration)1 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)1 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)1 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)1 SimpleListAttributeDefinition (org.jboss.as.controller.SimpleListAttributeDefinition)1 SimpleMapAttributeDefinition (org.jboss.as.controller.SimpleMapAttributeDefinition)1 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)1