org.eclipse.egit.github.core.service
Class UserService

java.lang.Object
  extended by org.eclipse.egit.github.core.service.GitHubService
      extended by org.eclipse.egit.github.core.service.UserService

public class UserService
extends GitHubService

User service class.

See Also:
GitHub users API documentation, GitHub followers API documentation, GitHub user email API documentation, GitHub user keys API documentation

Field Summary
 
Fields inherited from class org.eclipse.egit.github.core.service.GitHubService
ACCEPT_FULL, ACCEPT_HTML, ACCEPT_TEXT, client
 
Constructor Summary
UserService()
          Create user service
UserService(GitHubClient client)
          Create user service
 
Method Summary
 void addEmail(String... emails)
          Add one or more e-mail addresses to the currently authenticated user's account
protected  PagedRequest<User> createFollowersRequest(int start, int size, String user)
          Create follower request
protected  PagedRequest<User> createFollowingRequest(int start, int size, String user)
          Create following request
 Key createKey(Key key)
          Create key for currently authenticated user
 void deleteKey(int id)
          Delete key with given id
 Key editKey(Key key)
          Edit key for currently authenticated user
 User editUser(User user)
          Edit given user
 void follow(String user)
          Follow the given user
 List<String> getEmails()
          Get all e-mail addresses for the currently authenticated user
 List<User> getFollowers()
          Get all followers of the currently authenticated user
 List<User> getFollowers(String user)
          Get all followers of the given user
 List<User> getFollowing()
          Get all users being followed by the currently authenticated user
 List<User> getFollowing(String user)
          Get all users being followed by the given user
 Key getKey(int id)
          Get key with given id
 List<Key> getKeys()
          Get all public keys for currently authenticated user
 User getUser()
          Get currently authenticated user
 User getUser(String login)
          Get user with given login name
 boolean isFollowing(String user)
          Check if the currently authenticated user is following the given user
 PageIterator<User> pageFollowers()
          Page followers of the currently authenticated user
 PageIterator<User> pageFollowers(int size)
          Page followers of the currently authenticated user
 PageIterator<User> pageFollowers(int start, int size)
          Page followers of the currently authenticated user
 PageIterator<User> pageFollowers(String user)
          Page followers of the given user
 PageIterator<User> pageFollowers(String user, int size)
          Page followers of the given user
 PageIterator<User> pageFollowers(String user, int start, int size)
          Page followers of the given user
 PageIterator<User> pageFollowing()
          Page users being followed by the currently authenticated user
 PageIterator<User> pageFollowing(int size)
          Page users being followed by the currently authenticated user
 PageIterator<User> pageFollowing(int start, int size)
          Page users being followed by the currently authenticated user
 PageIterator<User> pageFollowing(String user)
          Page users being followed by the given user
 PageIterator<User> pageFollowing(String user, int size)
          Page users being followed by the given user
 PageIterator<User> pageFollowing(String user, int start, int size)
          Page users being followed by the given user
 void removeEmail(String... emails)
          Remove one or more e-mail addresses from the currently authenticated user's account
 void unfollow(String user)
          Unfollow the given user
 
Methods inherited from class org.eclipse.egit.github.core.service.GitHubService
check, createPagedRequest, createPagedRequest, createPageIterator, createRequest, getAll, getAll, getClient, getId, verifyRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserService

public UserService()
Create user service


UserService

public UserService(GitHubClient client)
Create user service

Parameters:
client -
Method Detail

getUser

public User getUser(String login)
             throws IOException
Get user with given login name

Parameters:
login -
Returns:
user
Throws:
IOException

getUser

public User getUser()
             throws IOException
Get currently authenticated user

Returns:
user
Throws:
IOException

editUser

public User editUser(User user)
              throws IOException
Edit given user

Parameters:
user -
Returns:
edited user
Throws:
IOException

createFollowersRequest

protected PagedRequest<User> createFollowersRequest(int start,
                                                    int size,
                                                    String user)
Create follower request

Parameters:
start -
size -
user -
Returns:
request

createFollowingRequest

protected PagedRequest<User> createFollowingRequest(int start,
                                                    int size,
                                                    String user)
Create following request

Parameters:
start -
size -
user -
Returns:
request

getFollowers

public List<User> getFollowers()
                        throws IOException
