Subversion Repositories eFlore/Applications.del

Rev

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

package org.tela_botanica.del.client.services.rest;

import java.util.Map;

import org.tela_botanica.del.client.config.Config;
import org.tela_botanica.del.client.services.RequestBuilderWithCredentials;
import org.tela_botanica.del.client.services.rest.async.PaysCallback;
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;

public class PaysServiceConcret implements PaysService {
        
        private String baseUrl;
        private Map<String, String> pays;

        public PaysServiceConcret() {
                Config config = new Config();
                this.baseUrl = config.getServiceBaseUrl();
        }
        
        public PaysServiceConcret(Config config) {
                this.baseUrl = config.getServiceBaseUrl();
        }

        @Override
        public void getPays(PaysCallback callback) {
                String urlService = baseUrl+"ontologie/pays/";
                RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, urlService);
                                
                callback.setMode(ModeRequete.LECTURE);
                try {
                        rb.sendRequest(null, callback);
                } catch (Exception e) {
                        //TODO: quoi faire si la requete est mal formée coté client avant d'être envoyée ?
                }
        }
}