Package slash.navigation.rest.exception

Examples of slash.navigation.rest.exception.ServiceUnavailableException


                if (geocodeResponse != null) {
                    String status = geocodeResponse.getStatus();
                    if (status.equals(OK))
                        return extractClosestLocation(geocodeResponse.getResult(), longitude, latitude);
                    if (status.equals(OVER_QUERY_LIMIT))
                        throw new ServiceUnavailableException("maps.googleapis.com", url);
                }
            } catch (JAXBException e) {
                throw new IOException("Cannot unmarshall " + result + ": " + e, e);
            }
        return null;
View Full Code Here


                if (geocodeResponse != null) {
                    String status = geocodeResponse.getStatus();
                    if (status.equals(OK))
                        return extractAdresses(geocodeResponse.getResult());
                    if (status.equals(OVER_QUERY_LIMIT))
                        throw new ServiceUnavailableException("maps.googleapis.com", url);
                }
            } catch (JAXBException e) {
                throw new IOException("Cannot unmarshall " + result + ": " + e, e);
            }
        return null;
View Full Code Here

                    if (status.equals(OK)) {
                        List<Double> elevations = extractElevations(elevationResponse.getResult());
                        return elevations != null && elevations.size() > 0 ? elevations.get(0) : null;
                    }
                    if (status.equals(OVER_QUERY_LIMIT))
                        throw new ServiceUnavailableException("maps.googleapis.com", url);
                }
            } catch (JAXBException e) {
                throw new IOException("Cannot unmarshall " + result + ": " + e, e);
            }
        return null;
View Full Code Here

        return null;
    }

    private void checkCurrentlyOverloaded(String url, String result) throws ServiceUnavailableException {
        if (result.contains("<html>") && (result.contains("overloaded") || result.contains("exceeded")))
            throw new ServiceUnavailableException("geonames.org", url);
    }
View Full Code Here

TOP

Related Classes of slash.navigation.rest.exception.ServiceUnavailableException

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.