de.geomobile.joined.api.service
Class JOWebService

java.lang.Object
  extended by de.geomobile.joined.api.service.JOWebService

public class JOWebService
extends Object


Constructor Summary
JOWebService()
           
 
Method Summary
 String acceptFriend(String userId, String secureToken, String friendId)
          Accept a friend invitation.
 void activateUser(String userId, String secureToken, boolean active)
          Activate or deactivate user
 void addFriend(String userId, String secureToken, String friendId)
          Add a friend.
static JOWebService createJoinedService(String joinedServerUrl, String joinedApiKey)
           
 boolean deleteFriend(String userId, String secureToken, String friendId)
          Delete a friend.
 void deleteMessages(String userId, String secureToken)
          Deletes all Messages from Server of the User as recipient in the DB.
 void deleteUser(String userId, String secureToken)
          Delete current user
 String ffLogin(String username, String password)
           
 String ffRegister(String name, String password)
          Register for FriendFinder users.
 String getFriends(String userId, String secureToken)
           
 String getJoinedApiKey()
           
 String getJoinedServerUrl()
           
 String getMessages(String userId, String secureToken)
          Gets all unread Messages of the User.
 void logoutUser(String userId, String secureToken)
          User logout.
 String searchFriends(String userId, String secureToken, String nickname)
          Search for users by nickname
 String sendMessage(String userId, String secureToken, String friendsId, String msg)
          Send a text message to friend
 void setJoinedApiKey(String joinedApiKey)
           
 void setJoinedServerUrl(String joinedServerUrl)
           
 void updateUser(String userId, String secureToken, double latitude, double longitude)
          Update users current location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JOWebService

public JOWebService()
Method Detail

createJoinedService

public static JOWebService createJoinedService(String joinedServerUrl,
                                               String joinedApiKey)
Parameters:
joinedServerUrl -
joinedSecretSalt -
Returns:

getJoinedServerUrl

public String getJoinedServerUrl()
Returns:

setJoinedServerUrl

public void setJoinedServerUrl(String joinedServerUrl)
Parameters:
joinedServerUrl -

getJoinedApiKey

public String getJoinedApiKey()
Returns:

setJoinedApiKey

public void setJoinedApiKey(String joinedApiKey)
Parameters:
joinedSecretSalt -

ffRegister

public String ffRegister(String name,
                         String password)
                  throws JOFriendFinderHTTPException,
                         JOFriendFinderUnexpectedException,
                         JOFriendFinderServerException,
                         JOFriendFinderConflictException
Register for FriendFinder users. The nickname and password are mandatory.

Parameters:
name - The users nickname.
password - The users password.
profilImage - The users profile image exists.
Returns:
the generated attributes userid and secureToken as json object.
Throws:
JOFriendFinderHTTPException - when another exception runs
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderConflictException - when nickname already exists

ffLogin

public String ffLogin(String username,
                      String password)
               throws JOFriendFinderHTTPException,
                      JOFriendFinderServerException,
                      JOFriendFinderUnexpectedException,
                      JOFriendFinderLoginException
Parameters:
name -
username -
Returns:
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

getFriends

public String getFriends(String userId,
                         String secureToken)
                  throws JOFriendFinderHTTPException,
                         JOFriendFinderServerException,
                         JOFriendFinderUnexpectedException,
                         JOFriendFinderLoginException
Parameters:
userId -
secureToken -
Returns:
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderLoginException

addFriend

public void addFriend(String userId,
                      String secureToken,
                      String friendId)
               throws JOFriendFinderHTTPException,
                      JOFriendFinderServerException,
                      JOFriendFinderUnexpectedException,
                      JOFriendFinderSourceException
Add a friend. The id, secureToken of User and friend's are mandatory.

Parameters:
userId - The users id.
secureToken - The users secureToken.
friendId - The friends id to add.
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderSourceException

acceptFriend

public String acceptFriend(String userId,
                           String secureToken,
                           String friendId)
                    throws JOFriendFinderHTTPException,
                           JOFriendFinderUnexpectedException,
                           JOFriendFinderServerException
