net.spy.digg
Class Digg

java.lang.Object
  extended by net.spy.digg.Digg

public class Digg
extends java.lang.Object

Interface to Digg.


Constructor Summary
Digg(java.lang.String k)
          Construct a Digg interface with the given app key.
 
Method Summary
 PagedItems<GalleryPhoto> getAllGalleryPhotos(GalleryPhotoParameters params)
          Get all gallery photos.
 PagedItems<GalleryPhoto> getAllGalleryPhotos(GalleryPhotoParameters params, java.util.Collection<java.lang.Integer> ids)
          Get the gallery photos with the given IDs.
 GalleryPhoto getAllGalleryPhotos(GalleryPhotoParameters params, int id)
          Get the gallery photo with the given ID.
 PagedItems<Comment> getCommentReplies(int storyId, int commentId, EventParameters p)
          Get the replies to the given comment on the given story.
 PagedItems<Comment> getComments(java.util.Collection<java.lang.Integer> stories, EventParameters p)
          Get comments for the given stories.
 PagedItems<Comment> getComments(EventParameters p)
          Get all comment events.
 PagedItems<Comment> getComments(int story, EventParameters p)
          Get comments for the given story.
 PagedItems<Event> getDiggs(EventParameters p)
          Get all digg events.
 java.lang.String getError(int id)
          Get an error string for the given ID.
 java.util.Map<java.lang.Integer,java.lang.String> getErrors()
          Get all known errors.
 PagedItems<User> getFans(java.lang.String u, UserParameters p)
          Get the fans of the given user.
 PagedItems<User> getFriends(java.lang.String u, UserParameters p)
          Get the friends of the given user.
 PagedItems<Story> getFriendsCommentedStories(java.lang.String username, StoryParameters p)
          Stories commented by given user friends.
 PagedItems<Story> getFriendsDuggStories(java.lang.String username, StoryParameters p)
          Stories dugg by given user friends.
 PagedItems<Story> getFriendsPopularStories(java.lang.String username, StoryParameters p)
          Popular stories submitted by given user friends.
 PagedItems<Story> getFriendsSubmissions(java.lang.String username, StoryParameters p)
          Stories submitted by given user friends.
 PagedItems<Story> getFriendsUpcomingStories(java.lang.String username, StoryParameters p)
          Upcoming stories submitted by given user friends.
 PagedItems<Comment> getGalleryCommentReplies(int gid, int cid, EventParameters p)
          Get all comments for the given photo.
 PagedItems<Comment> getGalleryComments(java.util.Collection<java.lang.Integer> ids, EventParameters p)
          Get all comments for all gallery photos.
 PagedItems<Comment> getGalleryComments(EventParameters p)
          Get all comments for gallery photos.
 PagedItems<Comment> getGalleryComments(int id, EventParameters p)
          Get all comments for the given photo.
 Comment getGalleryComments(int gid, int cid, EventParameters p)
          Get a specific comment for the given photo.
 PagedItems<Comment> getPopularComments(EventParameters p)
          Get comments on popular stories.
 PagedItems<Event> getPopularDiggs(EventParameters p)
          Get digg events on popular stories.
 PagedItems<Story> getPopularStories(StoryParameters p)
          Get the popular stories.
 PagedItems<Story> getPopularStories(TopicContainer container, StoryParameters p)
          Get the popular stories in the given container.
 PagedItems<Story> getPopularStories(Topic topic, StoryParameters p)
          Get all of the popular stories within the given topic.
 PagedItems<Story> getStories(java.util.Collection<java.lang.Integer> ids, StoryParameters p)
          Get the specified stories.
 PagedItems<Story> getStories(StoryParameters p)
          Get all stories.
 PagedItems<Story> getStories(TopicContainer container, StoryParameters p)
          Get the stories in the given container.
 PagedItems<Story> getStories(Topic topic, StoryParameters p)
          Get all of the stories within the given topic.
 Story getStory(int id)
          Get the story with the given id.
 Story getStory(java.lang.String cleanUrl)
          Get the story with the given clean URL.
 PagedItems<Event> getStoryDiggs(java.util.Collection<java.lang.Integer> stories, EventParameters p)
          Get digg events for the given story id.
 PagedItems<Event> getStoryDiggs(int storyId, EventParameters p)
          Get digg events for the given story id.
 Topic getTopic(java.lang.String top)
          Get the named topic.
 java.util.Map<java.lang.String,TopicContainer> getTopics()
          Get all topics and topic containers.
 PagedItems<Comment> getUpcomingComments(EventParameters p)
          Get comments on upcoming stories.
 PagedItems<Event> getUpcomingDiggs(EventParameters p)
          Get digg events on popular stories.
 PagedItems<Story> getUpcomingStories(StoryParameters p)
          Get the upcoming stories.
 PagedItems<Story> getUpcomingStories(TopicContainer container, StoryParameters p)
          Get the upcoming stories in the given container.
 PagedItems<Story> getUpcomingStories(Topic topic, StoryParameters p)
          Get all of the upcoming stories within the given topic.
 User getUser(java.lang.String name)
          Get the specific user.
 PagedItems<Comment> getUserComments(java.util.Collection<java.lang.String> users, EventParameters p)
          Get comments for the given user.
 PagedItems<Comment> getUserComments(java.lang.String user, EventParameters p)
          Get comments for the given user.
 PagedItems<Event> getUserDiggs(java.util.Collection<java.lang.String> users, EventParameters p)
          Get the diggs from the given users.
 PagedItems<Event> getUserDiggs(java.lang.String u, EventParameters p)
          Get the diggs from the given user.
 PagedItems<User> getUsers(UserParameters p)
          Get users.
 PagedItems<Story> getUserStories(java.lang.String u, StoryParameters p)
          Get the stories submitted by the given user.
 void setHttpClientFactory(HttpClientFactory to)
          Set the http client factory that will be used to construct HttpClient instances for digg service requests.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Digg

