Add default NameID encoder for SAML 2 when no name format is provided by SP
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / idp / config / profile / ProfileHandlerNamespaceHandler.java
1 /*
2  * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package edu.internet2.middleware.shibboleth.idp.config.profile;
18
19 import javax.xml.namespace.QName;
20
21 import edu.internet2.middleware.shibboleth.common.config.BaseSpringNamespaceHandler;
22 import edu.internet2.middleware.shibboleth.common.config.profile.JSPErrorHandlerBeanDefinitionParser;
23 import edu.internet2.middleware.shibboleth.common.config.profile.VelocityErrorHandlerBeanDefinitionParser;
24 import edu.internet2.middleware.shibboleth.idp.config.profile.authn.RemoteUserLoginHandlerBeanDefinitionParser;
25 import edu.internet2.middleware.shibboleth.idp.config.profile.authn.UsernamePasswordLoginHandlerBeanDefinitionParser;
26 import edu.internet2.middleware.shibboleth.idp.config.profile.saml1.SAML1ArtifactResolutionProfileHanderBeanDefinitionParser;
27 import edu.internet2.middleware.shibboleth.idp.config.profile.saml1.SAML1AttributeQueryProfileHandlerBeanDefinitionParser;
28 import edu.internet2.middleware.shibboleth.idp.config.profile.saml1.ShibbolethSSOProfileHandlerBeanDefinitionParser;
29 import edu.internet2.middleware.shibboleth.idp.config.profile.saml2.SAML2ArtifactResolutionProfileHandlerBeanDefinitionParser;
30 import edu.internet2.middleware.shibboleth.idp.config.profile.saml2.SAML2AttributeQueryProfileHandlerBeanDefinitionParser;
31 import edu.internet2.middleware.shibboleth.idp.config.profile.saml2.SAML2SSOProfileHandlerBeanDefinitionParser;
32
33 /**
34  * Spring namespace handler for profile handler configurations.
35  */
36 public class ProfileHandlerNamespaceHandler extends BaseSpringNamespaceHandler {
37
38     /** Namespace URI. */
39     public static final String NAMESPACE = "urn:mace:shibboleth:2.0:idp:profile-handler";
40
41     /** {@inheritDoc} */
42     public void init() {
43         registerBeanDefinitionParser(IdPProfileHandlerManagerBeanDefinitionParser.SCHEMA_TYPE,
44                 new IdPProfileHandlerManagerBeanDefinitionParser());
45
46         registerBeanDefinitionParser(ProfileHandlerGroupBeanDefinitionParser.SCHEMA_TYPE,
47                 new ProfileHandlerGroupBeanDefinitionParser());
48         
49         registerBeanDefinitionParser(StatusHandlerBeanDefinitionParser.SCHEMA_TYPE,
50                 new StatusHandlerBeanDefinitionParser());
51
52         registerBeanDefinitionParser(new QName(NAMESPACE, JSPErrorHandlerBeanDefinitionParser.ELEMENT_NAME),
53                 new JSPErrorHandlerBeanDefinitionParser());
54
55         registerBeanDefinitionParser(new QName(NAMESPACE, VelocityErrorHandlerBeanDefinitionParser.ELEMENT_NAME),
56                 new VelocityErrorHandlerBeanDefinitionParser());
57
58         registerBeanDefinitionParser(ShibbolethSSOProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
59                 new ShibbolethSSOProfileHandlerBeanDefinitionParser());
60
61         registerBeanDefinitionParser(SAML1AttributeQueryProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
62                 new SAML1AttributeQueryProfileHandlerBeanDefinitionParser());
63         
64         registerBeanDefinitionParser(SAML1ArtifactResolutionProfileHanderBeanDefinitionParser.SCHEMA_TYPE,
65                 new SAML1ArtifactResolutionProfileHanderBeanDefinitionParser());
66
67         registerBeanDefinitionParser(SAML2SSOProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
68                 new SAML2SSOProfileHandlerBeanDefinitionParser());
69         
70         registerBeanDefinitionParser(SAML2AttributeQueryProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
71                 new SAML2AttributeQueryProfileHandlerBeanDefinitionParser());
72         
73         registerBeanDefinitionParser(SAML2ArtifactResolutionProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
74                 new SAML2ArtifactResolutionProfileHandlerBeanDefinitionParser());
75
76         registerBeanDefinitionParser(RemoteUserLoginHandlerBeanDefinitionParser.SCHEMA_TYPE,
77                 new RemoteUserLoginHandlerBeanDefinitionParser());
78
79         registerBeanDefinitionParser(UsernamePasswordLoginHandlerBeanDefinitionParser.SCHEMA_TYPE,
80                 new UsernamePasswordLoginHandlerBeanDefinitionParser());
81     }
82 }