// assemble Step2 OpenID implementation; TODO: utilize a more
// robust HTTPFetcher implementation since the DefaultHttpFetcher
// may not be entirely thread safe due to connection manager
// configuration in HttpComponents, (this is why there are 4
// discrete instances of DefaultHttpFetcher used below).
HostMetaFetcher step2GoogleHostMetaFetcher = new GoogleHostMetaFetcher(new DefaultHttpFetcher());
HostMetaFetcher step2DefaultHostMetaFetcher = new DefaultHostMetaFetcher(new DefaultHttpFetcher());
ThreadFactory parallelThreadFactory = new ThreadFactory()
{
public Thread newThread(Runnable r)
{
Thread newThread = Executors.defaultThreadFactory().newThread(r);
newThread.setName(getClass().getSimpleName()+"-"+newThread.getName());
newThread.setDaemon(true);
return newThread;
}
};
HostMetaFetcher step2HostMetaFetcher = new ParallelHostMetaFetcher(Executors.newFixedThreadPool(10, parallelThreadFactory), OPEN_ID_DISCOVERY_TIMEOUT_SECONDS, step2GoogleHostMetaFetcher, step2DefaultHostMetaFetcher);
TrustRootsProvider step2XrdsTrustProvider = new DefaultTrustRootsProvider();
CachedCertPathValidator step2XrdsCertPathValidator = new CachedCertPathValidator(step2XrdsTrustProvider);
Verifier step2XrdsVerifier = new Verifier(step2XrdsCertPathValidator, new DefaultHttpFetcher());
CertValidator step2XrdsCertValidator = new DefaultCertValidator();
XrdDiscoveryResolver step2XrdResolver = new LegacyXrdsResolver(new DefaultHttpFetcher(), step2XrdsVerifier, step2XrdsCertValidator);