| 1024 | aurelien | 1 | package org.tela_botanica.cel.client.cache;
 | 
        
           |  |  | 2 |   | 
        
           |  |  | 3 | import org.tela_botanica.cel.client.modeles.InformationsRecherche;
 | 
        
           |  |  | 4 | import org.tela_botanica.cel.client.modeles.Utilisateur;
 | 
        
           |  |  | 5 |   | 
        
           |  |  | 6 | public class CacheClient {
 | 
        
           |  |  | 7 |   | 
        
           |  |  | 8 | 	private int numPageRechercheImage = 0;
 | 
        
           |  |  | 9 | 	private int nbTotalImagesRecherchees = 0;
 | 
        
           |  |  | 10 |   | 
        
           |  |  | 11 | 	private int pasPagination = 12;
 | 
        
           |  |  | 12 | 	private int pageCouranteRechercheImage = 1;
 | 
        
           |  |  | 13 | 	private int pageCouranteRechercheObservations = 1;
 | 
        
           |  |  | 14 | 	private InformationsRecherche informationsRechercheImage;
 | 
        
           |  |  | 15 | 	private InformationsRecherche informationsRechercheObservation;
 | 
        
           |  |  | 16 | 	private Utilisateur utilisateur;
 | 
        
           |  |  | 17 |   | 
        
           |  |  | 18 | 	private static CacheClient instance;
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 | 	private CacheClient() {
 | 
        
           |  |  | 21 | 		instance = this;
 | 
        
           |  |  | 22 | 	}
 | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 | 	public Utilisateur getUtilisateur() {
 | 
        
           |  |  | 25 | 		if (this.utilisateur == null) {
 | 
        
           |  |  | 26 | 			this.utilisateur = new Utilisateur(null);
 | 
        
           |  |  | 27 | 		}
 | 
        
           |  |  | 28 | 		return this.utilisateur;
 | 
        
           |  |  | 29 | 	}
 | 
        
           |  |  | 30 |   | 
        
           |  |  | 31 | 	public void setUtilisateur(Utilisateur utilisateur) {
 | 
        
           |  |  | 32 | 		this.utilisateur = utilisateur;
 | 
        
           |  |  | 33 | 	}
 | 
        
           |  |  | 34 |   | 
        
           |  |  | 35 | 	public static CacheClient getInstance() {
 | 
        
           |  |  | 36 | 		if (instance == null) {
 | 
        
           |  |  | 37 | 			instance = new CacheClient();
 | 
        
           |  |  | 38 | 		}
 | 
        
           |  |  | 39 | 		return instance;
 | 
        
           |  |  | 40 | 	}
 | 
        
           |  |  | 41 |   | 
        
           |  |  | 42 | 	public int getNumPageRechercheImage() {
 | 
        
           |  |  | 43 | 		return numPageRechercheImage;
 | 
        
           |  |  | 44 | 	}
 | 
        
           |  |  | 45 |   | 
        
           |  |  | 46 | 	// Pour la recherche :
 | 
        
           |  |  | 47 | 	public int getPasPagination() {
 | 
        
           |  |  | 48 | 		return pasPagination;
 | 
        
           |  |  | 49 | 	}
 | 
        
           |  |  | 50 |   | 
        
           |  |  | 51 | 	public void setPasPagination(int pasPagination) {
 | 
        
           |  |  | 52 | 		this.pasPagination = pasPagination;
 | 
        
           |  |  | 53 | 	}
 | 
        
           |  |  | 54 |   | 
        
           |  |  | 55 | 	public void setPageCouranteRechercheImages(int pageCouranteRecherche) {
 | 
        
           |  |  | 56 | 		this.pageCouranteRechercheImage = pageCouranteRecherche;
 | 
        
           |  |  | 57 | 	}
 | 
        
           |  |  | 58 |   | 
        
           |  |  | 59 | 	public int getPageCouranteRechercheImage() {
 | 
        
           |  |  | 60 | 		return this.pageCouranteRechercheImage;
 | 
        
           |  |  | 61 | 	}
 | 
        
           |  |  | 62 |   | 
        
           |  |  | 63 | 	public void setNbTotalImagesRecherchees(int nbTotalImagesRecherchees) {
 | 
        
           |  |  | 64 | 		this.nbTotalImagesRecherchees = nbTotalImagesRecherchees;
 | 
        
           |  |  | 65 | 	}
 | 
        
           |  |  | 66 |   | 
        
           |  |  | 67 | 	public int getNbTotalImagesRecherchees() {
 | 
        
           |  |  | 68 | 		return this.nbTotalImagesRecherchees;
 | 
        
           |  |  | 69 | 	}
 | 
        
           |  |  | 70 |   | 
        
           |  |  | 71 | 	public InformationsRecherche getInformationsRechercheImage() {
 | 
        
           |  |  | 72 | 		if(informationsRechercheImage == null) {
 | 
        
           |  |  | 73 | 			informationsRechercheImage = new InformationsRecherche();
 | 
        
           |  |  | 74 | 		}
 | 
        
           |  |  | 75 | 		return informationsRechercheImage;
 | 
        
           |  |  | 76 | 	}
 | 
        
           |  |  | 77 |   | 
        
           |  |  | 78 | 	public InformationsRecherche getInformationsRechercheObservation() {
 | 
        
           |  |  | 79 | 		if(informationsRechercheObservation == null) {
 | 
        
           |  |  | 80 | 			informationsRechercheObservation = new InformationsRecherche();
 | 
        
           |  |  | 81 | 		}
 | 
        
           |  |  | 82 | 		return informationsRechercheObservation;
 | 
        
           |  |  | 83 | 	}
 | 
        
           |  |  | 84 |   | 
        
           |  |  | 85 | 	public void setInformationsRechercheImage(InformationsRecherche informationsRechercheImage) {
 | 
        
           |  |  | 86 | 		this.informationsRechercheImage = informationsRechercheImage;
 | 
        
           |  |  | 87 | 	}
 | 
        
           |  |  | 88 |   | 
        
           |  |  | 89 | 	public void setInformationsRechercheObservation(InformationsRecherche informationsRechercheObservation) {
 | 
        
           |  |  | 90 | 		this.informationsRechercheObservation = informationsRechercheObservation;
 | 
        
           |  |  | 91 | 	}
 | 
        
           |  |  | 92 |   | 
        
           |  |  | 93 | 	public int getPageCouranteRechercheObservations() {
 | 
        
           |  |  | 94 | 		return pageCouranteRechercheObservations;
 | 
        
           |  |  | 95 | 	}
 | 
        
           |  |  | 96 |   | 
        
           |  |  | 97 | 	public void setPageCouranteRechercheObservations(int pageCouranteRechercheObservations) {
 | 
        
           |  |  | 98 | 		this.pageCouranteRechercheObservations = pageCouranteRechercheObservations;
 | 
        
           |  |  | 99 | 	}
 | 
        
           |  |  | 100 |   | 
        
           |  |  | 101 | }
 |