Get all followers of the currently authenticated user

Returns:
list of followers
Throws:
IOException

pageFollowers

public PageIterator<User> pageFollowers()
Page followers of the currently authenticated user

Returns:
page iterator

pageFollowers

public PageIterator<User> pageFollowers(int size)
Page followers of the currently authenticated user

Parameters:
size -
Returns:
page iterator

pageFollowers

public PageIterator<User> pageFollowers(int start,
                                        int size)
Page followers of the currently authenticated user

Parameters:
start -
size -
Returns:
page iterator

getFollowers

public List<User> getFollowers(String user)
                        throws IOException
Get all followers of the given user

Parameters:
user -
Returns:
list of followers
Throws:
IOException

pageFollowers

public PageIterator<User> pageFollowers(String user)
Page followers of the given user

Parameters:
user -
Returns:
page iterator

pageFollowers

public PageIterator<User> pageFollowers(String user,
                                        int size)
Page followers of the given user

Parameters:
size -
user -
Returns:
page iterator

pageFollowers

public PageIterator<User> pageFollowers(String user,
                                        int start,
                                        int size)
Page followers of the given user

Parameters:
start -
size -
user -
Returns:
page iterator

getFollowing

public List<User> getFollowing()
                        throws IOException
Get all users being followed by the currently authenticated user

Returns:
list of users being followed
Throws:
IOException

pageFollowing

public PageIterator<User> pageFollowing()
Page users being followed by the currently authenticated user

Returns:
page iterator

pageFollowing

public PageIterator<User> pageFollowing(int size)
Page users being followed by the currently authenticated user

Parameters:
size -
Returns:
page iterator

pageFollowing

public PageIterator<User> pageFollowing(int start,
                                        int size)
Page users being followed by the currently authenticated user

Parameters:
start -
size -
Returns:
page iterator

getFollowing

public List<User> getFollowing(String user)
                        throws IOException
Get all users being followed by the given user

Parameters:
user -
Returns:
list of users being followed
Throws:
IOException

pageFollowing

public PageIterator<User> pageFollowing(String user)
Page users being followed by the given user

Parameters:
user -
Returns:
page iterator

pageFollowing

public PageIterator<User> pageFollowing(String user,
                                        int size)
Page users being followed by the given user

Parameters:
user -
size -
Returns:
page iterator

pageFollowing

public PageIterator<User> pageFollowing(String user,
                                        int start,
                                        int size)
Page users being followed by the given user

Parameters:
user -
start -
size -
Returns:
page iterator

isFollowing

public boolean isFollowing(String user)
                    throws IOException
Check if the currently authenticated user is following the given user

Parameters:
user -
Returns:
true if following, false if not following
Throws:
IOException

follow

public void follow(String user)
            throws IOException
Follow the given user

Parameters:
user -
Throws:
IOException

unfollow

public void unfollow(String user)
              throws IOException
Unfollow the given user

Parameters:
user -
Throws:
IOException

getEmails

public List<String> getEmails()
                       throws IOException
Get all e-mail addresses for the currently authenticated user

Returns:
list of e-mail address
Throws:
IOException

addEmail

public void addEmail(String... emails)
              throws IOException
Add one or more e-mail addresses to the currently authenticated user's account

Parameters:
emails -
Throws:
IOException

removeEmail

public void removeEmail(String... emails)
                 throws IOException
Remove one or more e-mail addresses from the currently authenticated user's account

Parameters:
emails -
Throws:
IOException

getKeys

public List<Key> getKeys()
                  throws IOException
Get all public keys for currently authenticated user

Returns:
non-null list of public keys
Throws:
IOException

getKey

public Key getKey(int id)
           throws IOException
Get key with given id

Parameters:
id -
Returns:
key
Throws:
IOException

createKey

public Key createKey(Key key)
              throws IOException
Create key for currently authenticated user

Parameters:
key -
Returns:
created key
Throws:
IOException

editKey

public Key editKey(Key key)
            throws IOException
Edit key for currently authenticated user

Parameters:
key -
Returns:
edited key
Throws:
IOException

deleteKey

public void deleteKey(int id)
               throws IOException
Delete key with given id

Parameters:
id -
Throws:
IOException


Copyright © 2012. All Rights Reserved.