}
private void runPollAndLaunchSeed() throws IOException {
final String layerName = poll.getLayerName();
final TileLayer layer = poll.getLayer();
final GeoRSSFeedDefinition pollDef = poll.getPollDef();
logger.info("Polling GeoRSS feed for layer " + layerName + ": " + pollDef.toString());
final StorageBroker storageBroker = seeder.getStorageBroker();
final String previousUpdatedEntry = storageBroker.getLayerMetadata(layerName, LAST_UPDATED);
final String gridSetId = pollDef.getGridSetId();
final URL feedUrl = new URL(templateFeedUrl(pollDef.getFeedUrl(), previousUpdatedEntry));
final String httpUsername = pollDef.getHttpUsername();
final String httpPassword = pollDef.getHttpUsername();
logger.debug("Getting GeoRSS reader for " + feedUrl.toExternalForm());
final GeoRSSReaderFactory geoRSSReaderFactory = new GeoRSSReaderFactory();
GeoRSSReader geoRSSReader = null;
try {
geoRSSReader = geoRSSReaderFactory.createReader(feedUrl, httpUsername, httpPassword);
} catch (IOException ioe) {
logger.error("Failed to fetch RSS feed from " + feedUrl + "\n" + ioe.getMessage());
return;
}
logger.debug("Got reader for " + pollDef.getFeedUrl()
+ ". Creating geometry filter matrix for gridset " + gridSetId + " on layer "
+ layerName);
final int maxMaskLevel = pollDef.getMaxMaskLevel();
final GeoRSSTileRangeBuilder matrixBuilder = new GeoRSSTileRangeBuilder(layer, gridSetId,
maxMaskLevel);
logger.debug("Creating tile range mask based on GeoRSS feed's geometries from "
+ feedUrl.toExternalForm() + " for " + layerName);