Ignore:
Timestamp:
Feb 27, 2011, 1:38:04 PM (13 years ago)
Author:
mlg
Message:

Changes function name (to english)
version changed to 0.13.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java

    r9387 r9392  
    1818
    1919import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
    20 import fr.mael.jiwigo.transverse.util.Outil;
     20import fr.mael.jiwigo.transverse.util.Tools;
    2121
    2222/*
     
    6565     * the entered password
    6666     */
    67     private String motDePasse;
     67    private String password;
    6868    /**
    6969     * the url of the site
     
    103103     * true : an error was found for the proxy
    104104     */
    105     private boolean erreurProxy;
     105    private boolean proxyError;
    106106
    107107    /**
    108108     * Constructor
    109109     * @param login the login
    110      * @param motDePasse the password
     110     * @param password the password
    111111     * @param url the url of the site
    112112     */
    113     public SessionManager(String login, String motDePasse, String url) {
     113    public SessionManager(String login, String password, String url) {
    114114        this.login = login;
    115         this.motDePasse = motDePasse;
     115        this.password = password;
    116116        this.url = url + "/ws.php";
    117117        MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
     
    140140        }
    141141        try {
    142             doc = executerReturnDocument(MethodsEnum.LOGIN.getLabel(), "username", login, "password", motDePasse);
    143             return Outil.checkOk(doc);
     142            doc = executeReturnDocument(MethodsEnum.LOGIN.getLabel(), "username", login, "password", password);
     143            return Tools.checkOk(doc);
    144144        } catch (Exception e) {
    145             LOG.error(Outil.getStackTrace(e));
     145            LOG.error(Tools.getStackTrace(e));
    146146        }
    147147        return false;
     
    155155     * @throws UnsupportedEncodingException
    156156     */
    157     public String executerReturnString(String methode, String... parametres) throws UnsupportedEncodingException {
     157    public String executeReturnString(String methode, String... parametres) throws UnsupportedEncodingException {
    158158        if (parametres.length % 2 != 0 && !(parametres == null)) {
    159159            try {
    160160                throw new Exception("Le nombre de parametres doit etre pair");
    161161            } catch (Exception e) {
    162                 LOG.error(Outil.getStackTrace(e));
     162                LOG.error(Tools.getStackTrace(e));
    163163                return null;
    164164            }
     
    180180            //      System.out.println(Outil.readInputStreamAsString(streamResponse));
    181181            //      String toReturn = method.getResponseBodyAsString();
    182             String toReturn = Outil.readInputStreamAsString(streamResponse);
     182            String toReturn = Tools.readInputStreamAsString(streamResponse);
    183183            LOG.debug(toReturn);
    184184            return toReturn;
    185185        } catch (HttpException e) {
    186186            // TODO Auto-generated catch block
    187             LOG.error(Outil.getStackTrace(e));
     187            LOG.error(Tools.getStackTrace(e));
    188188        } catch (IOException e) {
    189189            // TODO Auto-generated catch block
    190             LOG.error(Outil.getStackTrace(e));
     190            LOG.error(Tools.getStackTrace(e));
    191191        } catch (IllegalArgumentException e) {
    192             LOG.error(Outil.getStackTrace(e));
     192            LOG.error(Tools.getStackTrace(e));
    193193        } finally {
    194194            method.releaseConnection();
     
    205205     * @throws IOException
    206206     */
    207     public Document executerReturnDocument(String methode, String... parametres) throws IOException {
     207    public Document executeReturnDocument(String methode, String... parametres) throws IOException {
    208208        try {
    209             return Outil.stringToDocument(executerReturnString(methode, parametres));
     209            return Tools.stringToDocument(executeReturnString(methode, parametres));
    210210        } catch (JDOMException e) {
    211211            // TODO Auto-generated catch block
    212             LOG.error(Outil.getStackTrace(e));
     212            LOG.error(Tools.getStackTrace(e));
    213213        }
    214214        return null;
     
    221221     * @return the result
    222222     */
    223     public Document executerReturnDocument(String methode) {
     223    public Document executeReturnDocument(String methode) {
    224224        try {
    225             return Outil.stringToDocument(executerReturnString(methode));
     225            return Tools.stringToDocument(executeReturnString(methode));
    226226        } catch (JDOMException e) {
    227227            // TODO Auto-generated catch block
    228             LOG.error(Outil.getStackTrace(e));
     228            LOG.error(Tools.getStackTrace(e));
    229229        } catch (IOException e) {
    230230            // TODO Auto-generated catch block
    231             LOG.error(Outil.getStackTrace(e));
     231            LOG.error(Tools.getStackTrace(e));
    232232        }
    233233        return null;
     
    250250
    251251    /**
    252      * @return the motDePasse
    253      */
    254     public String getMotDePasse() {
    255         return motDePasse;
    256     }
    257 
    258     /**
    259      * @param motDePasse the motDePasse to set
    260      */
    261     public void setMotDePasse(String motDePasse) {
    262         this.motDePasse = motDePasse;
    263     }
    264 
    265     /**
    266252     * @return the url
    267253     */
     
    312298    }
    313299
    314     /**
    315      * @return the erreurProxy
    316      */
    317     public boolean isErreurProxy() {
    318         return erreurProxy;
     300    public String getPassword() {
     301        return password;
     302    }
     303
     304    public void setPassword(String password) {
     305        this.password = password;
     306    }
     307
     308    public boolean isProxyError() {
     309        return proxyError;
     310    }
     311
     312    public void setProxyError(boolean proxyError) {
     313        this.proxyError = proxyError;
    319314    }
    320315
Note: See TracChangeset for help on using the changeset viewer.