public Digg(java.lang.String k)
Construct a Digg interface with the given app key.

Throws:
java.lang.IllegalArgumentException - if k is not a valid URL
Method Detail

setHttpClientFactory

public void setHttpClientFactory(HttpClientFactory to)
Set the http client factory that will be used to construct HttpClient instances for digg service requests.


getErrors

public java.util.Map<java.lang.Integer,java.lang.String> getErrors()
                                                            throws DiggException
Get all known errors.

Throws:
DiggException

getError

public java.lang.String getError(int id)
                          throws DiggException
Get an error string for the given ID.

Throws:
DiggException

getTopics

public java.util.Map<java.lang.String,TopicContainer> getTopics()
                                                         throws DiggException
Get all topics and topic containers.

Throws:
DiggException

getTopic

public Topic getTopic(java.lang.String top)
               throws DiggException
Get the named topic.

Throws:
DiggException

getUsers

public PagedItems<User> getUsers(UserParameters p)
                          throws DiggException
Get users.

Parameters:
p - an optional UserParameters object indicating additional fetch stuff
Throws:
DiggException

getFriends

public PagedItems<User> getFriends(java.lang.String u,
                                   UserParameters p)
                            throws DiggException
Get the friends of the given user.

Throws:
DiggException

getFans

public PagedItems<User> getFans(java.lang.String u,
                                UserParameters p)
                         throws DiggException
Get the fans of the given user.

Throws:
DiggException

getUser

public User getUser(java.lang.String name)
             throws DiggException
Get the specific user.

Throws:
DiggException

getDiggs

public PagedItems<Event> getDiggs(EventParameters p)
                           throws DiggException
Get all digg events.

Throws:
DiggException

getPopularDiggs

public PagedItems<Event> getPopularDiggs(EventParameters p)
                                  throws DiggException
Get digg events on popular stories.

Throws:
DiggException

getUpcomingDiggs

public PagedItems<Event> getUpcomingDiggs(EventParameters p)
                                   throws DiggException
