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();
}
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();
}
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);
}
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);
}
Aggregations