Accept a friend invitation. The id, secureToken of User and friend's are mandatory.

Parameters:
userId - The users id.
secureToken - The users secureToken.
friendId - The friends id to add.
Throws:
JOFriendFinderHTTPException
JOFriendFinderUnexpectedException
JOFriendFinderServerException

deleteFriend

public boolean deleteFriend(String userId,
                            String secureToken,
                            String friendId)
                     throws JOFriendFinderHTTPException,
                            JOFriendFinderUnexpectedException,
                            JOFriendFinderServerException
Delete a friend. The id, secureToken of User and friend's are mandatory.

Parameters:
userId - The users id.
secureToken - The users secureToken.
friendId - The friend's id to delete.
Throws:
JOFriendFinderHTTPException
JOFriendFinderUnexpectedException
JOFriendFinderServerException

searchFriends

public String searchFriends(String userId,
                            String secureToken,
                            String nickname)
                     throws JOFriendFinderHTTPException,
                            JOFriendFinderServerException,
                            JOFriendFinderUnexpectedException
Search for users by nickname

Parameters:
userId - The users id.
secureToken - The users secureToken.
nickname - The friend's nickname to search.
Returns:
a JSON string
Throws:
JOFriendFinderHTTPException
JOFriendFinderServerException
JOFriendFinderUnexpectedException

updateUser

public void updateUser(String userId,
                       String secureToken,
                       double latitude,
                       double longitude)
                throws JOFriendFinderUnexpectedException,
                       JOFriendFinderServerException,
                       JOFriendFinderHTTPException
Update users current location

Parameters:
userId - The users id.
secureToken - The users secureToken.
latitude -
longitude -
Throws:
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderHTTPException

activateUser

public void activateUser(String userId,
                         String secureToken,
                         boolean active)
                  throws JOFriendFinderUnexpectedException,
                         JOFriendFinderServerException,
                         JOFriendFinderHTTPException
Activate or deactivate user

Parameters:
userId - The users id.
secureToken - The users secureToken.
active - active or deactive
Throws:
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderHTTPException

logoutUser

public void logoutUser(String userId,
                       String secureToken)
                throws JOFriendFinderUnexpectedException,
                       JOFriendFinderServerException,
                       JOFriendFinderHTTPException
User logout.

Parameters:
userId - The users id.
secureToken - The users secureToken.
Throws:
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderHTTPException

deleteUser

public void deleteUser(String userId,
                       String secureToken)
                throws JOFriendFinderUnexpectedException,
                       JOFriendFinderServerException,
                       JOFriendFinderHTTPException
Delete current user

Parameters:
userId - The users id.
secureToken - The users secureToken.
Throws:
JOFriendFinderUnexpectedException
JOFriendFinderServerException
JOFriendFinderHTTPException

sendMessage

public String sendMessage(String userId,
                          String secureToken,
                          String friendsId,
                          String msg)
                   throws JOFriendFinderServerException,
                          JOFriendFinderUnexpectedException,
                          JOFriendFinderHTTPException
Send a text message to friend

Parameters:
userId - The users id.
secureToken - The users secureToken.
friendsId - The friends id to send this message
msg - The text message
Returns:
The HashMap String with id and time
Throws:
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderHTTPException

getMessages

public String getMessages(String userId,
                          String secureToken)
                   throws JOFriendFinderServerException,
                          JOFriendFinderUnexpectedException,
                          JOFriendFinderHTTPException
Gets all unread Messages of the User.

Parameters:
userId - The users id.
secureToken - The users secureToken.
Returns:
The Json String with Messages info.
Throws:
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderHTTPException

deleteMessages

public void deleteMessages(String userId,
                           String secureToken)
                    throws JOFriendFinderServerException,
                           JOFriendFinderUnexpectedException,
                           JOFriendFinderHTTPException
Deletes all Messages from Server of the User as recipient in the DB.

Parameters:
userId - The users id.
secureToken - The users secureToken.
Throws:
JOFriendFinderServerException
JOFriendFinderUnexpectedException
JOFriendFinderHTTPException


Copyright © 2012 GeoMobile GmbH. All Rights Reserved.