Subversion Repositories eFlore/Applications.coel

Rev

Rev 1367 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.synchronisation;

import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.synchronisation.Reponse;

public class Requete implements Rafraichissable{
        
        private Rafraichissable vueARafraichir;
        private Reponse reponse;
        private int numeroSequence;
        
        public Requete(Rafraichissable vueARafraichir, int numeroSequence)      {
                this.vueARafraichir = vueARafraichir;
                this.numeroSequence = numeroSequence;
        }
        
        public Rafraichissable getVueARafraichir()      {
                return this.vueARafraichir;
        }
        
        public boolean hasResponse()    {
                return (reponse!=null);
        }
        
        public void setRetour(Reponse reponse)  {
                this.reponse = reponse;
        }
        
        public Reponse obtenirReponse() {
                return this.reponse;
        }
        
        public int obtenirNumeroSequence()      {
                return numeroSequence;
        }
        
        public void rafraichir()        {
                vueARafraichir.rafraichir(reponse.obtenirRetour());
        }
        
        public void rafraichir(Object nouvellesDonnees) {
                vueARafraichir.rafraichir(nouvellesDonnees);
        }
        
        public String toString()        {
                return vueARafraichir.getClass().getName() +"= " +numeroSequence;
        }
}