Class GitHubUser
- java.lang.Object
-
- com.mooltiverse.oss.nyx.services.github.GitHubUser
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgeFullName()Returns the full name of this user.Map<String,Object>getAttributes()Returns a read-only map with all the raw properties for the user.static GitHubUsergetAuthenticatedUser(GitHubSession session)Retrieves the authenticated user for the given session.StringgetID()Returns the ID of this user.GitHubgetService()Returns the service associated with this entity.GitHubSessiongetSession()Returns the session associated with this entity.StringgetUserName()Returns the user name of this user.protected static Map<String,Object>toAttributeMap(com.fasterxml.jackson.databind.JsonNode node)Reads all the attributes of the given object and puts them in the resulting map.voidupdate()Updates the user data and attributes.
-
-
-
Method Detail
-
getAttributes
public Map<String,Object> getAttributes()
Returns a read-only map with all the raw properties for the user.- Specified by:
getAttributesin interfaceGitUser- Returns:
- a read-only map with all the raw properties for the user.
-
getID
public String getID()
Returns the ID of this user.
-
getUserName
public String getUserName()
Returns the user name of this user.- Specified by:
getUserNamein interfaceGitUser- Returns:
- the user name of this user.
-
geFullName
public String geFullName()
Returns the full name of this user.- Specified by:
geFullNamein interfaceGitUser- Returns:
- the full name of this user. If not vailable then
nullis returned.
-
update
public void update() throws GitTransportException, GitAuthenticationExceptionUpdates the user data and attributes. This method might be useful when the remote data has changed and you need to update the local status.- Specified by:
updatein interfaceGitUser- Throws:
GitTransportException- if a transport related error occurs while communicating with the serverGitAuthenticationException- if authentication fails
-
getAuthenticatedUser
public static GitHubUser getAuthenticatedUser(GitHubSession session) throws GitTransportException, GitAuthenticationException
Retrieves the authenticated user for the given session.- Parameters:
session- the session to fetch the authenticated user for- Returns:
- the authenticated user for the given session
- Throws:
GitTransportException- if a transport related error occurs while communicating with the serverGitAuthenticationException- if authentication failsNullPointerException- if the given session isnull
-
getService
public GitHub getService()
Returns the service associated with this entity.- Returns:
- the service associated with this entity.
-
getSession
public GitHubSession getSession()
Returns the session associated with this entity.- Returns:
- the session associated with this entity.
-
toAttributeMap
protected static Map<String,Object> toAttributeMap(com.fasterxml.jackson.databind.JsonNode node)
Reads all the attributes of the given object and puts them in the resulting map.- Parameters:
node- the node to read the attributes from- Returns:
- the map with all the attributes from the given node
- Throws:
NullPointerException- if the given node isnull
-
-