|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MSForServletInterface
This class represents the methods that the object exported by the Gossip Message Server must implement to let a Gossip Servlet use it.
Method Summary | |
---|---|
void |
addToFriends(User user,
java.lang.String pw,
User userToAdd)
Used by a servlet to tell the message server to add another user in his contact list as friend. |
void |
blockContact(User user,
java.lang.String pw,
User userToBlock)
Marks userToBlock in the user's contact list as blocked, so that no more messages from that user are accepted. |
void |
changePassword(User user,
java.lang.String oldPw,
java.lang.String newPw)
Changes the user password. |
void |
deleteDownloadedMsgs(User user,
java.lang.String pw)
Deletes the messages that are already downloaded by a User. |
java.util.Vector<Message> |
downloadMsgs(User user,
java.lang.String pw)
Downloads the messages stored in the Message server for a user. |
void |
forwardMessage(Message msg)
Forwards a message. |
ContactList |
getContactList(User user,
java.lang.String pw)
Returns user list of contacts. |
User |
getUserContact(User user)
Gets a User IP address and TCP port to directely connect to its servlet. |
void |
removeContact(User user,
java.lang.String pw,
User userToRemove)
Removes userToRemove from user's contact list, so that no more messages from that user are accepted. |
void |
setState(User user,
java.lang.String pw,
boolean state)
Sets a user state. |
boolean |
testPorts(int port,
java.net.InetAddress ip)
Tests the servlet port trying to connect to them. |
Method Detail |
---|
void addToFriends(User user, java.lang.String pw, User userToAdd) throws java.rmi.RemoteException, UserNotManagedException, WrongPasswordException, UserBlockedException, UserAlreadyInsertedException
user
- the invoking user.pw
- the invoking user password.userToAdd
- the user to add.
UserNotManagedException
- if the user is not managed by the local MS.
UserBlockedException
- if the user is blocked.
WrongPasswordException
- if the password is not right.
UserAlreadyInsertedException
- if the user is already contained in the incoming list.
java.rmi.RemoteException
- if a communication problem ocurred.User getUserContact(User user) throws java.rmi.RemoteException, UserNotExistsException, GenericErrorException, UserBlockedException
user
- the user whose connection datas is wanted. Only the nickname is considered.
java.rmi.RemoteException
- if a communication problem occurs.
UserNotExistsException
- if the specificed user nickname does not exists.
GenericErrorException
- if another error occurred (i.e. a communication problem with another message server).
UserBlockedException
- if the user is blocked.void blockContact(User user, java.lang.String pw, User userToBlock) throws java.rmi.RemoteException, UserNotManagedException, UserNotExistsException, WrongPasswordException, UserBlockedException
user
- the user.pw
- the user's password.userToBlock
- the user to block.
UserNotManagedException
- if user is not managed by this message server.
UserNotExistsException
- if the userToBlock is not present in the contact list.
WrongPasswordException
- if the user's password is wrong.
UserBlockedException
- if the user is blocked
java.rmi.RemoteException
void removeContact(User user, java.lang.String pw, User userToRemove) throws java.rmi.RemoteException, UserNotManagedException, UserNotExistsException, WrongPasswordException, UserBlockedException
user
- the user.pw
- the user's password.userToRemove
- the user to remove.
UserNotManagedException
- if user is not managed by this message server.
UserNotExistsException
- if the userToRemove is not present in the contact list.
WrongPasswordException
- if the user's password is wrong.
UserBlockedException
- if the user is currently blocked.
java.rmi.RemoteException
java.util.Vector<Message> downloadMsgs(User user, java.lang.String pw) throws java.rmi.RemoteException, UserNotManagedException, UserBlockedException, WrongPasswordException
user
- the user whose messages are wanted.pw
- the user's password
java.rmi.RemoteException
- if a communication problem occurs.
UserNotManagedException
- if the user is not managed by this message server.
UserBlockedException
- if the user is blocked (i.e. to be moved).
WrongPasswordException
- if the given password is wrong.void deleteDownloadedMsgs(User user, java.lang.String pw) throws java.rmi.RemoteException, UserNotManagedException, WrongPasswordException, UserBlockedException
user
- the user.pw
- the user password.
java.rmi.RemoteException
- if a communication problem occurs.
UserNotManagedException
- if the user is not managed by the MS.
WrongPasswordException
- if the password is wrong.
UserBlockedException
- is the user is blocked.void setState(User user, java.lang.String pw, boolean state) throws java.rmi.RemoteException, UserNotManagedException, WrongPasswordException, GenericErrorException, UserBlockedException
user
- the userpw
- the user passwordstate
- true if the state is on-line, false if the state is off-line
java.rmi.RemoteException
- if a communication problem occurs.
UserNotManagedException
- if the user is not managed by the MS.
WrongPasswordException
- if the password is wrong.
GenericErrorException
- if another error occurred, i.e. the server could not define the servlet ip address.
UserBlockedException
- if the user is blocked.void forwardMessage(Message msg) throws java.rmi.RemoteException, NotAllowedException, UserNotManagedException, GenericErrorException, UserNotExistsException, SystemErrorException
msg
- the message to forward.
UserNotManagedException
- if the MS does not manage the recipient nor the sender.
NotAllowedException
- if the recipient user does have the sender in its blockedlist.
UserNotExistsException
- if the recipient does not exist in the whole system.
GenericErrorException
- if another error has occurred.
SystemErrorException
- if a system error occurred.
java.rmi.RemoteException
ContactList getContactList(User user, java.lang.String pw) throws java.rmi.RemoteException, UserNotManagedException, WrongPasswordException, UserBlockedException
user
- the userpw
- the user password
java.rmi.RemoteException
- if a communication problem occurred.
UserNotManagedException
- if the user is not managed by this message server.
WrongPasswordException
- if the user's password is wrong.
UserBlockedException
- if the user is blocked.void changePassword(User user, java.lang.String oldPw, java.lang.String newPw) throws java.rmi.RemoteException, UserNotManagedException, WrongPasswordException, UserBlockedException
user
- the useroldPw
- the old passwordnewPw
- the new password to set
java.rmi.RemoteException
- if a communication problem occurred.
UserNotManagedException
- if the user is not managed by the MS.
WrongPasswordException
- if the old password is wrong.
UserBlockedException
- if the user is blocked.boolean testPorts(int port, java.net.InetAddress ip) throws java.rmi.RemoteException
port
- the port to test.ip
- the servlet ip.
java.rmi.RemoteException
- if a communication problem occurred while invoking this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |