Examples of ClaimsProcessorsType


Examples of org.picketlink.identity.federation.core.config.ClaimsProcessorsType

     */
    private ClaimsProcessorsType parseClaimsProcessors(XMLEventReader xmlEventReader) throws ParsingException {
        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, CLAIMS_PROCESSORS_ELEMENT);

        ClaimsProcessorsType claimsProcessors = new ClaimsProcessorsType();

        // parse all claims processors one by one.
        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(CLAIMS_PROCESSORS_ELEMENT))
                    break;
                else
                    throw logger.parserUnknownEndElement(endElementName);
            }

            StartElement subEvent = StaxParserUtil.peekNextStartElement(xmlEventReader);
            if (subEvent == null)
                break;
            String elementName = StaxParserUtil.getStartElementName(subEvent);

            if (CLAIMS_PROCESSOR_ELEMENT.equalsIgnoreCase(elementName)) {
                subEvent = StaxParserUtil.getNextStartElement(xmlEventReader);
                StaxParserUtil.validate(subEvent, CLAIMS_PROCESSOR_ELEMENT);
                ClaimsProcessorType claimsProcessor = new ClaimsProcessorType();

                // parse the processor attributes (class and dialect).
                QName attributeQName = new QName("", PROCESSOR_CLASS_ATTRIB);
                Attribute attribute = subEvent.getAttributeByName(attributeQName);
                if (attribute != null)
                    claimsProcessor.setProcessorClass(StaxParserUtil.getAttributeValue(attribute));
                attributeQName = new QName("", DIALECT_ATTRIB);
                attribute = subEvent.getAttributeByName(attributeQName);
                if (attribute != null)
                    claimsProcessor.setDialect(StaxParserUtil.getAttributeValue(attribute));

                // parse the processor properties.
                while (xmlEventReader.hasNext()) {
                    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(CLAIMS_PROCESSOR_ELEMENT))
                            break;
                        else
                            throw logger.parserUnknownEndElement(endElementName);
                    }

                    subEvent = StaxParserUtil.peekNextStartElement(xmlEventReader);
                    if (subEvent == null)
                        break;
                    elementName = StaxParserUtil.getStartElementName(subEvent);
                    if (PROPERTY_ELEMENT.equalsIgnoreCase(elementName)) {
                        // parse the property key and value.
                        subEvent = StaxParserUtil.getNextStartElement(xmlEventReader);
                        KeyValueType keyValue = new KeyValueType();
                        // parse the key and value attributes.
                        attributeQName = new QName("", KEY_ATTRIB);
                        attribute = subEvent.getAttributeByName(attributeQName);
                        if (attribute != null)
                            keyValue.setKey(StaxParserUtil.getAttributeValue(attribute));
                        attributeQName = new QName("", VALUE_ATTRIB);
                        attribute = subEvent.getAttributeByName(attributeQName);
                        if (attribute != null)
                            keyValue.setValue(StaxParserUtil.getAttributeValue(attribute));

                        EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                        StaxParserUtil.validate(endElement, PROPERTY_ELEMENT);
                        claimsProcessor.add(keyValue);
                    } else
                        throw logger.parserUnknownTag(elementName, subEvent.getLocation());
                }
                claimsProcessors.add(claimsProcessor);
            } else
                throw logger.parserUnknownTag(elementName, subEvent.getLocation());
        }
        return claimsProcessors;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.ClaimsProcessorsType

                this.tokenProviders.put(tokenElementAndNS, tokenProvider);
            }
        }

        // build the claims processors map.
        ClaimsProcessorsType processors = this.delegate.getClaimsProcessors();
        if (processors != null) {
            for (ClaimsProcessorType processor : processors.getClaimsProcessor()) {
                // get the properties that have been configured for the claims processor.
                Map<String, String> properties = new HashMap<String, String>();
                List<KeyValueType> processorPropertiesList;
                try {
                    processorPropertiesList = CoreConfigUtil.getProperties(processor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.