|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shredzone.flattr4j.impl.FlattrServiceImpl
public class FlattrServiceImpl
Default implementation of FlattrService
.
Constructor Summary | |
---|---|
FlattrServiceImpl(Connector connector)
|
Method Summary | |
---|---|
void |
click(AutoSubmission submission)
Flattrs an AutoSubmission . |
void |
click(String url)
Flattrs a URL. |
void |
click(ThingId thingId)
Flattrs a Thing. |
ThingId |
create(Submission thing)
Creates a new Thing. |
void |
delete(ThingId thingId)
Deletes 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 . |
protected Connector |
getConnector()
Returns the Connector used for calling the API. |
List<Flattr> |
getFlattrs(ThingId thingId)
Gets all Flattr most recently posted for the given thing ID. |
List<Flattr> |
getFlattrs(ThingId thingId,
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 userId,
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. |
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<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. |
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 . |
void |
update(Thing thing)
Updates a Thing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FlattrServiceImpl(Connector connector)
Method Detail |
---|
protected Connector getConnector()
Connector
used for calling the API.
Connector
public ThingId create(Submission thing) throws FlattrException
FlattrService
create
in interface FlattrService
thing
- Submission
to be submitted
ThingId
of the Thing
that was created
FlattrException
public void update(Thing thing) throws FlattrException
FlattrService
update
in interface FlattrService
thing
- Thing
to be modified
FlattrException
public void delete(ThingId thingId) throws FlattrException
FlattrService
delete
in interface FlattrService
thingId
- ThingId
to delete
FlattrException
public void click(AutoSubmission submission) throws FlattrException
FlattrService
AutoSubmission
. If the submission has not been submitted to
Flattr yet, it will automatically be submitted before.
click
in interface FlattrService
submission
- AutoSubmission
to flattr
FlattrException
public void click(String url) throws FlattrException
FlattrService
click
in interface FlattrService
url
- URL to flattr
FlattrException
public void click(ThingId thingId) throws FlattrException
FlattrService
click
in interface FlattrService
thingId
- ThingId
to flattr
FlattrException
public User getMyself() throws FlattrException
FlattrService
User
profile of the associated user.
getMyself
in interface FlattrService
User
profile of oneself
FlattrException
public List<Thing> getMyThings() throws FlattrException
FlattrService
Thing
submitted by the associated user. Limited to 30 entries.
getMyThings
in interface FlattrService
Thing
FlattrException
public List<Thing> getMyThings(Integer count, Integer page) throws FlattrException
FlattrService
Thing
submitted by the associated user.
getMyThings
in interface FlattrService
count
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off paging
Thing
FlattrException
public List<Flattr> getMyFlattrs() throws FlattrException
FlattrService
Flattr
submitted by the associated user. Limited to 30 entries.
getMyFlattrs
in interface FlattrService
Flattr
FlattrException
public List<Flattr> getMyFlattrs(Integer count, Integer page) throws FlattrException
FlattrService
Flattr
submitted by the associated user.
getMyFlattrs
in interface FlattrService
count
- Number of entries per page, null
defaults to 30 entriespage
- Page number (counted from 1), or null
to turn off paging
Flattr
FlattrException
public Thing getThing(ThingId thingId) throws FlattrException
OpenService
Thing
for the given ThingId
.
getThing
in interface OpenService
thingId
- ThingId
of the Thing to be fetched
Thing
FlattrException
public Thing getThingByUrl(String url) throws FlattrException
OpenService
Thing
by its registered URL.
Uses two rates!
getThingByUrl
in interface OpenService
url
- Thing's URL
Thing
of the URL that was found, null
if nothing was found
FlattrException
public Thing getThingBySubmission(AutoSubmission submission) throws FlattrException
OpenService
Thing
by its autosubmit URL.
Uses two rates!
getThingBySubmission
in interface OpenService
submission
- AutoSubmission
to check for
Thing
of the submission if found, null
if nothing was found
FlattrException
public List<Thing> getThings(UserId user) throws FlattrException
OpenService
Thing
most recently submitted by the given user. This list
is limited to 30 entries.
getThings
in interface OpenService
user
- UserId
to find the Things of
Thing
submitted by the user
FlattrException
public List<Thing> getThings(UserId user, Integer count, Integer page) throws FlattrException
OpenService
Thing
most recently submitted by the given user.
getThings
in interface OpenService
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 paging
Thing
submitted by the user
FlattrException
public List<Thing> getThings(Collection<ThingId> thingIds) throws FlattrException
OpenService
Thing
by a collection of thing IDs.
getThings
in interface OpenService
thingIds
- Collection of ThingId
. The order of Thing
returned may
not match the order of the provided IDs.
Thing
fetched
FlattrException
public SearchResult searchThings(SearchQuery query, Integer count, Integer page) throws FlattrException
OpenService
Thing
.
searchThings
in interface OpenService
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 paging
SearchResult
FlattrException
public User getUser(UserId user) throws FlattrException
OpenService
User
profile of the given user ID.
getUser
in interface OpenService
user
- UserId
to get a profile for
User
profile of that user
FlattrException
public List<Flattr> getFlattrs(UserId user) throws FlattrException
OpenService
Flattr
most recently posted by the given user ID. Limited to 30
results.
getFlattrs
in interface OpenService
user
- UserId
to get the result for
Flattr
posted by the user
FlattrException
public List<Flattr> getFlattrs(UserId userId, Integer count, Integer page) throws FlattrException
OpenService
Flattr
most recently posted by the given user ID.
getFlattrs
in interface OpenService
userId
- 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 paging
Flattr
posted by the user
FlattrException
public List<Flattr> getFlattrs(ThingId thingId) throws FlattrException
OpenService
Flattr
most recently posted for the given thing ID.
getFlattrs
in interface OpenService
thingId
- ThingId
to get the result for
Flattr
posted by the user
FlattrException
public List<Flattr> getFlattrs(ThingId thingId, Integer count, Integer page) throws FlattrException
OpenService
Flattr
most recently posted for the given thing ID.
getFlattrs
in interface OpenService
thingId
- 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 paging
Flattr
posted by the user
FlattrException
public List<Activity> getActivities(UserId user, Activity.Type type) throws FlattrException
OpenService
Activity
of the given user ID.
getActivities
in interface OpenService
user
- UserId
to get the result fortype
- activity type. null
defaults to Activity.Type#OUTGOING
.
Activity
FlattrException
public List<Activity> getMyActivities(Activity.Type type) throws FlattrException
FlattrService
Activity
of the associated user.
getMyActivities
in interface FlattrService
type
- activity type. null
defaults to Activity.Type#OUTGOING
.
Activity
FlattrException
public List<Category> getCategories() throws FlattrException
OpenService
Category
.
Note: The result is not cached.
getCategories
in interface OpenService
Category
.
FlattrException
public List<Language> getLanguages() throws FlattrException
OpenService
Language
.
Note: The result is not cached.
getLanguages
in interface OpenService
Language
.
FlattrException
public RateLimit getLastRateLimit()
OpenService
getLastRateLimit
in interface OpenService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |