Example usage for org.w3c.dom Element hasAttributeNS

List of usage examples for org.w3c.dom Element hasAttributeNS

Introduction

In this page you can find the example usage for org.w3c.dom Element hasAttributeNS.

Prototype

public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException;

Source Link

Document

Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.

Usage

From source file:edu.internet2.middleware.shibboleth.common.config.metadata.AbstractMetadataProviderBeanDefinitionParser.java

/**
 * Gets the fail fast initialization requirement for the metadata provider.
 * /*  w w w  .j ava 2s.  c o m*/
 * @param config metadata provider config
 * 
 * @return fail fast initialization requirement for the metadata provider
 */
protected boolean getFailFastInitialization(Element config) {
    boolean failFastInit = true;
    if (config.hasAttributeNS(null, "failFastInitialization")) {
        failFastInit = XMLHelper
                .getAttributeValueAsBoolean(config.getAttributeNodeNS(null, "failFastInitialization"));
    }

    return failFastInit;
}

From source file:edu.osu.ocio.shibboleth.idp.authn.provider.StatelessLoginHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "authenticationServletURL")) {
        builder.addPropertyValue("authenticationServletURL",
                DatatypeHelper.safeTrim(config.getAttributeNS(null, "authenticationServletURL")));
    } else {/*  ww  w.j  a  va  2 s. c om*/
        builder.addPropertyValue("authenticationServletURL", "/Authn/Stateless");
    }
}

From source file:edu.internet2.middleware.shibboleth.idp.config.profile.authn.RemoteUserLoginHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "protectedServletPath")) {
        builder.addPropertyValue("protectedServletPath",
                DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null, "protectedServletPath")));
    } else {//w  w w . j  a  v a2s  .co m
        builder.addPropertyValue("protectedServletPath", "/Authn/RemoteUser");
    }
}

From source file:edu.internet2.middleware.shibboleth.common.config.metadata.AbstractMetadataProviderBeanDefinitionParser.java

/**
 * Gets the default parser pool reference for the metadata provider.
 * // w w w . j a  v a  2  s .c  o m
 * @param config metadata provider configuration element
 * 
 * @return parser pool reference
 */
protected String getParserPoolRef(Element config) {
    String parserPoolRef = null;
    if (config.hasAttributeNS(null, "parerPoolRef")) {
        parserPoolRef = DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null, "parserPoolRef"));
    }

    if (parserPoolRef == null) {
        parserPoolRef = "shibboleth.ParserPool";
    }

    return parserPoolRef;
}

From source file:edu.internet2.middleware.shibboleth.idp.config.profile.saml1.ShibbolethSSOProfileHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "authenticationManagerPath")) {
        builder.addConstructorArgValue(/* w  ww .jav  a  2  s .com*/
                DatatypeHelper.safeTrimOrNullString(config.getAttributeNS(null, "authenticationManagerPath")));
    } else {
        builder.addConstructorArgValue("/AuthnEngine");
    }
}

From source file:edu.internet2.middleware.shibboleth.idp.config.profile.authn.UsernamePasswordLoginHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "authenticationServletURL")) {
        builder.addPropertyValue("authenticationServletURL",
                DatatypeHelper.safeTrim(config.getAttributeNS(null, "authenticationServletURL")));
    } else {//from www.  j  a  v a2 s  .  co  m
        builder.addPropertyValue("authenticationServletURL", "/Authn/UserPassword");
    }

    String jaasConfigurationURL = DatatypeHelper
            .safeTrim(config.getAttributeNS(null, "jaasConfigurationLocation"));
    log.debug("Setting JAAS configuration file to: {}", jaasConfigurationURL);
    System.setProperty("java.security.auth.login.config", jaasConfigurationURL);
}

From source file:edu.internet2.middleware.shibboleth.common.config.security.CertPathPKIXValidationOptionsBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element element, BeanDefinitionBuilder builder) {
    super.doParse(element, builder);

    if (element.hasAttributeNS(null, "forceRevocationEnabled")) {
        Attr attr = element.getAttributeNodeNS(null, "forceRevocationEnabled");
        builder.addPropertyValue("forceRevocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
    }/*from www . j ava  2  s .  c om*/

    if (element.hasAttributeNS(null, "revocationEnabled")) {
        Attr attr = element.getAttributeNodeNS(null, "revocationEnabled");
        builder.addPropertyValue("revocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
    }

}

From source file:edu.internet2.middleware.shibboleth.common.config.security.saml.IssueInstantRuleBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element element, BeanDefinitionBuilder builder) {
    long skew = 300;
    if (element.hasAttributeNS(null, "clockSkew")) {
        skew = SpringConfigurationUtils.parseDurationToMillis(
                "'clockSkew' on security rule of type " + XMLHelper.getXSIType(element),
                element.getAttributeNS(null, "clockSkew"), 1000) / 1000;
    }/*w  ww . ja va  2s  .c  o m*/
    builder.addConstructorArgValue(skew);

    long expirationThreshold = 60;
    if (element.hasAttributeNS(null, "expirationThreshold")) {
        expirationThreshold = SpringConfigurationUtils.parseDurationToMillis(
                "'expirationThreshold' on security rule of type " + XMLHelper.getXSIType(element),
                element.getAttributeNS(null, "expirationThreshold"), 1000) / 1000;
    }
    builder.addConstructorArgValue(expirationThreshold);

    if (element.hasAttributeNS(null, "required")) {
        builder.addPropertyValue("requiredRule",
                XMLHelper.getAttributeValueAsBoolean(element.getAttributeNodeNS(null, "required")));
    } else {
        builder.addPropertyValue("requiredRule", true);
    }
}

From source file:edu.internet2.middleware.assurance.mcb.config.profile.authn.MCBLoginHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "previousSession")) {
        builder.addPropertyValue("previousSession",
                XMLHelper.getAttributeValueAsBoolean(config.getAttributeNodeNS(null, "previousSession")));
    } else {/*from   w w  w  . j av a  2s . c om*/
        builder.addPropertyValue("previousSession", false);
    }

    if (config.hasAttributeNS(null, "depends-on")) {
        builder.addPropertyValue("dependsOn",
                DatatypeHelper.safeTrim(config.getAttributeNS(null, "depends-on")));
    } else {
        builder.addPropertyValue("dependsOn", null);
    }

}

From source file:edu.internet2.middleware.shibboleth.idp.config.profile.authn.PreviousSessionLoginHandlerBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(Element config, BeanDefinitionBuilder builder) {
    super.doParse(config, builder);

    if (config.hasAttributeNS(null, "servletPath")) {
        log.warn("The 'servletPath' configuration option has been deprecated and is no longer supported.");
    }//from   w  w  w.  jav  a  2s . c  o m

    if (config.hasAttributeNS(null, "supportsPassiveAuthentication")) {
        log.warn(
                "The 'supportsPassiveAuthentication' configuration option has been deprecated and is no longer supported.");
    }

    if (config.hasAttributeNS(null, "reportPreviousSessionAuthnMethod")) {
        builder.addPropertyValue("reportPreviousSessionAuthnMethod", XMLHelper.getAttributeValueAsBoolean(
                config.getAttributeNodeNS(null, "reportPreviousSessionAuthnMethod")));
    } else {
        builder.addPropertyValue("reportPreviousSessionAuthnMethod", false);
    }
}