当前位置: 首页>>代码示例>>Java>>正文


Java ParserPool类代码示例

本文整理汇总了Java中org.opensaml.xml.parse.ParserPool的典型用法代码示例。如果您正苦于以下问题:Java ParserPool类的具体用法?Java ParserPool怎么用?Java ParserPool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParserPool类属于org.opensaml.xml.parse包,在下文中一共展示了ParserPool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Before
public void setup() {
    properties = mock(SAMLSSOProperties.class);
    metadataManagerProperties = spy(new MetadataManagerProperties());
    extendedMetadataDelegateProperties = spy(new ExtendedMetadataDelegateProperties());
    idpConfiguration = spy(new IdentityProvidersProperties());
    extendedMetadata = spy(new ExtendedMetadata());
    when(properties.getMetadataManager()).thenReturn(metadataManagerProperties);
    when(properties.getExtendedDelegate()).thenReturn(extendedMetadataDelegateProperties);
    when(properties.getIdp()).thenReturn(idpConfiguration);
    builder = mock(ServiceProviderBuilder.class);
    when(builder.getSharedObject(SAMLSSOProperties.class)).thenReturn(properties);
    when(builder.getSharedObject(ExtendedMetadata.class)).thenReturn(extendedMetadata);
    resourceLoader = new DefaultResourceLoader();
    when(builder.getSharedObject(ResourceLoader.class)).thenReturn(resourceLoader);
    parserPool = mock(ParserPool.class);
    when(builder.getSharedObject(ParserPool.class)).thenReturn(parserPool);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:19,代码来源:MetadataManagerConfigurerTest.java

示例2: BaseMessageDecoder

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param pool parser pool used to deserialize messages
 */
public BaseMessageDecoder(ParserPool pool) {
    if (pool == null) {
        throw new IllegalArgumentException("Parser pool may not be null");
    }

    parserPool = pool;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:BaseMessageDecoder.java

示例3: setParserPool

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Sets the parser pool used to deserialize incomming messages.
 * 
 * @param pool parser pool used to deserialize incomming messages
 */
protected void setParserPool(ParserPool pool) {
    if (pool == null) {
        throw new IllegalArgumentException("Parser pool may not be null");
    }
    parserPool = pool;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:BaseMessageDecoder.java

示例4: HttpSOAPClient

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param client Client used to make outbound HTTP requests. This client SHOULD employ a
 *            {@link org.apache.commons.httpclient.MultiThreadedHttpConnectionManager} and may be shared with other
 *            objects.
 * @param parser pool of XML parsers used to parse incoming responses
 */
public HttpSOAPClient(HttpClient client, ParserPool parser) {
    if (client == null) {
        throw new IllegalArgumentException("HtppClient may not be null");
    }
    httpClient = client;

    if (parser == null) {
        throw new IllegalArgumentException("ParserPool may not be null");
    }
    parserPool = parser;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:HttpSOAPClient.java

示例5: unmarshallFromInputStream

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Unmarshall a Document from an InputSteam.
 * 
 * @param parserPool the ParserPool instance to use
 * @param inputStream the InputStream to unmarshall
 * @return the unmarshalled XMLObject
 * @throws XMLParserException if there is a problem parsing the input data
 * @throws UnmarshallingException if there is a problem unmarshalling the parsed DOM
 */
public static XMLObject unmarshallFromInputStream(ParserPool parserPool, InputStream inputStream)
        throws XMLParserException, UnmarshallingException {
    Logger log = getLogger();
    log.debug("Parsing InputStream into DOM document");

    Document messageDoc = parserPool.parse(inputStream);
    Element messageElem = messageDoc.getDocumentElement();

    if (log.isTraceEnabled()) {
        log.trace("Resultant DOM message was:");
        log.trace(XMLHelper.nodeToString(messageElem));
    }

    log.debug("Unmarshalling DOM parsed from InputStream");
    Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
    if (unmarshaller == null) {
        log.error("Unable to unmarshall InputStream, no unmarshaller registered for element "
                + XMLHelper.getNodeQName(messageElem));
        throw new UnmarshallingException(
                "Unable to unmarshall InputStream, no unmarshaller registered for element "
                        + XMLHelper.getNodeQName(messageElem));
    }

    XMLObject message = unmarshaller.unmarshall(messageElem);

    log.debug("InputStream succesfully unmarshalled");
    return message;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:38,代码来源:XMLObjectHelper.java

示例6: unmarshallFromReader

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Unmarshall a Document from a Reader.
 * 
 * @param parserPool the ParserPool instance to use
 * @param reader the Reader to unmarshall
 * @return the unmarshalled XMLObject
 * @throws XMLParserException if there is a problem parsing the input data
 * @throws UnmarshallingException if there is a problem unmarshalling the parsed DOM
 */
public static XMLObject unmarshallFromReader(ParserPool parserPool, Reader reader)
        throws XMLParserException, UnmarshallingException {
    Logger log = getLogger();
    log.debug("Parsing Reader into DOM document");
    

    Document messageDoc = parserPool.parse(reader);
    Element messageElem = messageDoc.getDocumentElement();

    if (log.isTraceEnabled()) {
        log.trace("Resultant DOM message was:");
        log.trace(XMLHelper.nodeToString(messageElem));
    }

    log.debug("Unmarshalling DOM parsed from Reader");
    Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
    if (unmarshaller == null) {
        log.error("Unable to unmarshall Reader, no unmarshaller registered for element "
                + XMLHelper.getNodeQName(messageElem));
        throw new UnmarshallingException(
                "Unable to unmarshall Reader, no unmarshaller registered for element "
                        + XMLHelper.getNodeQName(messageElem));
    }

    XMLObject message = unmarshaller.unmarshall(messageElem);

    log.debug("Reader succesfully unmarshalled");
    return message;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:XMLObjectHelper.java

示例7: afterPropertiesSet

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
    //All existing beans are thrown as shared objects to the ServiceProviderSecurityBuilder, which will wire all
    //beans/objects related to spring security SAML.
    serviceProviderBuilder.setSharedObject(ParserPool.class, ParserPoolHolder.getPool());
    serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerImpl.class, (WebSSOProfileConsumerImpl) webSSOProfileConsumer);
    serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerHoKImpl.class, hokWebSSOProfileConsumer);
    serviceProviderBuilder.setSharedObject(ServiceProviderEndpoints.class, new ServiceProviderEndpoints());
    serviceProviderBuilder.setSharedObject(ResourceLoader.class, resourceLoader);
    serviceProviderBuilder.setSharedObject(SAMLSSOProperties.class, sAMLSsoProperties);
    serviceProviderBuilder.setSharedObject(ExtendedMetadata.class, extendedMetadata);
    serviceProviderBuilder.setSharedObject(LocalExtendedMetadata.class, localExtendedMetadata);
    serviceProviderBuilder.setSharedObject(SAMLAuthenticationProvider.class, samlAuthenticationProvider);
    serviceProviderBuilder.setSharedObject(SAMLContextProvider.class, samlContextProvider);
    serviceProviderBuilder.setSharedObject(KeyManager.class, keyManager);
    serviceProviderBuilder.setSharedObject(MetadataManager.class, metadataManager);
    serviceProviderBuilder.setSharedObject(MetadataGenerator.class, metadataGenerator);
    serviceProviderBuilder.setSharedObject(SAMLProcessor.class, samlProcessor);
    serviceProviderBuilder.setSharedObject(WebSSOProfile.class, webSSOProfile);
    serviceProviderBuilder.setSharedObject(WebSSOProfileECPImpl.class, ecpProfile);
    serviceProviderBuilder.setSharedObject(WebSSOProfileHoKImpl.class, hokWebSSOProfile);
    serviceProviderBuilder.setSharedObject(SingleLogoutProfile.class, sloProfile);
    serviceProviderBuilder.setSharedObject(WebSSOProfileConsumer.class, webSSOProfileConsumer);
    serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerHoKImpl.class, hokWebSSOProfileConsumer);
    serviceProviderBuilder.setSharedObject(SAMLLogger.class, samlLogger);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:27,代码来源:SAMLServiceProviderSecurityConfiguration.java

示例8: setup

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Before
public void setup() {
    properties = mock(SAMLSSOProperties.class);
    samlProcessorConfig = spy(new SAMLProcessorProperties());
    when(properties.getSamlProcessor()).thenReturn(samlProcessorConfig);
    builder = mock(ServiceProviderBuilder.class);
    parserPool = mock(ParserPool.class);
    when(builder.getSharedObject(ParserPool.class)).thenReturn(parserPool);
    when(builder.getSharedObject(SAMLSSOProperties.class)).thenReturn(properties);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:11,代码来源:SAMLProcessorConfigurerTest.java

示例9: ssoCircleExtendedMetadataProvider

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Bean
@Qualifier("idp-ssocircle")
public ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider()
        throws MetadataProviderException {


    AbstractMetadataProvider provider = new AbstractMetadataProvider() {
        @Override
        protected XMLObject doGetMetadata() throws MetadataProviderException {
            DefaultResourceLoader loader = new DefaultResourceLoader();
            Resource storeFile = loader.getResource("classPath:/saml/idp-metadata.xml");

            ParserPool parser = parserPool();
            try {
                Document mdDocument = parser.parse(storeFile.getInputStream());
                Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(mdDocument.getDocumentElement());
                return unmarshaller.unmarshall(mdDocument.getDocumentElement());
            } catch (Exception e) {
                e.printStackTrace();
                throw new MetadataProviderException();
            }


        }
    };
    ExtendedMetadataDelegate extendedMetadataDelegate =
            new ExtendedMetadataDelegate(provider, extendedMetadata());
    extendedMetadataDelegate.setMetadataTrustCheck(false);
    extendedMetadataDelegate.setMetadataRequireSignature(false);
    return extendedMetadataDelegate;
}
 
开发者ID:lhartikk,项目名称:spring-tsers-auth,代码行数:32,代码来源:WebSecurityConfig.java

示例10: SAMLMetadataProfileHandlerIB

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param metadataFile the IdPs metadata file
 * @param pool pool of XML parsers used to parse the metadata
 */
public SAMLMetadataProfileHandlerIB(String metadataFile, ParserPool pool) {
    try {
        metadataProvider = new FilesystemMetadataProvider(new File(SubstitutionResolver.resolve(metadataFile)));
        metadataProvider.setParserPool(pool);
        metadataProvider.setRequireValidMetadata(false);
        metadataProvider.initialize();
    } catch (Exception e) {
        log.error("Unable to read metadata file " + metadataFile, e);
    }
}
 
开发者ID:brainysmith,项目名称:idp-play-bridge,代码行数:17,代码来源:SAMLMetadataProfileHandlerIB.java

示例11: setParserPool

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
private MetadataProvider setParserPool(MetadataProvider provider) {
    if (provider instanceof AbstractMetadataProvider) {
        ((AbstractMetadataProvider) provider).setParserPool(getBuilder().getSharedObject(ParserPool.class));
    }
    return provider;
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:7,代码来源:MetadataManagerConfigurer.java

示例12: init

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Override
public void init(ServiceProviderBuilder builder) throws Exception {
    sAMLProcessorBean = builder.getSharedObject(SAMLProcessor.class);
    processorConfig = builder.getSharedObject(SAMLSSOProperties.class).getSamlProcessor();
    parserPool = builder.getSharedObject(ParserPool.class);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:7,代码来源:SAMLProcessorConfigurer.java

示例13: parserPool

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Bean(initMethod = "initialize")
@ConditionalOnMissingBean
public ParserPool parserPool() {
    return new StaticBasicParserPool();
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:6,代码来源:SAMLServiceProviderSecurityConfiguration.java

示例14: artifactBinding

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
@Bean
public HTTPArtifactBinding artifactBinding(ParserPool parserPool, VelocityEngine velocityEngine) {
    return new HTTPArtifactBinding(parserPool, velocityEngine, artifactResolutionProfile());
}
 
开发者ID:lhartikk,项目名称:spring-tsers-auth,代码行数:5,代码来源:WebSecurityConfig.java

示例15: httpPostBinding

import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
private HTTPPostBinding httpPostBinding(ParserPool parserPool) {
	return new HTTPPostBinding(parserPool, VelocityFactory.getEngine());
}
 
开发者ID:spring-projects,项目名称:spring-security-saml-dsl,代码行数:4,代码来源:SAMLConfigurer.java


注:本文中的org.opensaml.xml.parse.ParserPool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。