public interface FlattrService
All calls will decrement the remaining rate by one, unless noted otherwise.
Modifier and Type | Method and Description |
---|---|
ThingId |
create(Submission thing)
Creates a new Thing.
|
void |
delete(ThingId thingId)
Deletes a Thing.
|
MiniThing |
flattr(AutoSubmission submission)
Flattrs an
AutoSubmission . |
MiniThing |
flattr(String url)
Flattrs a URL.
|
MiniThing |
flattr(ThingId thingId)
Flattrs a Thing.
|
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 . |
RateLimit |
getCurrentRateLimit()
Gets the current rate limit from the server.
|
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 a
RateLimit instance that reflects the rate limit and remaining rate
returned by the last API call. |
List<Activity> |
getMyActivities(Activity.Type type)
Returns all
Activity of the associated user. |
List<Flattr> |
getMyFlattrs()
Returns all
Flattr submitted by the associated user. |
List<Flattr> |
getMyFlattrs(Integer count,
Integer page)
Returns all
Flattr submitted by the associated user. |
User |
getMyself()
Gets the
User profile of the associated user. |
List<Subscription> |
getMySubscriptions()
Returns all
Subscription of the associated user. |
List<Thing> |
getMyThings()
Returns all
Thing submitted by the associated user. |
List<Thing> |
getMyThings(Integer count,
Integer page)
Returns all
Thing submitted by the associated user. |
Subscription |
getSubscription(ThingId thingId)
Returns the
Subscription of the given Thing . |
Thing |
getThing(ThingId 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<? extends 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. |
boolean |
isFullMode()
Is the full mode currently enabled?
|
void |
pauseSubscription(ThingId thingId,
boolean paused)
Pauses or resumes a
Subscription . |
SearchResult |
searchThings(SearchQuery query,
Integer count,
Integer page)
Searches for
Thing . |
void |
setFullMode(boolean full)
Sets the full mode.
|
void |
subscribe(ThingId thingId)
Subscribes a
Thing . |
boolean |
toggleSubscription(ThingId thingId)
Toggles the pause state of the subscription of the given
Thing . |
void |
unsubscribe(ThingId thingId)
Cancels subscription of a
Thing . |
void |
update(Thing thing)
Updates a Thing.
|
Thing getThing(ThingId thingId) throws FlattrException
thingId
- ThingId
of the Thing to be fetchedThing
FlattrException
Thing getThingByUrl(String url) throws FlattrException
Thing
by its registered URL.url
- Thing's URLThing
of the URL that was found, null
if nothing was foundFlattrException
Thing getThingBySubmission(AutoSubmission submission) throws FlattrException
Thing
by its autosubmit URL.
Uses two rates!
submission
- AutoSubmission
to check forThing
of the submission if found, null
if nothing was foundFlattrException
List<Thing> getThings(UserId user) throws FlattrException
Thing
most recently submitted by the given user. This list
is limited to 30 entries.user
- UserId
to find the Things ofThing
submitted by the userFlattrException
List<Thing> getThings(UserId user, Integer count, Integer page) throws FlattrException
Thing
most recently submitted by the given user.user
- UserId
to find the Things ofcount
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingThing
submitted by the userFlattrException
List<Thing> getThings(Collection<? extends ThingId> thingIds) throws FlattrException
Thing
by a collection of thing IDs.thingIds
- Collection of ThingId
. The order of Thing
returned may
not match the order of the provided IDs.Thing
fetchedFlattrException
SearchResult searchThings(SearchQuery query, Integer count, Integer page) throws FlattrException
Thing
.query
- SearchQuery
, or null
to search for everythingcount
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingSearchResult
FlattrException
User getUser(UserId user) throws FlattrException
User
profile of the given user ID.user
- UserId
to get a profile forUser
profile of that userFlattrException
List<Flattr> getFlattrs(UserId user) throws FlattrException
Flattr
most recently posted by the given user ID. Limited to 30
results.user
- UserId
to get the result forFlattr
posted by the userFlattrException
List<Flattr> getFlattrs(UserId user, Integer count, Integer page) throws FlattrException
Flattr
most recently posted by the given user ID.user
- UserId
to get the result forcount
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingFlattr
posted by the userFlattrException
List<Flattr> getFlattrs(ThingId thing) throws FlattrException
Flattr
most recently posted for the given thing ID.thing
- ThingId
to get the result forFlattr
posted by the userFlattrException
List<Flattr> getFlattrs(ThingId thing, Integer count, Integer page) throws FlattrException
Flattr
most recently posted for the given thing ID.thing
- ThingId
to get the result forcount
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingFlattr
posted by the userFlattrException
List<Activity> getActivities(UserId user, Activity.Type type) throws FlattrException
Activity
of the given user ID.user
- UserId
to get the result fortype
- activity type. null
defaults to Activity.Type#OUTGOING
.Activity
FlattrException
List<Category> getCategories() throws FlattrException
Category
.
Note: The result is not cached.
Category
.FlattrException
List<Language> getLanguages() throws FlattrException
Language
.
Note: The result is not cached.
Language
.FlattrException
@RequiredScope(value=THING) ThingId create(Submission thing) throws FlattrException
thing
- Submission
to be submittedThingId
of the Thing
that was createdFlattrException
@RequiredScope(value=THING) void update(Thing thing) throws FlattrException
thing
- Thing
to be modifiedFlattrException
@RequiredScope(value=THING) void delete(ThingId thingId) throws FlattrException
thingId
- ThingId
to deleteFlattrException
@RequiredScope(value=FLATTR) MiniThing flattr(ThingId thingId) throws FlattrException
thingId
- ThingId
to flattrMiniThing
of the flattr-ed thing (containing an updated click
count)FlattrException
@RequiredScope(value=FLATTR) MiniThing flattr(AutoSubmission submission) throws FlattrException
AutoSubmission
. If the submission has not been submitted to
Flattr yet, it will automatically be submitted before.submission
- AutoSubmission
to flattrMiniThing
of the flattr-ed thing (containing an updated click
count)FlattrException
@RequiredScope(value=FLATTR) MiniThing flattr(String url) throws FlattrException
url
- URL to flattrMiniThing
of the flattr-ed thing (containing an updated click
count)FlattrException
@RequiredScope(value=FLATTR) void subscribe(ThingId thingId) throws FlattrException
Thing
.thingId
- ThingId
to subscribeFlattrException
@RequiredScope(value=FLATTR) void unsubscribe(ThingId thingId) throws FlattrException
Thing
.thingId
- ThingId
to unsubscribedFlattrException
@RequiredScope User getMyself() throws FlattrException
User
profile of the associated user.User
profile of oneselfFlattrException
@RequiredScope List<Thing> getMyThings() throws FlattrException
Thing
submitted by the associated user. Limited to 30 entries.Thing
FlattrException
@RequiredScope List<Thing> getMyThings(Integer count, Integer page) throws FlattrException
Thing
submitted by the associated user.count
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingThing
FlattrException
@RequiredScope List<Flattr> getMyFlattrs() throws FlattrException
Flattr
submitted by the associated user. Limited to 30 entries.Flattr
FlattrException
@RequiredScope List<Flattr> getMyFlattrs(Integer count, Integer page) throws FlattrException
Flattr
submitted by the associated user.count
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off pagingFlattr
FlattrException
@RequiredScope List<Activity> getMyActivities(Activity.Type type) throws FlattrException
Activity
of the associated user.type
- activity type. null
defaults to Activity.Type#OUTGOING
.Activity
FlattrException
@RequiredScope(value=FLATTR) List<Subscription> getMySubscriptions() throws FlattrException
Subscription
of the associated user.Subscription
FlattrException
@RequiredScope(value=FLATTR) Subscription getSubscription(ThingId thingId) throws FlattrException
Subscription
of the given Thing
. Only the subscriptions
of the associated user are accessible.
Note: This call is emulated by flattr4j. Depending on the number of subscriptions of the associated user, this call may take some time and cause increased network traffic. It may also increment the rate counter by more than 1.
thingId
- ThingId
to get the subscription ofSubscription
of this thing, or null
if there is no such
subscriptionFlattrException
@RequiredScope(value=FLATTR) boolean toggleSubscription(ThingId thingId) throws FlattrException
Thing
.thingId
- ThingId
of the thing to toggle the pause state oftrue
if the subscription is now paused, false
if the
subscription was resumed.FlattrException
@RequiredScope(value=FLATTR) void pauseSubscription(ThingId thingId, boolean paused) throws FlattrException
Subscription
. If the subscription is already in the
desired state, nothing will happen.
Note: There is currently no way to explicitely set the pause state of a subscription via Flattr API. flattr4j emulates this call by toggling the pause state to get the current state, and if necessary, toggling it again to set the subscription to the desired state (which means that the rate counter is incremented by 2). This call is not atomic. If the second toggle call should fail, it will leave the subscription in the opposite state.
thingId
- ThingId
of the thing to set the pause statepaused
- true
: pause subscription, false
: resume subscriptionFlattrException
void setFullMode(boolean full)
false
.full
- true
: use full requests, false
: use standard requestsboolean isFullMode()
true
: full requests, false
: standard requestsRateLimit getCurrentRateLimit() throws FlattrException
Unlike getLastRateLimit()
, this call actively queries the current rate
limits from the server.
getLastRateLimit()
is untouched by this call.
FlattrException
Copyright © 2010–2017. All rights reserved.