Get digg events on popular stories.

Throws:
DiggException

getStoryDiggs

public PagedItems<Event> getStoryDiggs(int storyId,
                                       EventParameters p)
                                throws DiggException
Get digg events for the given story id.

Throws:
DiggException

getStoryDiggs

public PagedItems<Event> getStoryDiggs(java.util.Collection<java.lang.Integer> stories,
                                       EventParameters p)
                                throws DiggException
Get digg events for the given story id.

Throws:
DiggException

getUserDiggs

public PagedItems<Event> getUserDiggs(java.lang.String u,
                                      EventParameters p)
                               throws DiggException
Get the diggs from the given user.

Throws:
DiggException

getUserDiggs

public PagedItems<Event> getUserDiggs(java.util.Collection<java.lang.String> users,
                                      EventParameters p)
                               throws DiggException
Get the diggs from the given users.

Throws:
DiggException

getComments

public PagedItems<Comment> getComments(EventParameters p)
                                throws DiggException
Get all comment events.

Throws:
DiggException

getPopularComments

public PagedItems<Comment> getPopularComments(EventParameters p)
                                       throws DiggException
Get comments on popular stories.

Throws:
DiggException

getUpcomingComments

public PagedItems<Comment> getUpcomingComments(EventParameters p)
                                        throws DiggException
Get comments on upcoming stories.

Throws:
DiggException

getComments

public PagedItems<Comment> getComments(java.util.Collection<java.lang.Integer> stories,
                                       EventParameters p)
                                throws DiggException
Get comments for the given stories.

Throws:
DiggException

getComments

public PagedItems<Comment> getComments(int story,
                                       EventParameters p)
                                throws DiggException
Get comments for the given story.

Throws:
DiggException

getUserComments

public PagedItems<Comment> getUserComments(java.lang.String user,
                                           EventParameters p)
                                    throws DiggException
Get comments for the given user.

Throws:
DiggException

getUserComments

public PagedItems<Comment> getUserComments(java.util.Collection<java.lang.String> users,
                                           EventParameters p)
                                    throws DiggException
Get comments for the given user.

Throws:
DiggException

getCommentReplies

public PagedItems<Comment> getCommentReplies(int storyId,
                                             int commentId,
                                             EventParameters p)
                                      throws DiggException
Get the replies to the given comment on the given story.

Throws:
DiggException

getStories

public PagedItems<Story> getStories(StoryParameters p)
                             throws DiggException
Get all stories.

Throws:
DiggException

getPopularStories

public PagedItems<Story> getPopularStories(StoryParameters p)
                                    throws DiggException
Get the popular stories.

Throws:
DiggException

getUpcomingStories

public PagedItems<Story> getUpcomingStories(StoryParameters p)
                                     throws DiggException
Get the upcoming stories.

Throws:
DiggException

getStories

public PagedItems<Story> getStories(TopicContainer container,
                                    StoryParameters p)
                             throws DiggException
Get the stories in the given container.

Throws:
DiggException

getPopularStories

public PagedItems<Story> getPopularStories(TopicContainer container,
                                           StoryParameters p)
                                    throws DiggException
Get the popular stories in the given container.

Throws:
DiggException

getUpcomingStories

public PagedItems<Story> getUpcomingStories(TopicContainer container,
                                            StoryParameters p)
                                     throws DiggException
Get the upcoming stories in the given container.

Throws:
DiggException

getStories

public PagedItems<Story> getStories(Topic topic,
                                    StoryParameters p)
                             throws DiggException
Get all of the stories within the given topic.

Throws:
DiggException

getPopularStories

public PagedItems<Story> getPopularStories(Topic topic,
                                           StoryParameters p)
                                    throws DiggException
Get all of the popular stories within the given topic.

Throws:
DiggException

getUpcomingStories

public PagedItems<Story> getUpcomingStories(Topic topic,
                                            StoryParameters p)
                                     throws DiggException
