org.shredzone.flattr4j
Interface OpenService

All Known Subinterfaces:
FlattrService
All Known Implementing Classes:
FlattrServiceImpl

public interface OpenService

Service calls to the Flattr REST API which do not require authorization. However, some calls may return more details for authorized users.

All calls will decrement the remaining rate by one, unless noted otherwise.

Author:
Richard "Shred" Körber

Method Summary
 List<Activity> getActivities(UserId user, Activity.Type type)
          Returns all Activity of the given user ID.
 List<Category> getCategories()
          Gets a list of all Flattr Category.
 List<Flattr> getFlattrs(ThingId thing)
          Gets all Flattr most recently posted for the given thing ID.
 List<Flattr> getFlattrs(ThingId thing, Integer count, Integer page)
          Gets all Flattr most recently posted for the given thing ID.
 List<Flattr> getFlattrs(UserId user)
          Gets all Flattr most recently posted by the given user ID.
 List<Flattr> getFlattrs(UserId user, Integer count, Integer page)
          Gets all Flattr most recently posted by the given user ID.
 List<Language> getLanguages()
          Gets a list of all Flattr Language.
 RateLimit getLastRateLimit()
          Gets the rate limit and remaining rate returned by the last API call.
 Thing getThing(ThingId thingId)
          Gets a Thing for the given ThingId.
 Thing getThingBySubmission(AutoSubmission submission)
          Gets a Thing by its autosubmit URL.
 Thing getThingByUrl(String url)
          Gets a Thing by its registered URL.
 List<Thing> getThings(Collection<ThingId> thingIds)
          Gets a list of Thing by a collection of thing IDs.
 List<Thing> getThings(UserId user)
          Gets a list of Thing most recently submitted by the given user.
 List<Thing> getThings(UserId user, Integer count, Integer page)
          Gets a list of Thing most recently submitted by the given user.
 User getUser(UserId user)
          Gets the User profile of the given user ID.
 SearchResult searchThings(SearchQuery query, Integer count, Integer page)
          Searches for Thing.
 

Method Detail

getThing

Thing getThing(ThingId thingId)
               throws FlattrException
Gets a Thing for the given ThingId.

Parameters:
thingId - ThingId of the Thing to be fetched
Returns:
Thing
Throws:
FlattrException

getThingByUrl

Thing getThingByUrl(String url)
                    throws FlattrException
Gets a Thing by its registered URL.

Uses two rates!

Parameters:
url - Thing's URL
Returns:
Thing of the URL that was found, null if nothing was found
Throws:
FlattrException
Since:
2.0

getThingBySubmission

Thing getThingBySubmission(AutoSubmission submission)
                           throws FlattrException
Gets a Thing by its autosubmit URL.

Uses two rates!

Parameters:
submission - AutoSubmission to check for
Returns:
Thing of the submission if found, null if nothing was found
Throws:
FlattrException
Since:
2.0

getThings

List<Thing> getThings(UserId user)
                      throws FlattrException
Gets a list of Thing most recently submitted by the given user. This list is limited to 30 entries.

Parameters:
user - UserId to find the Things of
Returns:
List of Thing submitted by the user
Throws:
FlattrException
Since:
2.0

getThings

List<Thing> getThings(UserId user,
                      Integer count,
                      Integer page)
                      throws FlattrException
Gets a list of Thing most recently submitted by the given user.

Parameters:
user - UserId to find the Things of
count - Number of entries per page, null defaults to 30 entries
page - Page number (counted from 1), or null to turn off paging
Returns:
List of Thing submitted by the user
Throws:
FlattrException
Since:
2.0

getThings

List<Thing> getThings(Collection<ThingId> thingIds)
                      throws FlattrException
Gets a list of Thing by a collection of thing IDs.

Parameters:
thingIds - Collection of ThingId. The order of Thing returned may not match the order of the provided IDs.
Returns:
List of Thing fetched
Throws:
FlattrException
Since:
2.0

searchThings

SearchResult searchThings(SearchQuery query,
                          Integer count,
                          Integer page)
                          throws FlattrException
Searches for Thing.

Parameters:
query - SearchQuery, or null to search for everything
count - Number of entries per page, null defaults to 30 entries
page - Page number (counted from 1), or null to turn off paging
Returns:
SearchResult
Throws:
FlattrException
Since:
2.0

getUser

User getUser(UserId user)
             throws FlattrException
Gets the User profile of the given user ID.

Parameters:
user - UserId to get a profile for
Returns:
User profile of that user
Throws:
FlattrException

getFlattrs

List<Flattr> getFlattrs(UserId user)
                        throws FlattrException
Gets all Flattr most recently posted by the given user ID. Limited to 30 results.

Parameters:
user - UserId to get the result for
Returns:
List of Flattr posted by the user
Throws:
FlattrException
Since:
2.0

getFlattrs

List<Flattr> getFlattrs(UserId user,
                        Integer count,
                        Integer page)
                        throws FlattrException
Gets all Flattr most recently posted by the given user ID.

Parameters:
user - UserId to get the result for
count - Number of entries per page, null defaults to 30 entries
page - Page number (counted from 1), or null to turn off paging
Returns:
List of Flattr posted by the user
Throws:
FlattrException
Since:
2.0

getFlattrs

List<Flattr> getFlattrs(ThingId thing)
                        throws FlattrException
Gets all Flattr most recently posted for the given thing ID.

Parameters:
thing - ThingId to get the result for
Returns:
List of Flattr posted by the user
Throws:
FlattrException
Since:
2.0

getFlattrs

List<Flattr> getFlattrs(ThingId thing,
                        Integer count,
                        Integer page)
                        throws FlattrException
Gets all Flattr most recently posted for the given thing ID.

Parameters:
thing - ThingId to get the result for
count - Number of entries per page, null defaults to 30 entries
page - Page number (counted from 1), or null to turn off paging
Returns:
List of Flattr posted by the user
Throws:
FlattrException
Since:
2.0

getActivities

List<Activity> getActivities(UserId user,
                             Activity.Type type)
                             throws FlattrException
Returns all Activity of the given user ID.

Parameters:
user - UserId to get the result for
type - activity type. null defaults to Activity.Type#OUTGOING.
Returns:
List of Activity
Throws:
FlattrException
Since:
2.0

getCategories

List<Category> getCategories()
                             throws FlattrException
Gets a list of all Flattr Category.

Note: The result is not cached.

Returns:
List of Flattr Category.
Throws:
FlattrException

getLanguages

List<Language> getLanguages()
                            throws FlattrException
Gets a list of all Flattr Language.

Note: The result is not cached.

Returns:
List of Flattr Language.
Throws:
FlattrException

getLastRateLimit

RateLimit getLastRateLimit()
Gets the rate limit and remaining rate returned by the last API call.

Returns:
Rate limit.
Since:
2.0


Copyright © 2010-2012. All Rights Reserved.