Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. package WebServer.model;
  2.  
  3. import java.rmi.*;
  4. import java.util.ArrayList;
  5. import java.util.Calendar;
  6. import java.util.concurrent.CopyOnWriteArrayList;
  7. import java.net.MalformedURLException;
  8. import rmiserver.RMIInterface;
  9.  
  10. public class RmiModel {
  11.     private RMIInterface server;
  12.    
  13.    
  14.     public RmiModel() {
  15.         try {
  16.             server = (RMIInterface) Naming.lookup("server");
  17.         }
  18.         catch(NotBoundException|MalformedURLException|RemoteException e) {
  19.             e.printStackTrace(); // what happens *after* we reach this line?
  20.         }
  21.     }
  22.    
  23.     public String login(String user,String pwd) throws RemoteException{
  24.         return server.login(user, pwd);
  25.     }
  26.  
  27.     /*public boolean verificar(String numeroCC,String titulo) throws RemoteException{
  28.         return server.verificar(numeroCC, titulo);
  29.     }*/
  30.    
  31.    
  32.    
  33.     public boolean adicionarMesas(String titulo, String dep, int mesasNum) throws RemoteException{
  34.         return server.adicionarMesas(titulo, dep, mesasNum);
  35.     }
  36.    
  37.     public CopyOnWriteArrayList<String> apresentarListas(String titulo,String est) throws RemoteException{
  38.         return server.apresentarListas(titulo, est);
  39.     }
  40.    
  41.     public String getTipo(String titulo) throws RemoteException{
  42.         return server.getTipo(titulo);
  43.     }
  44.    
  45.     public Calendar getFimEleicao(String titulo) throws RemoteException{
  46.         return server.getFimEleicao(titulo);
  47.     }
  48.    
  49.     public Calendar getInicioEleicao(String titulo) throws RemoteException{
  50.         return server.getInicioEleicao(titulo);
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement