1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.config.security;
19
20 import javax.xml.namespace.QName;
21
22 import org.opensaml.xml.security.x509.CertPathPKIXValidationOptions;
23 import org.opensaml.xml.util.XMLHelper;
24 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
25 import org.w3c.dom.Attr;
26 import org.w3c.dom.Element;
27
28
29
30 public class CertPathPKIXValidationOptionsBeanDefinitionParser extends PKIXValidationOptionsBeanDefinitionParser {
31
32
33 public static final QName SCHEMA_TYPE = new QName(SecurityNamespaceHandler.NAMESPACE, "CertPathValidationOptionsType");
34
35
36 protected Class getBeanClass(Element element) {
37 return CertPathPKIXValidationOptions.class;
38 }
39
40
41 protected boolean shouldGenerateId() {
42 return true;
43 }
44
45
46 protected void doParse(Element element, BeanDefinitionBuilder builder) {
47 super.doParse(element, builder);
48
49 if (element.hasAttributeNS(null, "forceRevocationEnabled")) {
50 Attr attr = element.getAttributeNodeNS(null, "forceRevocationEnabled");
51 builder.addPropertyValue("forceRevocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
52 }
53
54 if (element.hasAttributeNS(null, "revocationEnabled")) {
55 Attr attr = element.getAttributeNodeNS(null, "revocationEnabled");
56 builder.addPropertyValue("revocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
57 }
58
59 }
60
61 }