Package org.geoserver.ows

Examples of org.geoserver.ows.HttpErrorCodeException


            throw new WmsException("Failure while pre-processing regionated features");
        }

        // This okay, just means the tile is empty
        if (featuresInTile.size() == 0) {
            throw new HttpErrorCodeException(204);
        } else {
            FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
            Set<FeatureId> ids = new HashSet<FeatureId>();
            for (String fid : featuresInTile) {
                ids.add(ff.featureId(fid));
View Full Code Here


            long maxTime = timeout > 0 ? System.currentTimeMillis() + timeout : -1;
            for (FlowController flowController : controllers) {
                if(timeout > 0) {
                    long maxWait = maxTime - System.currentTimeMillis();
                    if(!flowController.requestIncoming(request, maxWait))
                        throw new HttpErrorCodeException(503, "Requested timeout out while waiting to be executed");
                 } else {
                    flowController.requestIncoming(request, -1);
                }
            }
        }
View Full Code Here

                final String ifNoneMatch = request.getHttpRequestHeader("If-None-Match");
                final String hexTag = Long.toHexString(cachedTile.getTSCreated());
                if (hexTag.equals(ifNoneMatch)) {
                    // Client already has the current version
                    LOGGER.finer("ETag matches, returning 304");
                    throw new HttpErrorCodeException(HttpServletResponse.SC_NOT_MODIFIED);
                }

                LOGGER.finer("No matching ETag, returning cached tile");
                final byte[] mapContents = cachedTile.getContent();
                final String mimeType = cachedTile.getMimeType().getMimeType();
View Full Code Here

                long maxTime = timeout > 0 ? System.currentTimeMillis() + timeout : -1;
                for (FlowController flowController : controllers) {
                    if(timeout > 0) {
                        long maxWait = maxTime - System.currentTimeMillis();
                        if(!flowController.requestIncoming(request, maxWait))
                            throw new HttpErrorCodeException(503, "Requested timeout out while waiting to be executed");
                     } else {
                        flowController.requestIncoming(request, -1);
                    }
                }
            }
View Full Code Here

                    long maxTime = timeout > 0 ? System.currentTimeMillis() + timeout : -1;
                    for (FlowController flowController : controllers) {
                        if (timeout > 0) {
                            long maxWait = maxTime - System.currentTimeMillis();
                            if (!flowController.requestIncoming(request, maxWait)) {
                                throw new HttpErrorCodeException(503,
                                        "Requested timeout out while waiting to be executed, please lower your request rate");
                            }
                        } else {
                            flowController.requestIncoming(request, -1);
                        }
View Full Code Here

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine(this + ", residual in current time period " + residual);
        }
        if (residual < 0) {
            if (delay <= 0) {
                throw new HttpErrorCodeException(429,
                        "Too many requests requests in the current time period, check X-Rate-Limit HTTP response headers");
            } else if(delay > timeout) {
                // no point in waiting
                return false;
            } else {
View Full Code Here

            throw new ServiceException("Failure while pre-processing regionated features");
        }

        // This okay, just means the tile is empty
        if (featuresInTile.size() == 0) {
            throw new HttpErrorCodeException(204);
        } else {
            FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
            Set<FeatureId> ids = new HashSet<FeatureId>();
            for (String fid : featuresInTile) {
                ids.add(ff.featureId(fid));
View Full Code Here

    public RepositoryItem run(GetRepositoryItemType request)  {
        try {
            RepositoryItem item = store.getRepositoryItem(request.getId());
            if(item == null) {
                // by spec we have to return a 404
                throw new HttpErrorCodeException(404, "No repository item found for id " + request.getId());
            }
            return item;
        } catch (IOException e) {
            throw new ServiceException("Failed to load the repository item", e);
        }
View Full Code Here

        final byte[] hash = MessageDigest.getInstance("MD5").digest(tileBytes);
        final String etag = toHexString(hash);
        if (etag.equals(ifNoneMatch)) {
            // Client already has the current version
            LOGGER.finer("ETag matches, returning 304");
            throw new HttpErrorCodeException(HttpServletResponse.SC_NOT_MODIFIED);
        }

        LOGGER.finer("No matching ETag, returning cached tile");
        final String mimeType = cachedTile.getMimeType().getMimeType();
View Full Code Here

                ifModifiedSince = DateUtil.parseDate(ifModSinceHeader);
                // the HTTP header has second precision
                long ifModSinceSeconds = 1000 * (ifModifiedSince.getTime() / 1000);
                long tileTimeStampSeconds = 1000 * (tileTimeStamp / 1000);
                if (ifModSinceSeconds >= tileTimeStampSeconds) {
                    throw new HttpErrorCodeException(HttpServletResponse.SC_NOT_MODIFIED);
                }
            } catch (DateParseException e) {
                if (LOGGER.isLoggable(Level.FINER)) {
                    LOGGER.finer("Can't parse client's If-Modified-Since header: '"
                            + ifModSinceHeader + "'");
View Full Code Here

TOP

Related Classes of org.geoserver.ows.HttpErrorCodeException

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.