Class ElytronXmlParser


  • public final class ElytronXmlParser
    extends Object
    A parser for the Elytron XML schema.
    Author:
    David M. Lloyd
    • Constructor Detail

      • ElytronXmlParser

        private ElytronXmlParser()
    • Method Detail

      • parseAuthenticationClientConfiguration

        public static SecurityFactory<AuthenticationContext> parseAuthenticationClientConfiguration()
                                                                                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse an Elytron authentication client configuration from a configuration discovered using the default wildfly-client-config discovery rules.
        Returns:
        the authentication context factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseAuthenticationClientConfiguration

        public static SecurityFactory<AuthenticationContext> parseAuthenticationClientConfiguration​(URI uri)
                                                                                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse an Elytron authentication client configuration from a resource located at a specified URI.
        Parameters:
        uri - the URI of the configuration.
        Returns:
        the authentication context factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • namespacesToString

        private static String namespacesToString()
      • parseAuthenticationClientConfiguration

        static SecurityFactory<AuthenticationContext> parseAuthenticationClientConfiguration​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                                                      throws org.wildfly.client.config.ConfigXMLParseException
        Parse a Elytron authentication client configuration from a configuration XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the authentication context factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseAuthenticationClientType

        static SecurityFactory<AuthenticationContext> parseAuthenticationClientType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                    ElytronXmlParser.Version xmlVersion)
                                                                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type authentication-client-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        Returns:
        the authentication context factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseAuthenticationConfigurationsType

        private static void parseAuthenticationConfigurationsType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                  ElytronXmlParser.Version xmlVersion,
                                                                  Map<String,​org.wildfly.common.function.ExceptionSupplier<AuthenticationConfiguration,​org.wildfly.client.config.ConfigXMLParseException>> authenticationConfigurationsMap,
                                                                  Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                                  Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                  Supplier<Provider[]> providers)
                                                           throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseSslContextsType

        private static void parseSslContextsType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                 ElytronXmlParser.Version xmlVersion,
                                                 Map<String,​org.wildfly.common.function.ExceptionSupplier<SecurityFactory<SSLContext>,​org.wildfly.client.config.ConfigXMLParseException>> sslContextsMap,
                                                 Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                 Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                 Supplier<Provider[]> providers)
                                          throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseSslContextType

        private static void parseSslContextType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                ElytronXmlParser.Version xmlVersion,
                                                Map<String,​org.wildfly.common.function.ExceptionSupplier<SecurityFactory<SSLContext>,​org.wildfly.client.config.ConfigXMLParseException>> sslContextsMap,
                                                Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                Supplier<Provider[]> providers)
                                         throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCertificateRevocationLists

        private static void parseCertificateRevocationLists​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                            ElytronXmlParser.TrustManagerBuilder builder,
                                                            ElytronXmlParser.Version xmlVersion)
                                                     throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCertificateRevocationList

        private static void parseCertificateRevocationList​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                           ElytronXmlParser.TrustManagerBuilder builder,
                                                           ElytronXmlParser.Version xmlVersion,
                                                           boolean multipleCrls)
                                                    throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseOcsp

        private static void parseOcsp​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                      ElytronXmlParser.TrustManagerBuilder builder,
                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap)
                               throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseKeyStoreSslCertificate

        private static org.wildfly.common.function.ExceptionSupplier<X509ExtendedKeyManager,​org.wildfly.client.config.ConfigXMLParseException> parseKeyStoreSslCertificate​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                 ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                                 Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                                                                                                                                                 Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                                                 Supplier<Provider[]> providers)
                                                                                                                                                                          throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseTrustManager

        private static void parseTrustManager​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                              ElytronXmlParser.TrustManagerBuilder builder,
                                              ElytronXmlParser.Version xmlVersion)
                                       throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseSslContextRuleType

        static org.wildfly.common.function.ExceptionUnaryOperator<RuleNode<SecurityFactory<SSLContext>>,​org.wildfly.client.config.ConfigXMLParseException> parseSslContextRuleType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                         ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                                         Map<String,​org.wildfly.common.function.ExceptionSupplier<SecurityFactory<SSLContext>,​org.wildfly.client.config.ConfigXMLParseException>> sslContextsMap)
                                                                                                                                                                                  throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseAuthenticationRuleType

        static org.wildfly.common.function.ExceptionUnaryOperator<RuleNode<AuthenticationConfiguration>,​org.wildfly.client.config.ConfigXMLParseException> parseAuthenticationRuleType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                             ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                                             Map<String,​org.wildfly.common.function.ExceptionSupplier<AuthenticationConfiguration,​org.wildfly.client.config.ConfigXMLParseException>> authenticationConfigurationsMap)
                                                                                                                                                                                      throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseRulesType

        static <C> org.wildfly.common.function.ExceptionSupplier<RuleNode<C>,​org.wildfly.client.config.ConfigXMLParseException> parseRulesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                     ElytronXmlParser.Version xmlVersion,
                                                                                                                                                     Map<String,​org.wildfly.common.function.ExceptionSupplier<C,​org.wildfly.client.config.ConfigXMLParseException>> configurations,
                                                                                                                                                     org.wildfly.common.function.ExceptionBiFunction<org.wildfly.client.config.ConfigurationXMLStreamReader,​Map<String,​org.wildfly.common.function.ExceptionSupplier<C,​org.wildfly.client.config.ConfigXMLParseException>>,​org.wildfly.common.function.ExceptionUnaryOperator<RuleNode<C>,​org.wildfly.client.config.ConfigXMLParseException>,​org.wildfly.client.config.ConfigXMLParseException> ruleParseFunction)
                                                                                                                                              throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseAuthenticationConfigurationType

        static void parseAuthenticationConfigurationType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                         ElytronXmlParser.Version xmlVersion,
                                                         Map<String,​org.wildfly.common.function.ExceptionSupplier<AuthenticationConfiguration,​org.wildfly.client.config.ConfigXMLParseException>> authenticationConfigurationsMap,
                                                         Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                         Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                         Supplier<Provider[]> providers)
                                                  throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseProvidersType

        static Supplier<Provider[]> parseProvidersType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                       ElytronXmlParser.Version xmlVersion)
                                                throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseWebServicesType

        static Map<String,​?> parseWebServicesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                        ElytronXmlParser.Version xmlVersion)
                                                 throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseAbstractMatchRuleType

        static MatchRule parseAbstractMatchRuleType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                    ElytronXmlParser.Version xmlVersion)
                                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse the XML match-rule group. On return, the reader will be positioned either at a start tag for an element that is not included in this group, or at an end tag.
        Parameters:
        reader - the XML reader
        xmlVersion - the version of parsed XML
        Returns:
        the parsed match rule
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseMatchAbstractType

        private static MatchRule parseMatchAbstractType​(MatchRule rule,
                                                        org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                 throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • isSet

        private static boolean isSet​(int var,
                                     int bit)
      • setBit

        private static int setBit​(int var,
                                  int bit)
      • andThenOp

        private static <T,​E extends Exception> org.wildfly.common.function.ExceptionUnaryOperator<T,​E> andThenOp​(org.wildfly.common.function.ExceptionUnaryOperator<T,​E> first,
                                                                                                                             org.wildfly.common.function.ExceptionUnaryOperator<T,​E> second)
      • parseCredentialsType

        private static org.wildfly.common.function.ExceptionSupplier<CredentialSource,​org.wildfly.client.config.ConfigXMLParseException> parseCredentialsType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                    ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                    Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                                                                                                                                    Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                                    Supplier<Provider[]> providers)
                                                                                                                                                             throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseSSHKeyLocationCredential

        private static SSHCredential parseSSHKeyLocationCredential​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                   ElytronXmlParser.Version xmlVersion,
                                                                   Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                   Supplier<Provider[]> providers)
                                                            throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseKeyPair

        private static KeyPairCredential parseKeyPair​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                      ElytronXmlParser.Version xmlVersion,
                                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                      Supplier<Provider[]> providers)
                                               throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseOpenSSHKeyType

        private static KeyPair parseOpenSSHKeyType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                   ElytronXmlParser.Version xmlVersion,
                                                   Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                   Supplier<Provider[]> providers)
                                            throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCertificateType

        private static X509CertificateChainPrivateCredential parseCertificateType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                  ElytronXmlParser.Version xmlVersion)
                                                                           throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseMultiPem

        private static <P> P[] parseMultiPem​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                             Class<P> pemType,
                                             IntFunction<P[]> ctor)
                                      throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parsePem

        private static <P> P parsePem​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                      Class<P> pemType)
                               throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseKeyStoresType

        static void parseKeyStoresType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                       ElytronXmlParser.Version xmlVersion,
                                       Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                       Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                       Supplier<Provider[]> providers)
                                throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type key-stores-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        keyStoresMap - the map of key stores to use
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseKeyStoreType

        static void parseKeyStoreType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                      ElytronXmlParser.Version xmlVersion,
                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                      Supplier<Provider[]> providers)
                               throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type key-store-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        keyStoresMap - the map of key stores to use
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseKeyStoreRefType

        static org.wildfly.common.function.ExceptionSupplier<KeyStore.Entry,​org.wildfly.client.config.ConfigXMLParseException> parseKeyStoreRefType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                          ElytronXmlParser.Version xmlVersion,
                                                                                                                                                          Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                                                                                                                          Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                          Supplier<Provider[]> providers)
                                                                                                                                                   throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type key-store-ref-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        keyStoresMap - the map of key stores to use
        credentialStoresMap - the map of credential stores to use
        providers - supplier of providers for loading services
        Returns:
        the key store entry factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • keyStoreCredentialToPassword

        private static char[] keyStoreCredentialToPassword​(org.wildfly.common.function.ExceptionSupplier<KeyStore.Entry,​org.wildfly.client.config.ConfigXMLParseException> keyStoreCredential,
                                                           Supplier<Provider[]> providers)
                                                    throws GeneralSecurityException,
                                                           org.wildfly.client.config.ConfigXMLParseException
        Throws:
        GeneralSecurityException
        org.wildfly.client.config.ConfigXMLParseException
      • parseTrustStoreRefType

        static org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException> parseTrustStoreRefType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap)
                                                                                                                                               throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type trust-store-ref-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        keyStoresMap - the map of key stores to use
        Returns:
        the key store entry factory
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseCredentialStoreRefType

        static org.wildfly.common.function.ExceptionSupplier<CredentialSource,​org.wildfly.client.config.ConfigXMLParseException> parseCredentialStoreRefType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                   Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap)
                                                                                                                                                            throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCredentialStoresType

        private static void parseCredentialStoresType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                      ElytronXmlParser.Version xmlVersion,
                                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                      Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                      Supplier<Provider[]> providers)
                                               throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type credential-stores-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        keyStoresMap - the key stores map
        credentialStoresMap - the map of credential stores to use @throws ConfigXMLParseException if the resource failed to be parsed
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCredentialStoreType

        private static void parseCredentialStoreType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                     ElytronXmlParser.Version xmlVersion,
                                                     Map<String,​org.wildfly.common.function.ExceptionSupplier<KeyStore,​org.wildfly.client.config.ConfigXMLParseException>> keyStoresMap,
                                                     Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                     Supplier<Provider[]> providers)
                                              throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type credential-store-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        keyStoresMap - the key stores map
        credentialStoresMap - the map of credential stores to fill @throws ConfigXMLParseException if the resource failed to be parsed
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseAttributesType

        private static void parseAttributesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                ElytronXmlParser.Version xmlVersion,
                                                Map<String,​String> attributesMap)
                                         throws org.wildfly.client.config.ConfigXMLParseException
        Parse attributes attributes-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        attributesMap - the map to put attributes to.
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseAttributeType

        private static void parseAttributeType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                               Map<String,​String> attributesMap)
                                        throws org.wildfly.client.config.ConfigXMLParseException
        Parse an attribute attribute-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        attributesMap - the map to put attributes to.
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseEmptyType

        static void parseEmptyType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                            throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type empty-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseNameType

        static String parseNameType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type name-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the parsed name
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseNameType

        static String parseNameType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                    boolean optional)
                             throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type name-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        optional - is the name attribute optional?
        Returns:
        the parsed name
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseResourceType

        static org.wildfly.common.function.ExceptionSupplier<InputStream,​IOException> parseResourceType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                              ElytronXmlParser.Version xmlVersion)
                                                                                                       throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type resource-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of the XML being parsed
        Returns:
        An ExceptionSupplier<InputStream, IOException> for the referenced resource
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parsePortType

        static int parsePortType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                          throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type port-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the port number (1-65535 inclusive)
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseRegexSubstitutionType

        static NameRewriter parseRegexSubstitutionType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type regex-substitution-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the regular expression based name rewriter
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseNamesType

        static String[] parseNamesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type names-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the array of parsed names
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseUriType

        static URI parseUriType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                         throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type uri-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the parsed URI
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseSaslMechanismSelectorType

        static SaslMechanismSelector parseSaslMechanismSelectorType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                             throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseCipherSuiteSelectorType

        static CipherSuiteSelector parseCipherSuiteSelectorType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                ElytronXmlParser.Version xmlVersion)
                                                         throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type ssl-cipher-selector-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the parsed cipher suite selector
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseProtocolSelectorNamesType

        static ProtocolSelector parseProtocolSelectorNamesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                        throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type names which yields a protocol selector from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the parsed protocol selector
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseModuleRefType

        static String parseModuleRefType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                  throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type module-ref-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the corresponding module name
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed or the module is not found
      • parseClearPassword

        static org.wildfly.common.function.ExceptionSupplier<Password,​org.wildfly.client.config.ConfigXMLParseException> parseClearPassword​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                  Supplier<Provider[]> providers)
                                                                                                                                           throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type clear-password-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the clear password characters
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed or the module is not found
      • parseMaskedPassword

        static org.wildfly.common.function.ExceptionSupplier<Password,​org.wildfly.client.config.ConfigXMLParseException> parseMaskedPassword​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                   Supplier<Provider[]> providers)
                                                                                                                                            throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type masked-password-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        a MaskedPassword supplier
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed or the module is not found
      • parsePropertiesType

        static Map<String,​String> parsePropertiesType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                            ElytronXmlParser.Version xmlVersion)
                                                     throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • parseBearerTokenType

        static BearerTokenCredential parseBearerTokenType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                   throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type bearer-token-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseOAuth2BearerTokenType

        static org.wildfly.common.function.ExceptionSupplier<CredentialSource,​org.wildfly.client.config.ConfigXMLParseException> parseOAuth2BearerTokenType​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                  Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                                  ElytronXmlParser.Version xmlVersion)
                                                                                                                                                           throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type oauth2-bearer-token-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        xmlVersion - the version of parsed XML
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseOAuth2ResourceOwnerCredentials

        static org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> parseOAuth2ResourceOwnerCredentials​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                         org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> builderSupplier,
                                                                                                                                                                                         Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                                                         ElytronXmlParser.Version xmlVersion)
                                                                                                                                                                                  throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type oauth2-bearer-token-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        builderSupplier - the builder supplier
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseOAuth2ClientCredentials

        static org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> parseOAuth2ClientCredentials​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                  org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> builderSupplier,
                                                                                                                                                                                  Map<String,​org.wildfly.common.function.ExceptionSupplier<CredentialStore,​org.wildfly.client.config.ConfigXMLParseException>> credentialStoresMap,
                                                                                                                                                                                  ElytronXmlParser.Version xmlVersion)
                                                                                                                                                                           throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type oauth2-client-credentials-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        builderSupplier - the builder supplier
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseOAuth2MaskedResourceOwnerCredentials

        static org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> parseOAuth2MaskedResourceOwnerCredentials​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                               org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> builderSupplier,
                                                                                                                                                                                               ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                                               Supplier<Provider[]> providers)
                                                                                                                                                                                        throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type oauth2-bearer-token-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        builderSupplier - the builder supplier
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseOAuth2MaskedClientCredentials

        static org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> parseOAuth2MaskedClientCredentials​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                                                                                                                        org.wildfly.common.function.ExceptionSupplier<OAuth2CredentialSource.Builder,​org.wildfly.client.config.ConfigXMLParseException> builderSupplier,
                                                                                                                                                                                        ElytronXmlParser.Version xmlVersion,
                                                                                                                                                                                        Supplier<Provider[]> providers)
                                                                                                                                                                                 throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type oauth2-client-credentials-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        builderSupplier - the builder supplier
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed
      • parseLocalKerberos

        static CredentialSource parseLocalKerberos​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                            throws org.wildfly.client.config.ConfigXMLParseException
        Parse an XML element of type local-kerberos-type from an XML reader.
        Parameters:
        reader - the XML stream reader
        Returns:
        the clear password characters
        Throws:
        org.wildfly.client.config.ConfigXMLParseException - if the resource failed to be parsed or the module is not found
      • checkGetElementNamespace

        private static String checkGetElementNamespace​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                                throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • checkElementNamespace

        private static void checkElementNamespace​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                  ElytronXmlParser.Version xmlVersion)
                                           throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • checkAttributeNamespace

        private static void checkAttributeNamespace​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                    int idx)
                                             throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • requireNoAttributes

        private static void requireNoAttributes​(org.wildfly.client.config.ConfigurationXMLStreamReader reader)
                                         throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • requireSingleAttribute

        private static String requireSingleAttribute​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                     String attributeName)
                                              throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • requireSingleURIAttribute

        private static URI requireSingleURIAttribute​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                     String attributeName)
                                              throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • requireSingleAttribute

        private static <A> A requireSingleAttribute​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                    String attributeName,
                                                    org.wildfly.common.function.ExceptionSupplier<A,​org.wildfly.client.config.ConfigXMLParseException> attributeFunction)
                                             throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException
      • missingAttribute

        private static org.wildfly.client.config.ConfigXMLParseException missingAttribute​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                          String name)
      • invalidPortNumber

        private static org.wildfly.client.config.ConfigXMLParseException invalidPortNumber​(org.wildfly.client.config.ConfigurationXMLStreamReader reader,
                                                                                           int index)
                                                                                    throws org.wildfly.client.config.ConfigXMLParseException
        Throws:
        org.wildfly.client.config.ConfigXMLParseException