|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.arcao.geocaching.api.GeocachingApi
com.arcao.geocaching.api.impl.LiveGeocachingApi
public class LiveGeocachingApi
Implementation of Life Geocaching Api provided by Groundspeak. To use this class you need consumer and license key, ask Groundspeak for them.
Note: Most of methods is limited from Groundspeak side. See Live Geocaching Api agreement.
Some limits for Premium User:
| Field Summary | |
|---|---|
protected static String |
BASE_URL
|
protected String |
consumerKey
|
protected String |
licenseKey
|
| Fields inherited from class com.arcao.geocaching.api.GeocachingApi |
|---|
session |
| Constructor Summary | |
|---|---|
LiveGeocachingApi(String consumerKey,
String licenseKey)
Create a new instance of LiveGeocachingApi with specified consumer key and license key. |
|
| Method Summary | |
|---|---|
protected JsonReader |
callGet(String function)
|
protected JsonReader |
callPost(String function,
String postBody)
|
void |
closeSession()
Close current used session |
CacheLog |
createFieldNoteAndPublish(String cacheCode,
LogType logType,
Date dateLogged,
String note,
boolean publish,
ImageData imageData,
boolean favoriteThisCache)
Create field note and publish them or store them to list of Field notes on Geocaching site. |
List<CacheLog> |
getCacheLogsByCacheCode(String cacheCode,
int startIndex,
int maxPerPage)
Get a list of cache logs in given cache. |
List<SimpleGeocache> |
getMoreGeocaches(boolean isLite,
int startIndex,
int maxPerPage,
int geocacheLogCount,
int trackableLogCount)
|
Trackable |
getTrackable(String trackableCode,
int trackableLogCount)
Get a trackable object for given trackable code. |
List<Trackable> |
getTrackablesByCacheCode(String cacheCode,
int startIndex,
int maxPerPage,
int trackableLogCount)
Get a list of trackables which is currently placed in a cache. |
UserProfile |
getYourUserProfile(boolean favoritePointData,
boolean geocacheData,
boolean publicProfileData,
boolean souvenirData,
boolean trackableData)
Get a information about user |
protected void |
checkError(JsonReader r)
|
boolean |
isSessionValid()
Check if current used session is still valid |
protected String |
maskPassword(String input)
|
void |
openSession(String userName,
String password)
Open a new session and log-in user |
List<SimpleGeocache> |
searchForGeocaches(boolean isLite,
int maxPerPage,
int geocacheLogCount,
int trackableLogCount,
Filter[] filters)
Search for geocaches and return list of found. |
| Methods inherited from class com.arcao.geocaching.api.GeocachingApi |
|---|
createFieldNoteAndPublish, getCache, getCacheSimple, getSession, openSession |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String BASE_URL
protected final String consumerKey
protected final String licenseKey
| Constructor Detail |
|---|
public LiveGeocachingApi(String consumerKey,
String licenseKey)
consumerKey - consumer keylicenseKey - license key| Method Detail |
|---|
public void openSession(String userName,
String password)
throws GeocachingApiException
GeocachingApi
openSession in class GeocachingApiuserName - user namepassword - password
GeocachingApiException - If Geocaching API error occurspublic void closeSession()
GeocachingApi
closeSession in class GeocachingApipublic boolean isSessionValid()
GeocachingApi
isSessionValid in class GeocachingApi
public List<SimpleGeocache> searchForGeocaches(boolean isLite,
int maxPerPage,
int geocacheLogCount,
int trackableLogCount,
Filter[] filters)
throws GeocachingApiException
GeocachingApi
searchForGeocaches in class GeocachingApiisLite - true if return a basic information about caches or fales for full
information about cachesmaxPerPage - count of caches to getgeocacheLogCount - count of logs to gettrackableLogCount - count of trackables to getfilters - used filters while searching
GeocachingApiException - If error occurs during searching caches
public List<SimpleGeocache> getMoreGeocaches(boolean isLite,
int startIndex,
int maxPerPage,
int geocacheLogCount,
int trackableLogCount)
throws GeocachingApiException
getMoreGeocaches in class GeocachingApiisLite - true if return a basic information about caches or fales for full
information about cachesstartIndex - count of caches to skipmaxPerPage - count of caches to getgeocacheLogCount - count of caches to gettrackableLogCount - count of trackables to get
GeocachingApiException - If error occurs during searching caches
public Trackable getTrackable(String trackableCode,
int trackableLogCount)
throws GeocachingApiException
GeocachingApi
getTrackable in class GeocachingApitrackableCode - trackable codetrackableLogCount - count of trackable logs to get
GeocachingApiException - If error occurs during getting information
public List<Trackable> getTrackablesByCacheCode(String cacheCode,
int startIndex,
int maxPerPage,
int trackableLogCount)
throws GeocachingApiException
GeocachingApi
getTrackablesByCacheCode in class GeocachingApicacheCode - cache codestartIndex - count of trackables to skipmaxPerPage - count of trackables to gettrackableLogCount - count of trackable logs to get
GeocachingApiException - If error occurs during getting information
public List<CacheLog> getCacheLogsByCacheCode(String cacheCode,
int startIndex,
int maxPerPage)
throws GeocachingApiException
GeocachingApi
getCacheLogsByCacheCode in class GeocachingApicacheCode - cache codestartIndex - count of logs to skipmaxPerPage - count of logs to get
GeocachingApiException - If error occurs during getting information
public CacheLog createFieldNoteAndPublish(String cacheCode,
LogType logType,
Date dateLogged,
String note,
boolean publish,
ImageData imageData,
boolean favoriteThisCache)
throws GeocachingApiException
GeocachingApi
createFieldNoteAndPublish in class GeocachingApicacheCode - geocache which can own this field notelogType - type of logdateLogged - when cache was foundnote - text of field notepublish - true if publish log to cache or false to add to Field note list on
Geocaching siteimageData - data about image to publish together or null to not publish any
imagefavoriteThisCache - true if add cache to favorite list otherwise false
GeocachingApiException - If error occurs during sending field note
public UserProfile getYourUserProfile(boolean favoritePointData,
boolean geocacheData,
boolean publicProfileData,
boolean souvenirData,
boolean trackableData)
throws GeocachingApiException
GeocachingApi
getYourUserProfile in class GeocachingApifavoritePointData - include favorites pointsgeocacheData - include information about cachespublicProfileData - include public profile informationsouvenirData - include souvenirstrackableData - include trackables
GeocachingApiException - If error occurs during getting information
protected void checkError(JsonReader r)
throws GeocachingApiException,
IOException
GeocachingApiException
IOException
protected JsonReader callGet(String function)
throws GeocachingApiException
GeocachingApiException
protected JsonReader callPost(String function,
String postBody)
throws GeocachingApiException
GeocachingApiExceptionprotected String maskPassword(String input)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||