|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectbootstrapP.SafeMSForBSInterface
public class SafeMSForBSInterface
A Safe Message Server to Bootstrap interface.
Normally, when a Bootstrap losts its RMI reference to the 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 | |
|---|---|
private MSForBSInterface |
interf
|
(package private) java.net.InetAddress |
ip
|
(package private) int |
RMIPort
|
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
SafeMSForBSInterface(java.net.InetAddress ip,
int RMIPort)
Safe MS for BS Interface constructor. |
|
| Method Summary | |
|---|---|
void |
assign(java.lang.String MSPw,
User user,
java.lang.String userPw)
Assigns a new user to the message server. |
void |
blockAssignation(java.lang.String MSPw,
boolean status)
Puts the MS in the 'blocked' or 'unblocked' status, depending on the boolean status given by argument. |
void |
deleteUserAdmin(User nick,
java.lang.String MSpw)
Deletes a user. |
Statistics |
getStatistics(java.lang.String globalpw)
Returns the statistics of the message server. |
java.util.Vector<User> |
getUsersList(java.lang.String globalpw)
Returns the list of users managed by the Message Server. |
void |
moveUser(java.lang.String MSPw,
User user,
MessageServer ms)
Moves a user assignation from the message server to the specified one. |
private void |
refreshInterface()
Refreshes the interface. |
void |
shutdown(java.lang.String MSPw)
Shuts down the MS server. |
boolean |
testPassword(java.lang.String pw)
Tests a message server administration password. |
void |
testPresence()
Tests the presence of a Message Server |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private MSForBSInterface interf
int RMIPort
java.net.InetAddress ip
| Constructor Detail |
|---|
public SafeMSForBSInterface(java.net.InetAddress ip,
int RMIPort)
throws java.rmi.RemoteException
ip - the MS ip address.RMIPort - the MS RMI port.
java.rmi.RemoteException - if the server could not be reached.| Method Detail |
|---|
public void assign(java.lang.String MSPw,
User user,
java.lang.String userPw)
throws java.rmi.RemoteException,
BlockedException,
WrongPasswordException
MSForBSInterface
assign in interface MSForBSInterfaceMSPw - the MS password.user - the user to adduserPw - the user password
java.rmi.RemoteException - if a communication problem occurs.
BlockedException - if the server is blocked and does not accept new users.
WrongPasswordException - if the Message Server Password is wrong.
public void blockAssignation(java.lang.String MSPw,
boolean status)
throws java.rmi.RemoteException,
WrongPasswordException
MSForBSInterface
blockAssignation in interface MSForBSInterfaceMSPw - the MS administration password.status - true if the status must be set to 'blocked', false if the status must be set to 'unblocked'.
java.rmi.RemoteException - if a communication problem occurs.
WrongPasswordException - if the password is wrong.
public void deleteUserAdmin(User nick,
java.lang.String MSpw)
throws java.rmi.RemoteException,
WrongPasswordException,
BlockedException,
UserNotManagedException
MSForBSInterface
deleteUserAdmin in interface MSForBSInterfacenick - the user to delete.MSpw - the Message Server administration password.
java.rmi.RemoteException - if a communication problem with the server occurred.
WrongPasswordException - if the password is not right.
BlockedException - if the MS is currently blocked.
UserNotManagedException - if the specified user is not managed by the Message server.
public Statistics getStatistics(java.lang.String globalpw)
throws java.rmi.RemoteException,
WrongPasswordException
MSForBSInterface
getStatistics in interface MSForBSInterfaceglobalpw - the MS password
java.rmi.RemoteException - if a communcation problem occurs.
WrongPasswordException - if the administration password is wrong.
public java.util.Vector<User> getUsersList(java.lang.String globalpw)
throws java.rmi.RemoteException,
WrongPasswordException
MSForBSInterface
getUsersList in interface MSForBSInterfaceglobalpw - the MS password
java.rmi.RemoteException - if a communication problem occurs.
WrongPasswordException - if the password is wrong.
public void moveUser(java.lang.String MSPw,
User user,
MessageServer ms)
throws java.rmi.RemoteException,
WrongPasswordException,
UserNotManagedException,
AssignationNotAcceptedException,
GenericErrorException
MSForBSInterface
moveUser in interface MSForBSInterfaceMSPw - the message server password.user - the user to move.ms - the message server to move the user to.
java.rmi.RemoteException - if a communication problem occurs.
WrongPasswordException - id the MS admin password is wrong.
UserNotManagedException - if the user is not managed by this MS (or does not exists).
AssignationNotAcceptedException - if the MS the user was wanted to be moved to refused the assignation (i.e. is blocked).
GenericErrorException - if a communication problem with the second MS occurred.
public void shutdown(java.lang.String MSPw)
throws java.rmi.RemoteException,
WrongPasswordException,
UsersStillPresentException,
BlockedException
MSForBSInterface
shutdown in interface MSForBSInterfaceMSPw - the Message Server password.
java.rmi.RemoteException - if there was a communication error or the MS was correctly shutdown.
WrongPasswordException - if the password is wrong.
UsersStillPresentException - if the Message Server still manages some users.
BlockedException - if the Message Server is not blocked.
public boolean testPassword(java.lang.String pw)
throws java.rmi.RemoteException
MSForBSInterface
testPassword in interface MSForBSInterfacepw - the password to check
java.rmi.RemoteException
public void testPresence()
throws java.rmi.RemoteException
MSForBSInterface
testPresence in interface MSForBSInterfacejava.rmi.RemoteException - if the server could not be reached.
private void refreshInterface()
throws java.rmi.RemoteException
java.rmi.RemoteException - if the interface could not be refreshed (the server is still down).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||