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

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


            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


        return keyProviderType;
    }

    protected Handler parseHandler(XMLEventReader xmlEventReader, StartElement startElement) throws ParsingException {
        XMLEvent xmlEvent = null;
        Handler handlerType = new Handler();

        // parse and set the ClassName element attributes.
        QName attributeQName = new QName("", CLASS);
        Attribute attribute = startElement.getAttributeByName(attributeQName);
        if (attribute != null)
            handlerType.setClazz(StaxParserUtil.getAttributeValue(attribute));

        while (xmlEventReader.hasNext()) {
            xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent == null)
                break;
            if (xmlEvent instanceof EndElement) {
                EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                String endElementName = StaxParserUtil.getEndElementName(endElement);
                if (endElementName.equals(HANDLER))
                    break;
                else
                    continue;
            }
            startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
            String startElementName = StaxParserUtil.getStartElementName(startElement);

            if (startElementName.equals(OPTION)) {
                KeyValueType auth = new KeyValueType();
                populateKeyValueType(auth, startElement);

                handlerType.add(auth);
            }
        }
        return handlerType;
    }
View Full Code Here

        kv.setValue(value);
        return kv;
    }

    private Handler createHandler(String clazz) {
        Handler handler = new Handler();

        handler.setClazz(clazz);

        return handler;
    }
View Full Code Here

    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();
        assertEquals("2 options", 2, options.size());
        KeyValueType k1 = options.get(0);
        assertEquals("1", "1", k1.getKey());
        assertEquals("1.1", "1.1", k1.getValue());
        KeyValueType k2 = options.get(1);
View Full Code Here

TOP

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

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.