Guest User

Untitled

a guest
Dec 18th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package models;
  2.  
  3. import java.net.MalformedURLException;
  4. import java.rmi.Naming;
  5. import java.rmi.NotBoundException;
  6. import java.rmi.RemoteException;
  7.  
  8. import rmiserver.RMI;
  9.  
  10. public class RegistFaceBean {
  11.  
  12. private String username;
  13. private String password;
  14. private String facebook_id;
  15. private RMI server;
  16.  
  17. public RegistFaceBean()
  18. {
  19. try {
  20. //System.getProperties().put("java.security.policy", "policy.all");
  21. server = (RMI) Naming.lookup("rmi://127.0.0.1:6001/rmiserver");
  22. }
  23. catch(NotBoundException|MalformedURLException|RemoteException e) {
  24. e.printStackTrace();
  25. }
  26. }
  27.  
  28. public boolean registNewUser() throws RemoteException
  29. {
  30. return server.registFacebook(this.facebook_id, this.username);
  31. }
  32.  
  33. public String getUsername()
  34. {
  35. return username;
  36. }
  37.  
  38. public void setUsername(String username)
  39. {
  40. this.username = username;
  41. }
  42.  
  43. public String getPassword()
  44. {
  45. return password;
  46. }
  47.  
  48. public void setPassword(String password)
  49. {
  50. this.password = password;
  51. }
  52. public void setFacebookId( String a )
  53. {
  54. this.facebook_id = a;
  55. }
  56. }
Add Comment
Please, Sign In to add comment