Package org.picketlink.identity.federation.core.wstrust.wrappers

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityTokenCollection


     * @see {@link ParserNamespaceSupport#parse(XMLEventReader)}
     */
    public Object parse(XMLEventReader xmlEventReader) throws ParsingException {
        StaxParserUtil.getNextEvent(xmlEventReader);

        RequestSecurityTokenCollection requestCollection = new RequestSecurityTokenCollection();

        // Peek at the next event
        while (xmlEventReader.hasNext()) {
            StartElement peekedElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
            if (peekedElement == null)
                break;

            String tag = StaxParserUtil.getStartElementName(peekedElement);

            if (WSTrustConstants.RST.equalsIgnoreCase(tag)) {
                WSTRequestSecurityTokenParser rstParser = new WSTRequestSecurityTokenParser();
                RequestSecurityToken rst = (RequestSecurityToken) rstParser.parse(xmlEventReader);
                requestCollection.addRequestSecurityToken(rst);
            }
        }
        return requestCollection;
    }
View Full Code Here


    public void testWST_BatchIssue() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/wst/wst-batch-issue.xml");

        WSTrustParser parser = new WSTrustParser();
        RequestSecurityTokenCollection requestCollection = (RequestSecurityTokenCollection) parser.parse(configStream);
        assertNotNull("Request Security Token Collection is null?", requestCollection);

        List<RequestSecurityToken> tokens = requestCollection.getRequestSecurityTokens();
        assertEquals(2, tokens.size());

        RequestSecurityToken rst1 = tokens.get(0);
        assertEquals("context1", rst1.getContext());
        assertEquals(WSTrustConstants.BATCH_ISSUE_REQUEST, rst1.getRequestType().toASCIIString());
View Full Code Here

    public void testWST_BatchValidate() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/wst/wst-batch-validate.xml");

        WSTrustParser parser = new WSTrustParser();
        RequestSecurityTokenCollection requestCollection = (RequestSecurityTokenCollection) parser.parse(configStream);
        assertNotNull("Request Security Token Collection is null?", requestCollection);

        List<RequestSecurityToken> tokens = requestCollection.getRequestSecurityTokens();
        assertEquals(2, tokens.size());

        RequestSecurityToken rst1 = tokens.get(0);
        assertEquals("validatecontext1", rst1.getContext());
        assertEquals(WSTrustConstants.BATCH_VALIDATE_REQUEST, rst1.getRequestType().toASCIIString());
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityTokenCollection

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.