de.geomobile.joined.api.client
Class JOAbstractClient

java.lang.Object
  extended by de.geomobile.joined.api.client.JOAbstractClient
Direct Known Subclasses:
JOClient

public abstract class JOAbstractClient
extends Object

This class is the base class for the JOClient implementation.


Constructor Summary
JOAbstractClient()
           
 
Method Summary
abstract  void acceptFriend(JOUser user, JOFriend friend)
          This method accepts the friend invitation of another user.
abstract  void addFriend(JOUser user, JOFriend friend)
          This method sends a friends invitation to another user.
abstract  void delete(JOUser user)
          This method deletes an existing user at the Joined server.
abstract  void deleteFriend(JOUser user, JOFriend friend)
          This method deletes a friend from the list of friends.
abstract  void deleteMessages(JOUser user)
          This method deletes all messages in the inbox of the logged in user.
abstract  List<JOFriend> getFriends(JOUser user)
          This method get the friends of an user from the Joined server.
abstract  List<JOMessage> getMessages(JOUser user)
          This method returns a list of all available message from the inbox of the logged in user.
abstract  JOUser login(String username, String password)
          This method enables users to login at the Joined server.
abstract  void logout(JOUser user)
          This method enables users to logout at the Joined server.
abstract  JOUser register(String username, String password)
          This method creates a new user at the Joined server.
abstract  List<JOFriend> searchFriends(JOUser user, String nickname)
          This method searches other users at the Joined server.
abstract  void sendMessage(JOUser user, JOFriend friend, String message)
          This method sends a text message to a friend.
abstract  void updatePosition(JOUser user, double latitude, double longitude)
          This method updates the position of the user at the Joined server.
abstract  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
 

Constructor Detail

JOAbstractClient

public JOAbstractClient()
Method Detail

register

public abstract JOUser register(String username,
                                String password)
                         throws JOFriendFinderHTTPException,
                                JOFriendFinderUnexpectedException,
                                JOFriendFinderServerException,
                                JOFriendFinderConflictException
This method creates a new user at the Joined server.

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 abstract void delete(JOUser user)
                     throws JOFriendFinderHTTPException,
                            JOFriendFinderUnexpectedException,
                            JOFriendFinderServerException,
                            JOFriendFinderConflictException
This method deletes an existing user at the Joined server.

Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderConflictException

login

public abstract JOUser login(String username,
                             String password)
                      throws JOFriendFinderHTTPException,
                             JOFriendFinderServerException,
                             JOFriendFinderUnexpectedException,
                             JOFriendFinderLoginException
This method enables users to login at the Joined server.

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

logout

public abstract void logout(JOUser user)
                     throws JOFriendFinderHTTPException,
                            JOFriendFinderServerException,
                            JOFriendFinderUnexpectedException,
                            JOFriendFinderLoginException
This method enables users to logout at the Joined server.

Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

updatePosition

public abstract void updatePosition(JOUser user,
                                    double latitude,
                                    double longitude)
                             throws JOFriendFinderHTTPException,
                                    JOFriendFinderServerException,
                                    JOFriendFinderUnexpectedException,
                                    JOFriendFinderLoginException
This method updates the position of the user at the Joined server.

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 abstract void updateStatus(JOUser user,
                                  boolean active)
                           throws JOFriendFinderHTTPException,
                                  JOFriendFinderServerException,
                                  JOFriendFinderUnexpectedException,
                                  JOFriendFinderLoginException
This method updates the status of the user at the Joined server.

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 abstract List<JOFriend> getFriends(JOUser user)
                                   throws JOFriendFinderHTTPException,
                                          JOFriendFinderServerException,
                                          JOFriendFinderUnexpectedException,
                                          JOFriendFinderLoginException
This method get the friends of an user from the Joined server.

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 abstract List<JOFriend> searchFriends(JOUser user,
                                             String nickname)
                                      throws JOFriendFinderHTTPException,
                                             JOFriendFinderServerException,
                                             JOFriendFinderUnexpectedException,
                                             JOFriendFinderLoginException
This method searches other users at the Joined server.

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 abstract void addFriend(JOUser user,
                               JOFriend friend)
                        throws JOFriendFinderHTTPException,
                               JOFriendFinderServerException,
                               JOFriendFinderUnexpectedException,
                               JOFriendFinderLoginException,
                               JOFriendFinderSourceException
This method sends a friends invitation to another user. If the other user accepts the invitation, the user appears at the list of friends.

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 abstract void acceptFriend(JOUser user,
                                  JOFriend friend)
                           throws JOFriendFinderHTTPException,
                                  JOFriendFinderServerException,
                                  JOFriendFinderUnexpectedException,
                                  JOFriendFinderLoginException
This method accepts the friend invitation of another user.

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 abstract void deleteFriend(JOUser user,
                                  JOFriend friend)
                           throws JOFriendFinderHTTPException,
                                  JOFriendFinderServerException,
                                  JOFriendFinderUnexpectedException,
                                  JOFriendFinderLoginException
This method deletes a friend from the list of friends.

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 abstract void sendMessage(JOUser user,
                                 JOFriend friend,
                                 String message)
                          throws JOFriendFinderHTTPException,
                                 JOFriendFinderServerException,
                                 JOFriendFinderUnexpectedException,
                                 JOFriendFinderLoginException
This method sends a text message to a friend.

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 abstract List<JOMessage> getMessages(JOUser user)
                                     throws JOFriendFinderHTTPException,
                                            JOFriendFinderServerException,
                                            JOFriendFinderUnexpectedException,
                                            JOFriendFinderLoginException
This method returns a list of all available message from the inbox of the logged in user.

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 abstract void deleteMessages(JOUser user)
                             throws JOFriendFinderHTTPException,
                                    JOFriendFinderServerException,
                                    JOFriendFinderUnexpectedException,
                                    JOFriendFinderLoginException
This method deletes all messages in the inbox of the logged in user.

Parameters:
user - The JOUser object that represents the logged in user.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException


Copyright © 2012 GeoMobile GmbH. All Rights Reserved.