@@ -0,0 +1,3358 @@
+/*%0A * JBoss, Home of Professional Open Source.%0A * Copyright 2015 Red Hat, Inc., and individual contributors%0A * as indicated by the @author tags.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.wildfly.security.auth.server;%0A%0Aimport org.wildfly.common.Assert;%0A%0A/**%0A * A configuration for a single mechanism realm.%0A *%0A * @author %3Ca href=%22mailto:david.lloyd@redhat.com%22%3EDavid M. Lloyd%3C/a%3E%0A */%0Apublic final class MechanismRealmConfiguration %7B%0A    private final String name;%0A    private final NameRewriter preRealmRewriter;%0A    private final NameRewriter postRealmRewriter;%0A    private final NameRewriter finalRewriter;%0A%0A    /**%0A     * Construct a new instance.%0A     *%0A     * @param name the name of this realm (may not be %7B@code null%7D)%0A     * @param preRealmRewriter the pre-realm rewriter to apply (may not be %7B@code null%7D)%0A     * @param postRealmRewriter the post-realm rewriter to apply (may not be %7B@code null%7D)%0A     * @param finalRewriter the final rewriter to apply (may not be %7B@code null%7D)%0A     */%0A    public MechanismRealmConfiguration(final String name, final NameRewriter preRealmRewriter, final NameRewriter postRealmRewriter, final NameRewriter finalRewriter) %7B%0A        Assert.checkNotNullParam(%22name%22, name);%0A        Assert.checkNotNullParam(%22preRealmRewriter%22, preRealmRewriter);%0A        Assert.checkNotNullParam(%22postRealmRewriter%22, postRealmRewriter);%0A        Assert.checkNotNullParam(%22finalRewriter%22, finalRewriter);%0A        this.name = name;%0A        this.preRealmRewriter = preRealmRewriter;%0A        this.postRealmRewriter = postRealmRewriter;%0A        this.finalRewriter = finalRewriter;%0A    %7D%0A%0A    /**%0A     * Get the mechanism name.%0A     *%0A     * @return the mechanism name (not %7B@code null%7D)%0A     */%0A    public String getName() %7B%0A        return name;%0A    %7D%0A%0A    /**%0A     * Get the pre-realm rewriter for this mechanism realm.%0A     *%0A     * @return the pre-realm rewriter for this mechanism realm (not %7B@code null%7D)%0A     */%0A    public NameRewriter getPreRealmRewriter() %7B%0A        return preRealmRewriter;%0A    %7D%0A%0A    /**%0A     * Get the post-realm rewriter for this mechanism realm.%0A     *%0A     * @return the post-realm rewriter for this mechanism realm (not %7B@code null%7D)%0A     */%0A    public NameRewriter getPostRealmRewriter() %7B%0A        return postRealmRewriter;%0A    %7D%0A%0A    /**%0A     * Get the final rewriter for this mechanism realm.%0A     *%0A     * @return the final rewriter for this mechanism realm (not %7B@code null%7D)%0A     */%0A    public NameRewriter getFinalRewriter() %7B%0A        return finalRewriter;%0A    %7D%0A%0A    /**%0A     * A realm configuration for no particular realm, which does no additional rewriting.%0A     */%0A    public static final MechanismRealmConfiguration NO_REALM = new MechanismRealmConfiguration(%22none%22, NameRewriter.IDENTITY_REWRITER, NameRewriter.IDENTITY_REWRITER, NameRewriter.IDENTITY_REWRITER);%0A%7D%0A

Introduce a single mechanism realm configuration class