Package org.picketlink.identity.federation.core.handler.config

Examples of org.picketlink.identity.federation.core.handler.config.Handlers


    public boolean supports(QName qname) {
        return false;
    }

    protected Handlers parseHandlers(XMLEventReader xmlEventReader) throws ParsingException {
        Handlers handlers = new Handlers();

        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, HANDLERS);

        // parse and set the root element attributes.
        QName attributeQName = new QName("", HANDLERS_CHAIN_CLASS);
        Attribute attribute = startElement.getAttributeByName(attributeQName);
        if (attribute != null)
            handlers.setHandlerChainClass(StaxParserUtil.getAttributeValue(attribute));
       
        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent == null)
                break;
            if (xmlEvent instanceof EndElement) {
                EndElement endElement = (EndElement) StaxParserUtil.getNextEvent(xmlEventReader);
                String endElementName = StaxParserUtil.getEndElementName(endElement);
                if (endElementName.equals(HANDLERS))
                    break;
                else
                    throw logger.parserUnknownEndElement(endElementName);
            }

            startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
            if (startElement == null)
                break;
            String elementName = StaxParserUtil.getStartElementName(startElement);
            if (elementName.equals(HANDLER)) {
                Handler handler = parseHandler(xmlEventReader, startElement);
                handlers.add(handler);
            }
        }

        return handlers;
    }
View Full Code Here


                SAMLConfigParser samlConfigParser = new SAMLConfigParser();
                ProviderType sp = (ProviderType) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setIdpOrSP(sp);
            } else if (SAMLConfigParser.HANDLERS.equals(tag)) {
                SAMLConfigParser samlConfigParser = new SAMLConfigParser();
                Handlers handlers = (Handlers) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setHandlers(handlers);
            } else if (STSConfigParser.ROOT_ELEMENT.equals(tag)) {
                STSConfigParser samlConfigParser = new STSConfigParser();
                STSType sts = (STSType) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setStsType(sts);
View Full Code Here

        return ignoreIncomingSignatures;
    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        Handlers handlers = null;
        super.init(config);
        String configFile = GeneralConstants.CONFIG_FILE_LOCATION;

        String configProviderStr = config.getInitParameter(GeneralConstants.CONFIG_PROVIDER);
        if (StringUtil.isNotNull(configProviderStr)) {
View Full Code Here

    public PicketLinkType getPicketLinkConfiguration() throws ProcessingException {
        PicketLinkType picketLinkType = new PicketLinkType();
       
        picketLinkType.setIdpOrSP(this.providerType);
       
        picketLinkType.setHandlers(new Handlers());

        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler"));
View Full Code Here

        assertEquals("Unexpected token type", "specialToken", serviceProvider.getTokenType());
    }

    @Test
    public void test05() throws Exception {
        Handlers handlers = (Handlers) this.unmarshall(config + "5.xml");
        List<Handler> handlerList = handlers.getHandler();
        assertEquals("1 handler", 1, handlerList.size());

        Handler handler = handlerList.get(0);
        assertEquals("Class Name", "a", handler.getClazz());
        List<KeyValueType> options = handler.getOption();
View Full Code Here

        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-handlers.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        Handlers handlers = picketlink.getHandlers();
        assertNotNull(handlers);
        assertNotNull(handlers.getHandlerChainClass());
        assertFalse(handlers.getHandler().isEmpty());
    }
View Full Code Here

        startPicketLink();
    }

    protected void startPicketLink() throws LifecycleException {
        SystemPropertiesUtil.ensure();
        Handlers handlers = null;

        // Get the chain from config
        if (StringUtil.isNullOrEmpty(samlHandlerChainClass)) {
            chain = SAML2HandlerChainFactory.createChain();
        } else {
View Full Code Here

     * </p>
     *
     * @throws LifecycleException
     */
    protected void initHandlersChain() throws LifecycleException {
        Handlers handlers = null;

        try {
            if (picketLinkConfiguration != null) {
                handlers = picketLinkConfiguration.getHandlers();
            } else {
                // Get the handlers
                String handlerConfigFileName = GeneralConstants.HANDLER_CONFIG_FILE_LOCATION;
                handlers = ConfigurationUtil.getHandlers(getContext().getServletContext().getResourceAsStream(
                        handlerConfigFileName));
            }

            // Get the chain from config
            String handlerChainClass = handlers.getHandlerChainClass();

            if (StringUtil.isNullOrEmpty(handlerChainClass))
                chain = SAML2HandlerChainFactory.createChain();
            else {
                try {
View Full Code Here

                throw new ServletException(e1);
            }
        try {
            // Get the handlers
            String handlerConfigFileName = GeneralConstants.HANDLER_CONFIG_FILE_LOCATION;
            Handlers handlers = null;
            if (picketLinkConfiguration != null) {
                handlers = picketLinkConfiguration.getHandlers();
            } else {
                handlers = ConfigurationUtil.getHandlers(context.getResourceAsStream(handlerConfigFileName));
            }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.handler.config.Handlers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.