de.geomobile.joined.api.client
Class JOClient

java.lang.Object
  extended by de.geomobile.joined.api.client.JOAbstractClient
      extended by de.geomobile.joined.api.client.JOClient

public class JOClient
extends JOAbstractClient

This class contains various methods for accessing the Joined server.


Method Summary
 void acceptFriend(JOUser user, JOFriend friend)
          This method accepts the friend invitation of another user.
 void addFriend(JOUser user, JOFriend friend)
          This method sends a friends invitation to another user.
static JOClient createJoinedClient(String pJoinedServerUrl, String joinedApiKey)
          This method enables users to create an easy to use client for the Joined server.
 void delete(JOUser user)
          This method deletes an existing user at the Joined server.
 void deleteFriend(JOUser user, JOFriend friend)
          This method deletes a friend from the list of friends.
 void deleteMessages(JOUser user)
          This method deletes all messages in the inbox of the logged in user.
 List<JOFriend> getFriends(JOUser user)
          This method get the friends of an user from the Joined server.
 List<JOMessage> getMessages(JOUser user)
          This method returns a list of all available message from the inbox of the logged in user.
 JOUser login(String username, String password)
          This method enables users to login at the Joined server.
 void logout(JOUser user)
          This method enables users to logout at the Joined server.
 JOUser register(String username, String password)
          This method creates a new user at the Joined server.
 List<JOFriend> searchFriends(JOUser user, String nickname)
          This method searches other users at the Joined server.
 void sendMessage(JOUser user, JOFriend friend, String message)
          This method sends a text message to a friend.
 void updatePosition(JOUser user, double latitude, double longitude)
          This method updates the position of the user at the Joined server.
 void updateStatus(JOUser user, boolean active)
          This method updates the status of the user at the Joined server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createJoinedClient

public static JOClient createJoinedClient(String pJoinedServerUrl,
                                          String joinedApiKey)
This method enables users to create an easy to use client for the Joined server.

Parameters:
pJoinedServerUrl - The URL of the Joined server.
joinedSecretSalt - The secret salt for accessing the Joined server.
Returns:

register

public JOUser register(String username,
                       String password)
                throws JOFriendFinderHTTPException,
                       JOFriendFinderUnexpectedException,
                       JOFriendFinderServerException,
                       JOFriendFinderConflictException
Description copied from class: JOAbstractClient
This method creates a new user at the Joined server.

Specified by:
register in class JOAbstractClient
Parameters:
username - The name for the new user.
password - The password for the new user.
Returns:
The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderConflictException

delete

public void delete(JOUser user)
            throws JOFriendFinderHTTPException,
                   JOFriendFinderUnexpectedException,
                   JOFriendFinderServerException,
                   JOFriendFinderConflictException
Description copied from class: JOAbstractClient
This method deletes an existing user at the Joined server.

Specified by:
delete in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderConflictException

logout

public void logout(JOUser user)
            throws JOFriendFinderHTTPException,
                   JOFriendFinderServerException,
                   JOFriendFinderUnexpectedException,
                   JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method enables users to logout at the Joined server.

Specified by:
logout in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

login

public JOUser login(String username,
                    String password)
             throws JOFriendFinderHTTPException,
                    JOFriendFinderServerException,
                    JOFriendFinderUnexpectedException,
                    JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method enables users to login at the Joined server.

Specified by:
login in class JOAbstractClient
Parameters:
username - The name of the user.
password - The password of the user.
Returns:
The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

updatePosition

public void updatePosition(JOUser user,
                           double latitude,
                           double longitude)
                    throws JOFriendFinderHTTPException,
                           JOFriendFinderServerException,
                           JOFriendFinderUnexpectedException,
                           JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method updates the position of the user at the Joined server.

Specified by:
updatePosition in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
latitude - The position of the user (latitude coordinate).
longitude - The position of the user (longitude coordinate).
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

updateStatus

public void updateStatus(JOUser user,
                         boolean active)
                  throws JOFriendFinderHTTPException,
                         JOFriendFinderServerException,
                         JOFriendFinderUnexpectedException,
                         JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method updates the status of the user at the Joined server.

Specified by:
updateStatus in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
active - The status of the user (true for active and visible, false for inactive and invisible).
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

getFriends

public List<JOFriend> getFriends(JOUser user)
                          throws JOFriendFinderHTTPException,
                                 JOFriendFinderServerException,
                                 JOFriendFinderUnexpectedException,
                                 JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method get the friends of an user from the Joined server.

Specified by:
getFriends in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
Returns:
A list of JOFriend objects, each representing one friend of the user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

searchFriends

public List<JOFriend> searchFriends(JOUser user,
                                    String nickname)
                             throws JOFriendFinderHTTPException,
                                    JOFriendFinderServerException,
                                    JOFriendFinderUnexpectedException,
                                    JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method searches other users at the Joined server.

Specified by:
searchFriends in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
nickname - The nickname other users.
Returns:
A list of JOFriend objects.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

addFriend

public void addFriend(JOUser user,
                      JOFriend friend)
               throws JOFriendFinderHTTPException,
                      JOFriendFinderServerException,
                      JOFriendFinderUnexpectedException,
                      JOFriendFinderLoginException,
                      JOFriendFinderSourceException
Description copied from class: JOAbstractClient
This method sends a friends invitation to another user. If the other user accepts the invitation, the user appears at the list of friends.

Specified by:
addFriend in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
friend - The JOFriend object that represents the other user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException
JOFriendFinderSourceException

acceptFriend

public void acceptFriend(JOUser user,
                         JOFriend friend)
                  throws JOFriendFinderHTTPException,
                         JOFriendFinderServerException,
                         JOFriendFinderUnexpectedException,
                         JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method accepts the friend invitation of another user.

Specified by:
acceptFriend in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
friend - The JOFriend object that represents the other user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

deleteFriend

public void deleteFriend(JOUser user,
                         JOFriend friend)
                  throws JOFriendFinderHTTPException,
                         JOFriendFinderServerException,
                         JOFriendFinderUnexpectedException,
                         JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method deletes a friend from the list of friends.

Specified by:
deleteFriend in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
friend - The JOUser object that represents the other user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

sendMessage

public void sendMessage(JOUser user,
                        JOFriend friend,
                        String message)
                 throws JOFriendFinderHTTPException,
                        JOFriendFinderServerException,
                        JOFriendFinderUnexpectedException,
                        JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method sends a text message to a friend.

Specified by:
sendMessage in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
friend - The JOFriend object that represents the friend.
message - The text message.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

getMessages

public List<JOMessage> getMessages(JOUser user)
                            throws JOFriendFinderHTTPException,
                                   JOFriendFinderServerException,
                                   JOFriendFinderUnexpectedException,
                                   JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method returns a list of all available message from the inbox of the logged in user.

Specified by:
getMessages in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
Returns:
A list of JOMessage objects, each representing a message from the inbox of the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

deleteMessages

public void deleteMessages(JOUser user)
                    throws JOFriendFinderHTTPException,
                           JOFriendFinderServerException,
                           JOFriendFinderUnexpectedException,
                           JOFriendFinderLoginException
Description copied from class: JOAbstractClient
This method deletes all messages in the inbox of the logged in user.

Specified by:
deleteMessages in class JOAbstractClient
Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException


Copyright © 2012 GeoMobile GmbH. All Rights Reserved.