common.interfaces
Interface BSForServletInterface

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
Communication

public interface BSForServletInterface
extends java.rmi.Remote

This interface contains the method needed by a Gossip Servlet that the Bootstrap exported object must provide.

Author:
Marco Cornolti and Alessandro Franchini

Method Summary
 void deleteUser(User user, java.lang.String pw)
          Deletes an account of a user (this method is used by the user itself).
 MessageServer getMS(User user)
          Returns the message server of a user given by argument.
 void register(java.lang.String nick, java.lang.String pw)
          Creates an account for a new user.
 

Method Detail

getMS

MessageServer getMS(User user)
                    throws java.rmi.RemoteException,
                           UserNotExistsException
Returns the message server of a user given by argument.

Parameters:
user - the user (only the nickname is considered).
Returns:
the user's message server.
Throws:
java.rmi.RemoteException - if a communication problem occurs.
UserNotExistsException - if the user does not exist.

register

void register(java.lang.String nick,
              java.lang.String pw)
              throws java.rmi.RemoteException,
                     GenericErrorException,
                     AssignationNotAcceptedException
Creates an account for a new user.

Parameters:
nick - The new user nickname (case insensitive).
pw - The new user password.
Throws:
GenericErrorException - if there are no message server available for the assignation.
AssignationNotAccepted - if another user with the same nickname already exists.
java.rmi.RemoteException - if a communication problem occurs.
AssignationNotAcceptedException

deleteUser

void deleteUser(User user,
                java.lang.String pw)
                throws java.rmi.RemoteException,
                       UserNotExistsException,
                       WrongPasswordException,
                       GenericErrorException,
                       BlockedException
Deletes an account of a user (this method is used by the user itself).

Parameters:
user - the user to delete
pw - the user's password
Throws:
BlockedException - if the user is currently blocked by the administrator.
GenericErrorException - if some error occurred and the user was not deleted (i.e. MS not reachable).
WrongPasswordException - if the user password is not right.
UserNotExistsException - if the user nickname does not exist.
java.rmi.RemoteException