pl.mn.communicator
Interface IPresenceService

All Known Implementing Classes:
DefaultPresenceService

public interface IPresenceService

This service should be used it there is a need to set a new status.

Also through this service the client can add user to be monitored of changing it's status. It can also remove user from being monitored and the client will no longer be notified if user changes it's status.

In addition, by using this interface the client can block the user and in this case it will no longer receive any kind of notification from it including new messages.

Created on 2004-11-27

Version:
$Id: IPresenceService.java,v 1.1 2005/11/05 23:34:52 winnetou25 Exp $
Author:
Mateusz Szczap

Method Summary
 void addMonitoredUser(IUser user)
          Adds the user to be monitored.
 void addUserListener(UserListener userListener)
          Adds UserListener to the list of listeners that will be notified of status related events.
 void changeMonitoredUserStatus(IUser user)
          Changes status of the currently monitored user.
 java.util.Collection getMonitoredUsers()
          Returns collections of the users that are currently being monitored.
 ILocalStatus getStatus()
          Returns the actual status of the user that is logged in.
 void removeMonitoredUser(IUser user)
          Remove the user that was previously being monitored.
 void removeUserListener(UserListener userListener)
          Removes UserListener from the list of listeners that will be notified of status related events.
 void setStatus(ILocalStatus localStatus)
          Invocation of this method tries to set a new status of the user that is currently logged in.
 

Method Detail

setStatus

void setStatus(ILocalStatus localStatus)
               throws GGException
Invocation of this method tries to set a new status of the user that is currently logged in.

Parameters:
localStatus - the new status to be set.
Throws:
GGException - if there is an error while setting status.
GGSessionException - if user is not logged in.
java.lang.NullPointerException - if status is null.

getStatus

ILocalStatus getStatus()
Returns the actual status of the user that is logged in.

Returns:
the actual status of the user.

addMonitoredUser

void addMonitoredUser(IUser user)
                      throws GGException
Adds the user to be monitored.

After adding the user UserListener's will receive events related to changing status of the user.

Note that you can also block the user using this method. After blocking the user you will no longer receive any messages from him/her.

Parameters:
user - that will be monitored or blocked.
Throws:
GGException - if there is an error while adding user to be monitored.
GGSessionException - if we are currently not logged in to the Gadu-Gadu server.
java.lang.NullPointerException - if user is null.

removeMonitoredUser

void removeMonitoredUser(IUser user)
                         throws GGException
Remove the user that was previously being monitored.

Parameters:
user - that we want to unregister from being monitored.
Throws:
GGException - if there is an error while removing user from being monitored or if the user is not being monitored.
GGSessionException - if we are currently not logged in to the Gadu-Gadu server
java.lang.NullPointerException - if the user is null.

changeMonitoredUserStatus

void changeMonitoredUserStatus(IUser user)
                               throws GGException
Changes status of the currently monitored user.

Parameters:
user - that contains a new status to be changed.
Throws:
GGException - if there is an error while changing status of the user or if the user is not being monitored.
GGSessionException - if we are currently not logged in to the Gadu-Gadu server.

getMonitoredUsers

java.util.Collection getMonitoredUsers()
Returns collections of the users that are currently being monitored. Note that it is unmodifiable collection therefore you cannot modify it.

Returns:
Collection unmodifiable collection of users that are currently being monitored.

addUserListener

void addUserListener(UserListener userListener)
Adds UserListener to the list of listeners that will be notified of status related events.

Parameters:
userListener - the UserListener object that will be notified.
Throws:
java.lang.NullPointerException - if userListener is null.

removeUserListener

void removeUserListener(UserListener userListener)
Removes UserListener from the list of listeners that will be notified of status related events.

Parameters:
userListener - the UserListener object that will no longer be notified.
Throws:
java.lang.NullPointerException - if userListener is null.


Copyright 2004-2004-2005 SourceForge.net. All Rights Reserved.