本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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());
}
示例15: httpPostBinding
import org.opensaml.xml.parse.ParserPool; //导入依赖的package包/类
private HTTPPostBinding httpPostBinding(ParserPool parserPool) {
return new HTTPPostBinding(parserPool, VelocityFactory.getEngine());
}