Spring Social Twitter

org.springframework.social.twitter.api.impl
Class GeoTemplate

java.lang.Object
  extended by org.springframework.social.twitter.api.impl.GeoTemplate
All Implemented Interfaces:
GeoOperations

public class GeoTemplate
extends java.lang.Object
implements GeoOperations


Constructor Summary
GeoTemplate(org.springframework.web.client.RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp)
           
 
Method Summary
protected  java.net.URI buildUri(java.lang.String path)
           
protected  java.net.URI buildUri(java.lang.String path, org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> parameters)
           
protected  java.net.URI buildUri(java.lang.String path, java.lang.String parameterName, java.lang.String parameterValue)
           
 Place createPlace(PlacePrototype placePrototype)
          Creates a new place.
 SimilarPlaces findSimilarPlaces(double latitude, double longitude, java.lang.String name)
          Finds places similar to a place described in the parameters.
 SimilarPlaces findSimilarPlaces(double latitude, double longitude, java.lang.String name, java.lang.String streetAddress, java.lang.String containedWithin)
          Finds places similar to a place described in the parameters.
 Place getPlace(java.lang.String placeId)
          Retrieves information about a plce
protected  void requireAppAuthorization()
           
protected  void requireEitherUserOrAppAuthorization()
           
protected  void requireUserAuthorization()
           
 java.util.List<Place> reverseGeoCode(double latitude, double longitude)
          Retrieves up to 20 places matching the given location.
 java.util.List<Place> reverseGeoCode(double latitude, double longitude, PlaceType granularity, java.lang.String accuracy)
          Retrieves up to 20 places matching the given location and criteria
 java.util.List<Place> search(double latitude, double longitude)
          Searches for up to 20 places matching the given location.
 java.util.List<Place> search(double latitude, double longitude, PlaceType granularity, java.lang.String accuracy, java.lang.String query)
          Searches for up to 20 places matching the given location and criteria
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTemplate

public GeoTemplate(org.springframework.web.client.RestTemplate restTemplate,
                   boolean isAuthorizedForUser,
                   boolean isAuthorizedForApp)
Method Detail

getPlace

public Place getPlace(java.lang.String placeId)
Description copied from interface: GeoOperations
Retrieves information about a plce

Specified by:
getPlace in interface GeoOperations
Parameters:
placeId - the place ID
Returns:
a Place

reverseGeoCode

public java.util.List<Place> reverseGeoCode(double latitude,
                                            double longitude)
Description copied from interface: GeoOperations
Retrieves up to 20 places matching the given location.

Specified by:
reverseGeoCode in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
Returns:
a list of Places that the point is within

reverseGeoCode

public java.util.List<Place> reverseGeoCode(double latitude,
                                            double longitude,
                                            PlaceType granularity,
                                            java.lang.String accuracy)
Description copied from interface: GeoOperations
Retrieves up to 20 places matching the given location and criteria

Specified by:
reverseGeoCode in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
granularity - the minimal granularity of the places to return. If null, the default granularity (neighborhood) is assumed.
accuracy - a radius of accuracy around the given point. If given a number, the value is assumed to be in meters. The number may be qualified with "ft" to indicate feet. If null, the default accuracy (0m) is assumed.
Returns:
a list of Places that the point is within

search

public java.util.List<Place> search(double latitude,
                                    double longitude)
Description copied from interface: GeoOperations
Searches for up to 20 places matching the given location.

Specified by:
search in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
Returns:
a list of Places that the point is within

search

public java.util.List<Place> search(double latitude,
                                    double longitude,
                                    PlaceType granularity,
                                    java.lang.String accuracy,
                                    java.lang.String query)
Description copied from interface: GeoOperations
Searches for up to 20 places matching the given location and criteria

Specified by:
search in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
granularity - the minimal granularity of the places to return. If null, the default granularity (neighborhood) is assumed.
accuracy - a radius of accuracy around the given point. If given a number, the value is assumed to be in meters. The number may be qualified with "ft" to indicate feet. If null, the default accuracy (0m) is assumed.
query - a free form text value to help find places by name. If null, no query will be applied to the search.
Returns:
a list of Places that the point is within

findSimilarPlaces

public SimilarPlaces findSimilarPlaces(double latitude,
                                       double longitude,
                                       java.lang.String name)
Description copied from interface: GeoOperations
Finds places similar to a place described in the parameters. Returns a list of places along with a token that is required for creating a new place. This method must be called before calling createPlace().

Specified by:
findSimilarPlaces in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
name - the name that the place is known as
Returns:
a SimilarPlaces collection, including a token that can be used to create a new place.

findSimilarPlaces

public SimilarPlaces findSimilarPlaces(double latitude,
                                       double longitude,
                                       java.lang.String name,
                                       java.lang.String streetAddress,
                                       java.lang.String containedWithin)
Description copied from interface: GeoOperations
Finds places similar to a place described in the parameters. Returns a list of places along with a token that is required for creating a new place. This method must be called before calling createPlace().

Specified by:
findSimilarPlaces in interface GeoOperations
Parameters:
latitude - the latitude
longitude - the longitude
name - the name that the place is known as
streetAddress - the place's street address. May be null.
containedWithin - the ID of the place that the place is contained within
Returns:
a SimilarPlaces collection, including a token that can be used to create a new place.

createPlace

public Place createPlace(PlacePrototype placePrototype)
Description copied from interface: GeoOperations
Creates a new place.

Specified by:
createPlace in interface GeoOperations
Parameters:
placePrototype - the place prototype returned in a SimilarPlaces from a call to findSimilarPlaces()
Returns:
a Place object with the newly created place data

requireUserAuthorization

protected void requireUserAuthorization()

requireAppAuthorization

protected void requireAppAuthorization()

requireEitherUserOrAppAuthorization

protected void requireEitherUserOrAppAuthorization()

buildUri

protected java.net.URI buildUri(java.lang.String path)

buildUri

protected java.net.URI buildUri(java.lang.String path,
                                java.lang.String parameterName,
                                java.lang.String parameterValue)

buildUri

protected java.net.URI buildUri(java.lang.String path,
                                org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> parameters)

Spring Social Twitter