Search in sources :

Example 6 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class FederationSubsystemReader_1_0 method parseHandlerConfig.

@Override
protected void parseHandlerConfig(final XMLExtendedStreamReader reader, final ModelNode entityProviderNode, final List<ModelNode> addOperations) throws XMLStreamException {
    String name = reader.getAttributeValue("", COMMON_CLASS_NAME.getName());
    if (name == null) {
        name = reader.getAttributeValue("", COMMON_CODE.getName());
        if (name != null) {
            name = HandlerTypeEnum.forType(name);
        }
    }
    ModelNode handlerNode = parseConfig(reader, COMMON_HANDLER, name, entityProviderNode, HandlerResourceDefinition.INSTANCE.getAttributes(), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            switch(element) {
                case COMMON_HANDLER_PARAMETER:
                    parseConfig(reader, COMMON_HANDLER_PARAMETER, COMMON_NAME.getName(), parentNode, HandlerParameterResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, COMMON_HANDLER, handlerNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 7 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractIDMSubsystemReader method parseFileStoreConfig.

private void parseFileStoreConfig(final XMLExtendedStreamReader reader, final ModelNode identityManagementNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode fileStoreNode = parseConfig(reader, FILE_STORE, null, identityManagementNode, FileStoreResourceDefinition.INSTANCE.getAttributes(), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            switch(element) {
                case IDENTITY_STORE_CREDENTIAL_HANDLER:
                    parseCredentialHandlerConfig(reader, parentNode, addOperations);
                    break;
                case SUPPORTED_TYPES:
                    parseSupportedTypesConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, FILE_STORE, fileStoreNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 8 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractIDMSubsystemReader method parseIdentityConfigurationConfig.

private void parseIdentityConfigurationConfig(final XMLExtendedStreamReader reader, final ModelNode parentNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode identityConfigurationNode = parseConfig(reader, IDENTITY_CONFIGURATION, COMMON_NAME.getName(), parentNode, IdentityConfigurationResourceDefinition.INSTANCE.getAttributes(), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            switch(element) {
                case JPA_STORE:
                    parseJPAStoreConfig(reader, parentNode, addOperations);
                    break;
                case FILE_STORE:
                    parseFileStoreConfig(reader, parentNode, addOperations);
                    break;
                case LDAP_STORE:
                    parseLDAPStoreConfig(reader, addOperations, parentNode);
                    break;
            }
        }
    }, IDENTITY_CONFIGURATION, identityConfigurationNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 9 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractIDMSubsystemReader method parseSupportedTypesConfig.

private ModelNode parseSupportedTypesConfig(final XMLExtendedStreamReader reader, final ModelNode identityStoreNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode supportedTypesNode = parseConfig(reader, SUPPORTED_TYPES, null, identityStoreNode, SupportedTypesResourceDefinition.INSTANCE.getAttributes(), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            switch(element) {
                case SUPPORTED_TYPE:
                    parseSupportedTypeConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, SUPPORTED_TYPES, supportedTypesNode, reader, addOperations);
    return supportedTypesNode;
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Example 10 with XMLExtendedStreamReader

use of org.jboss.staxmapper.XMLExtendedStreamReader in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseFederation.

private void parseFederation(final XMLExtendedStreamReader reader, final ModelNode subsystemNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode federationNode = parseConfig(reader, FEDERATION, COMMON_NAME.getName(), subsystemNode, Arrays.asList(FederationResourceDefinition.ATTRIBUTE_DEFINITIONS), addOperations);
    parseElement(new ElementParser() {

        @Override
        public void parse(final XMLExtendedStreamReader reader, final ModelElement element, final ModelNode parentNode, List<ModelNode> addOperations) throws XMLStreamException {
            switch(element) {
                case KEY_STORE:
                    parseKeyStore(reader, parentNode, addOperations);
                    break;
                case SAML:
                    parseConfig(reader, SAML, null, parentNode, SAMLResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER:
                    parseIdentityProviderConfig(reader, parentNode, addOperations);
                    break;
                case SERVICE_PROVIDER:
                    parseServiceProviderConfig(reader, parentNode, addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, FEDERATION, federationNode, reader, addOperations);
}
Also used : ModelElement(org.wildfly.extension.picketlink.common.model.ModelElement) XMLStreamException(javax.xml.stream.XMLStreamException) ModelNode(org.jboss.dmr.ModelNode) XMLExtendedStreamReader(org.jboss.staxmapper.XMLExtendedStreamReader)

Aggregations

XMLStreamException (javax.xml.stream.XMLStreamException)15 ModelNode (org.jboss.dmr.ModelNode)15 XMLExtendedStreamReader (org.jboss.staxmapper.XMLExtendedStreamReader)15 ModelElement (org.wildfly.extension.picketlink.common.model.ModelElement)15