com.jakeapp.jake.ics.status
Interface IStatusService

All Known Implementing Classes:
MockMsgAndStatusService

public interface IStatusService


Method Summary
 void addLoginStateListener(ILoginStateListener lsl)
          on login/logout this method should be invoked
 void createAccount(UserId userid, java.lang.String pw)
          Creates a new user account.
 java.lang.String getFirstname(UserId userid)
           
 java.lang.String getLastname(UserId userid)
           
 UserId getUserid()
           
 UserId getUserId(java.lang.String userid)
          Checks if a user id is of the correct format for this network
 java.lang.Boolean isLoggedIn()
          Checks whether the user is logged in.
 java.lang.Boolean isLoggedIn(UserId userid)
          Checks if the userid may be reached (has an online status).
 void login(UserId userid, java.lang.String pw, java.lang.String host, long port)
          Connects and authenticates on the used network service.
 void logout()
          Logs out and disconnects from the used network service.
 void removeLoginStateListener(ILoginStateListener lsl)
           
 

Method Detail

login

void login(UserId userid,
           java.lang.String pw,
           java.lang.String host,
           long port)
           throws NetworkException
Connects and authenticates on the used network service. If the service is already logged in, a logout is done first.

Parameters:
userid - the network user id to be logged in
pw - password
host -
port -
Throws:
NetworkException - if the network connection is down
TimeoutException - if a timeout is received

logout

void logout()
            throws NetworkException
Logs out and disconnects from the used network service. If the service is already logged out, this does nothing.

Throws:
NetworkException - if the network connection is down and the logout couldn't be propagated
TimeoutException - if a timeout occurred

createAccount

void createAccount(UserId userid,
                   java.lang.String pw)
                   throws NetworkException
Creates a new user account.

Parameters:
userid -
pw -
Throws:
NetworkException - if the network connection is down and the logout couldn't be propagated
TimeoutException - if a timeout occurred

isLoggedIn

java.lang.Boolean isLoggedIn()
Checks whether the user is logged in. The implementation has to assert that the user is still connected.

Returns:

isLoggedIn

java.lang.Boolean isLoggedIn(UserId userid)
                             throws NetworkException,
                                    TimeoutException
Checks if the userid may be reached (has an online status). Note: The online status is not requested by this method. You may want to use requestOnlineStatus first and use a OnlineStatusListener! (see IUsersService)

Parameters:
userid - the other client to talk to.
Returns:
Throws:
NetworkException - if the network connection is down
NotLoggedInException - if the user is not logged in
TimeoutException - if a timeout is received
NoSuchUseridException

getFirstname

java.lang.String getFirstname(UserId userid)
                              throws NoSuchUseridException,
                                     OtherUserOfflineException
Parameters:
userid - the network user id in question
Returns:
the firstname belonging to the userid
Throws:
NoSuchUseridException - if there is no such user
{@link - OtherUserOfflineException}
OtherUserOfflineException

getLastname

java.lang.String getLastname(UserId userid)
                             throws NoSuchUseridException,
                                    OtherUserOfflineException
Parameters:
userid - the network user id in question
Returns:
the lastname belonging to the userid
Throws:
NoSuchUseridException - if there is no such user
{@link - OtherUserOfflineException}
OtherUserOfflineException

getUserid

UserId getUserid()
                 throws NotLoggedInException
Returns:
the userid we are logged in with
Throws:
NotLoggedInException - if no user is logged in

getUserId

UserId getUserId(java.lang.String userid)
Checks if a user id is of the correct format for this network

Parameters:
userid - the user id
Returns:
the users id

addLoginStateListener

void addLoginStateListener(ILoginStateListener lsl)
on login/logout this method should be invoked

Parameters:
lsl -

removeLoginStateListener

void removeLoginStateListener(ILoginStateListener lsl)


Copyright © 2011. All Rights Reserved.