Search in sources :

Example 1 with ProxyProperties

use of org.finos.symphony.toolkit.spring.api.properties.ProxyProperties in project spring-bot by finos.

the class PodInfoStoreTokenStrategy method setupApiBuilder.

private ApiBuilder setupApiBuilder(PodInfo pod, String url) throws Exception {
    ConfigurableApiBuilder ab = abf.getObject();
    ab.setUrl(url);
    ab.setKeyManagers(appIdentity.getKeyManagers());
    ab.setTrustManagers(trustManagers);
    if (pod.getUseProxy() != Boolean.FALSE) {
        ProxyProperties proxy = appProperties.getProxy();
        if (proxy != null) {
            proxy.configure(ab);
        }
    }
    return ab;
}
Also used : ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder) ProxyProperties(org.finos.symphony.toolkit.spring.api.properties.ProxyProperties)

Example 2 with ProxyProperties

use of org.finos.symphony.toolkit.spring.api.properties.ProxyProperties in project spring-bot by finos.

the class FeedLoader method createFeed.

public Feed createFeed(String url, String name) throws FeedException {
    Exception last = null;
    for (ProxyProperties proxyProperties : pp) {
        try {
            SyndFeedInput input = new SyndFeedInput();
            input.setAllowDoctypes(true);
            SyndFeed feed = input.build(new XmlReader(downloadContent(url, proxyProperties)));
            Feed f = new Feed();
            if (!StringUtils.hasText(name)) {
                f.setName(feed.getTitle());
            } else {
                f.setName(name);
            }
            f.setDescription(feed.getDescription());
            f.setUrl(url);
            f.setProxy(proxyProperties);
            return f;
        } catch (Exception e) {
            LOG.info("Couldn't get feed " + url + " with " + proxyProperties.getHost());
            last = e;
        }
    }
    throw new FeedException("Couldn't download feed with any proxy", last);
}
Also used : SyndFeed(com.rometools.rome.feed.synd.SyndFeed) ProxyProperties(org.finos.symphony.toolkit.spring.api.properties.ProxyProperties) SyndFeedInput(com.rometools.rome.io.SyndFeedInput) FeedException(com.rometools.rome.io.FeedException) XmlReader(com.rometools.rome.io.XmlReader) MalformedURLException(java.net.MalformedURLException) FeedException(com.rometools.rome.io.FeedException) Feed(org.finos.symphony.rssbot.feed.Feed) SyndFeed(com.rometools.rome.feed.synd.SyndFeed)

Aggregations

ProxyProperties (org.finos.symphony.toolkit.spring.api.properties.ProxyProperties)2 SyndFeed (com.rometools.rome.feed.synd.SyndFeed)1 FeedException (com.rometools.rome.io.FeedException)1 SyndFeedInput (com.rometools.rome.io.SyndFeedInput)1 XmlReader (com.rometools.rome.io.XmlReader)1 ConfigurableApiBuilder (com.symphony.api.bindings.ConfigurableApiBuilder)1 MalformedURLException (java.net.MalformedURLException)1 Feed (org.finos.symphony.rssbot.feed.Feed)1