|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectmessageServerP.SafeMSForMSInterface
public class SafeMSForMSInterface
A Safe Message server to Message server interface. Normally, when a Message Server losts its RMI reference to another Message Server, for example for a MS shutdown, any call to the message server interface throws a RemoteException, even if the server got back on-line. Using this class, any method calls the interface method, but when the interface is down, it tries to bring it up once again.
Field Summary | |
---|---|
(package private) MSForMSInterface |
interf
|
private java.net.InetAddress |
ip
|
private int |
port
|
Constructor Summary | |
---|---|
SafeMSForMSInterface(java.net.InetAddress ip,
int port)
Safe MS for MS Interface constructor. |
Method Summary | |
---|---|
void |
assignMovedUser(ManagedUser user)
Assigns a user management (sending all its datas) to the message server. |
void |
forwardMessage(Message msg)
Forwards a message from a Message Server to this one. |
User |
getManagedUserContact(User user)
Gets a User IP address and TCP port to directely connect to its servlet. |
boolean |
inListOfUserContains(User listUser,
User user)
Checks whether or not a user (U1) accepts messages sent from another user (U2) |
private void |
refreshInterface()
Refreshes the interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.net.InetAddress ip
private int port
MSForMSInterface interf
Constructor Detail |
---|
public SafeMSForMSInterface(java.net.InetAddress ip, int port) throws java.rmi.RemoteException
ip
- the MS ip address.port
- the MS port.
java.rmi.RemoteException
Method Detail |
---|
public void assignMovedUser(ManagedUser user) throws java.rmi.RemoteException, AssignationNotAcceptedException
MSForMSInterface
assignMovedUser
in interface MSForMSInterface
user
- the user to assign.
java.rmi.RemoteException
- if a communication problem occurred.
AssignationNotAcceptedException
- if the assignation was not accepted.public void forwardMessage(Message msg) throws java.rmi.RemoteException, NotAllowedException, UserNotManagedException, GenericErrorException, UserNotExistsException, SystemErrorException
MSForMSInterface
forwardMessage
in interface MSForMSInterface
msg
- the message to forward.
java.rmi.RemoteException
- if a communication problem occurs.
NotAllowedException
- if the recipint does not accept messages from the sender.
UserNotManagedException
- id the recipient user is not assigned to this MS.
GenericErrorException
- if a generic error occurred.
UserNotExistsException
- if the user does not exist in the whole system.
SystemErrorException
- if a system error occurred.public User getManagedUserContact(User user) throws java.rmi.RemoteException, UserNotManagedException
MSForMSInterface
getManagedUserContact
in interface MSForMSInterface
user
- the user whose connection datas is wanted. Only the nickname is considered.
java.rmi.RemoteException
- if a communication problem occurs.
UserNotManagedException
- if the user is not locally managed.public boolean inListOfUserContains(User listUser, User user) throws java.rmi.RemoteException, UserNotManagedException
MSForMSInterface
inListOfUserContains
in interface MSForMSInterface
listUser
- the receiver user (U1)user
- the sender user (U2)
java.rmi.RemoteException
- if a communication problem occurred.
UserNotManagedException
- if the listUser (U1) is not managed by the server.private void refreshInterface() throws java.rmi.RemoteException
java.rmi.RemoteException
- if the interface could not be refreshed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |