Search in sources :

Example 6 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseIdentityProviderConfig.

private void parseIdentityProviderConfig(final XMLExtendedStreamReader reader, final ModelNode federationNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode identityProviderNode = parseConfig(reader, IDENTITY_PROVIDER, COMMON_NAME.getName(), federationNode, Arrays.asList(IdentityProviderResourceDefinition.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 IDENTITY_PROVIDER_TRUST_DOMAIN:
                    parseConfig(reader, IDENTITY_PROVIDER_TRUST_DOMAIN, COMMON_NAME.getName(), parentNode, TrustDomainResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER_ROLE_GENERATOR:
                    parseConfig(reader, IDENTITY_PROVIDER_ROLE_GENERATOR, COMMON_NAME.getName(), parentNode, RoleGeneratorResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case IDENTITY_PROVIDER_ATTRIBUTE_MANAGER:
                    parseConfig(reader, IDENTITY_PROVIDER_ATTRIBUTE_MANAGER, COMMON_NAME.getName(), parentNode, AttributeManagerResourceDefinition.INSTANCE.getAttributes(), addOperations);
                    break;
                case COMMON_HANDLER:
                    parseHandlerConfig(reader, parentNode, addOperations);
                    break;
                default:
                    throw unexpectedElement(reader);
            }
        }
    }, IDENTITY_PROVIDER, identityProviderNode, 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 ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement in project wildfly by wildfly.

the class AbstractFederationSubsystemReader method parseServiceProviderConfig.

private void parseServiceProviderConfig(final XMLExtendedStreamReader reader, ModelNode federationNode, final List<ModelNode> addOperations) throws XMLStreamException {
    ModelNode serviceProviderNode = parseConfig(reader, SERVICE_PROVIDER, COMMON_NAME.getName(), federationNode, Arrays.asList(ServiceProviderResourceDefinition.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 COMMON_HANDLER:
                    parseHandlerConfig(reader, parentNode, addOperations);
                    break;
            }
        }
    }, SERVICE_PROVIDER, serviceProviderNode, 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 ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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 9 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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 10 with ModelElement

use of org.wildfly.extension.picketlink.common.model.ModelElement 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)

Aggregations

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