Get all of the upcoming stories within the given topic.

Throws:
DiggException

getStories

public PagedItems<Story> getStories(java.util.Collection<java.lang.Integer> ids,
                                    StoryParameters p)
                             throws DiggException
Get the specified stories.

Throws:
DiggException

getFriendsSubmissions

public PagedItems<Story> getFriendsSubmissions(java.lang.String username,
                                               StoryParameters p)
                                        throws DiggException
Stories submitted by given user friends.

Parameters:
username - the user
p - story parameters
Returns:
the submitted stories
Throws:
DiggException

getFriendsPopularStories

public PagedItems<Story> getFriendsPopularStories(java.lang.String username,
                                                  StoryParameters p)
                                           throws DiggException
Popular stories submitted by given user friends.

Parameters:
username - the user
p - story parameters
Returns:
the popular stories
Throws:
DiggException

getFriendsUpcomingStories

public PagedItems<Story> getFriendsUpcomingStories(java.lang.String username,
                                                   StoryParameters p)
                                            throws DiggException
Upcoming stories submitted by given user friends.

Parameters:
username - the user
p - story parameters
Returns:
the upcoming stories
Throws:
DiggException

getFriendsDuggStories

public PagedItems<Story> getFriendsDuggStories(java.lang.String username,
                                               StoryParameters p)
                                        throws DiggException
Stories dugg by given user friends.

Parameters:
username - the user
p - story parameters
Returns:
the dugg stories
Throws:
DiggException

getFriendsCommentedStories

public PagedItems<Story> getFriendsCommentedStories(java.lang.String username,
                                                    StoryParameters p)
                                             throws DiggException
Stories commented by given user friends.

Parameters:
username - the user
p - story parameters
Returns:
the commented stories
Throws:
DiggException

getStory

public Story getStory(int id)
               throws DiggException
Get the story with the given id.

Throws:
DiggException

getStory

public Story getStory(java.lang.String cleanUrl)
               throws DiggException
Get the story with the given clean URL.

Throws:
DiggException

getUserStories

public PagedItems<Story> getUserStories(java.lang.String u,
                                        StoryParameters p)
                                 throws DiggException
Get the stories submitted by the given user.

Throws:
DiggException

getAllGalleryPhotos

public PagedItems<GalleryPhoto> getAllGalleryPhotos(GalleryPhotoParameters params)
                                             throws DiggException
Get all gallery photos.

Throws:
DiggException

getAllGalleryPhotos

public PagedItems<GalleryPhoto> getAllGalleryPhotos(GalleryPhotoParameters params,
                                                    java.util.Collection<java.lang.Integer> ids)
                                             throws DiggException
Get the gallery photos with the given IDs.

Throws:
DiggException

getAllGalleryPhotos

public GalleryPhoto getAllGalleryPhotos(GalleryPhotoParameters params,
                                        int id)
                                 throws DiggException
Get the gallery photo with the given ID.

Throws:
DiggException

getGalleryComments

public PagedItems<Comment> getGalleryComments(EventParameters p)
                                       throws DiggException
Get all comments for gallery photos.

Throws:
DiggException

getGalleryComments

public PagedItems<Comment> getGalleryComments(java.util.Collection<java.lang.Integer> ids,
                                              EventParameters p)
                                       throws DiggException
Get all comments for all gallery photos.

Throws:
DiggException

getGalleryComments

public PagedItems<Comment> getGalleryComments(int id,
                                              EventParameters p)
                                       throws DiggException
Get all comments for the given photo.

Throws:
DiggException

getGalleryComments

public Comment getGalleryComments(int gid,
                                  int cid,
                                  EventParameters p)
                           throws DiggException
Get a specific comment for the given photo.

Throws:
DiggException

getGalleryCommentReplies

public PagedItems<Comment> getGalleryCommentReplies(int gid,
                                                    int cid,
                                                    EventParameters p)
                                             throws DiggException
Get all comments for the given photo.

Throws:
DiggException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object