Search in sources :

Example 86 with SimpleAttributeDefinition

use of org.jboss.as.controller.SimpleAttributeDefinition in project keycloak by keycloak.

the class KeycloakSubsystemParser method writeHttpClient.

void writeHttpClient(XMLExtendedStreamWriter writer, ModelNode httpClientModel) throws XMLStreamException {
    if (!httpClientModel.isDefined()) {
        return;
    }
    writer.writeStartElement(Constants.XML.HTTP_CLIENT);
    for (SimpleAttributeDefinition attr : HttpClientDefinition.ATTRIBUTES) {
        attr.marshallAsAttribute(httpClientModel, false, writer);
    }
    writer.writeEndElement();
}
Also used : SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition)

Example 87 with SimpleAttributeDefinition

use of org.jboss.as.controller.SimpleAttributeDefinition in project keycloak by keycloak.

the class KeycloakSubsystemParser method writeSingleLogout.

void writeSingleLogout(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException {
    if (!model.isDefined()) {
        return;
    }
    writer.writeStartElement(Constants.XML.SINGLE_LOGOUT);
    for (SimpleAttributeDefinition attr : SingleLogoutDefinition.ATTRIBUTES) {
        attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer);
    }
    writer.writeEndElement();
}
Also used : SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition)

Example 88 with SimpleAttributeDefinition

use of org.jboss.as.controller.SimpleAttributeDefinition in project keycloak by keycloak.

the class KeycloakSubsystemParser method readPrivateKey.

void readPrivateKey(XMLExtendedStreamReader reader, ModelNode addKeyStore) throws XMLStreamException {
    for (int i = 0; i < reader.getAttributeCount(); i++) {
        String name = reader.getAttributeLocalName(i);
        String value = reader.getAttributeValue(i);
        SimpleAttributeDefinition attr = KeyStorePrivateKeyDefinition.lookup(name);
        if (attr == null) {
            throw ParseUtils.unexpectedAttribute(reader, i);
        }
        attr.parseAndSetParameter(value, addKeyStore, reader);
    }
    if (!addKeyStore.hasDefined(Constants.Model.PRIVATE_KEY_ALIAS)) {
        throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PRIVATE_KEY_ALIAS));
    }
    if (!addKeyStore.hasDefined(Constants.Model.PRIVATE_KEY_PASSWORD)) {
        throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PRIVATE_KEY_PASSWORD));
    }
    ParseUtils.requireNoContent(reader);
}
Also used : SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition)

Example 89 with SimpleAttributeDefinition

use of org.jboss.as.controller.SimpleAttributeDefinition in project keycloak by keycloak.

the class KeycloakSubsystemParser method readSingleLogout.

void readSingleLogout(ModelNode addIdentityProvider, XMLExtendedStreamReader reader) throws XMLStreamException {
    ModelNode slo = addIdentityProvider.get(Constants.Model.SINGLE_LOGOUT);
    for (int i = 0; i < reader.getAttributeCount(); i++) {
        String name = reader.getAttributeLocalName(i);
        String value = reader.getAttributeValue(i);
        SimpleAttributeDefinition attr = SingleLogoutDefinition.lookup(name);
        if (attr == null) {
            throw ParseUtils.unexpectedAttribute(reader, i);
        }
        attr.parseAndSetParameter(value, slo, reader);
    }
    ParseUtils.requireNoContent(reader);
}
Also used : SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) ModelNode(org.jboss.dmr.ModelNode)

Aggregations

SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)89 ModelNode (org.jboss.dmr.ModelNode)47 PathAddress (org.jboss.as.controller.PathAddress)14 Property (org.jboss.dmr.Property)13 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)12 ParseUtils.requireNoNamespaceAttribute (org.jboss.as.controller.parsing.ParseUtils.requireNoNamespaceAttribute)9 ParseUtils.unexpectedAttribute (org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute)9 HashSet (java.util.HashSet)8 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)8 XMLStreamException (javax.xml.stream.XMLStreamException)7 OperationContext (org.jboss.as.controller.OperationContext)4 ArrayList (java.util.ArrayList)3 AbstractAttributeDefinitionBuilder (org.jboss.as.controller.AbstractAttributeDefinitionBuilder)3 PrimitiveListAttributeDefinition (org.jboss.as.controller.PrimitiveListAttributeDefinition)3 ReloadRequiredWriteAttributeHandler (org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)3 SimpleListAttributeDefinition (org.jboss.as.controller.SimpleListAttributeDefinition)3 SimpleMapAttributeDefinition (org.jboss.as.controller.SimpleMapAttributeDefinition)3 ParseUtils.unexpectedElement (org.jboss.as.controller.parsing.ParseUtils.unexpectedElement)3 ClearWorkManagerStatisticsHandler (org.jboss.as.connector.dynamicresource.ClearWorkManagerStatisticsHandler)2 WorkManagerRuntimeAttributeReadHandler (org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeReadHandler)2