Package org.geowebcache.layer.updatesource

Examples of org.geowebcache.layer.updatesource.GeoRSSFeedDefinition


            schedulingPollExecutorService = Executors.newScheduledThreadPool(corePoolSize);

            final TimeUnit seconds = TimeUnit.SECONDS;
            for (PollDef poll : this.scheduledPolls) {
                GeoRSSPollTask command = new GeoRSSPollTask(poll, this.seeder);
                GeoRSSFeedDefinition pollDef = poll.getPollDef();
                long period = pollDef.getPollInterval();

                logger.info("Scheduling layer " + poll.getLayer().getName()
                        + " to poll the GeoRSS feed " + pollDef.getFeedUrl() + " every "
                        + pollDef.getPollIntervalStr());

                schedulingPollExecutorService.scheduleAtFixedRate(command, startUpDelaySecs,
                        period, seconds);

                scheduledTasks.add(command);
View Full Code Here


                logger.info("Ignoring polling GeoRSS update sources for layer '" + layer.getName()
                        + "' as the layer is disabled");
            }
            for (UpdateSourceDefinition usd : layer.getUpdateSources()) {
                if (usd instanceof GeoRSSFeedDefinition) {
                    final GeoRSSFeedDefinition georssDef = (GeoRSSFeedDefinition) usd;

                    final String gridSetId = georssDef.getGridSetId();
                    final GridSubset gridSubset = layer.getGridSubset(gridSetId);
                    if (gridSubset == null) {
                        throw new IllegalStateException("Layer " + layer.getName()
                                + " has no grid subset " + gridSetId
                                + " as configured by its GeoRSS seeding feed " + georssDef);
                    }

                    if (georssDef.getPollInterval() > 0) {
                        logger.info("Scheduling GeoRSS feed for layer " + layer.getName() + ":"
                                + georssDef);
                        scheduledPolls.add(new PollDef(layer, georssDef));
                    } else {
                        logger.info("Feed disabled for layer " + layer.getName() + ", ignoring: "
View Full Code Here

        }
    }

    private void runPollAndLaunchSeed() throws IOException {
        final TileLayer layer = poll.getLayer();
        final GeoRSSFeedDefinition pollDef = poll.getPollDef();

        logger.info("Polling GeoRSS feed for layer " + layer.getName() + ": " + pollDef.toString());

        final String gridSetId = pollDef.getGridSetId();
        final URL feedUrl = new URL(templateFeedUrl(pollDef.getFeedUrl()));
        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 "
                + layer.getName());

        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 " + layer.getName());
View Full Code Here

                if (pollCount() > 0) {

                    final TimeUnit seconds = TimeUnit.SECONDS;
                    for (PollDef poll : scheduledPolls) {
                        GeoRSSPollTask command = new GeoRSSPollTask(poll, seeder);
                        GeoRSSFeedDefinition pollDef = poll.getPollDef();
                        long period = pollDef.getPollInterval();

                        logger.info("Scheduling layer " + poll.getLayer().getName()
                                + " to poll the GeoRSS feed " + pollDef.getFeedUrl() + " every "
                                + pollDef.getPollIntervalStr());

                        schedulingPollExecutorService.scheduleAtFixedRate(command,
                                startUpDelaySecs, period, seconds);

                        scheduledTasks.add(command);
View Full Code Here

                logger.info("Ignoring polling GeoRSS update sources for layer '" + layer.getName()
                        + "' as the layer is disabled");
            }
            for (UpdateSourceDefinition usd : layer.getUpdateSources()) {
                if (usd instanceof GeoRSSFeedDefinition) {
                    final GeoRSSFeedDefinition georssDef = (GeoRSSFeedDefinition) usd;

                    final String gridSetId = georssDef.getGridSetId();
                    final GridSubset gridSubset = layer.getGridSubset(gridSetId);
                    if (gridSubset == null) {
                        throw new IllegalStateException("Layer " + layer.getName()
                                + " has no grid subset " + gridSetId
                                + " as configured by its GeoRSS seeding feed " + georssDef);
                    }

                    if (georssDef.getPollInterval() > 0) {
                        logger.info("Scheduling GeoRSS feed for layer " + layer.getName() + ":"
                                + georssDef);
                        scheduledPolls.add(new PollDef(layer, georssDef));
                    } else {
                        logger.info("Feed disabled for layer " + layer.getName() + ", ignoring: "
View Full Code Here

    }

    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);
View Full Code Here

TOP

Related Classes of org.geowebcache.layer.updatesource.GeoRSSFeedDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.