source: extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java @ 9919

Last change on this file since 9919 was 9919, checked in by mlg, 13 years ago

Complete rewriting of the api
The api now uses interfaces everywhere (for the dao, services and session manager). This allows the developer to use his own implementations if he wants.
Deletion of the singletons. There are now getters and setters. It allows to make dependency injection.
Use of sl4j in the api, instead of using log4j.

File size: 3.0 KB
Line 
1package fr.mael.jiwigo.transverse.session;
2
3import java.io.IOException;
4import java.io.UnsupportedEncodingException;
5
6import org.w3c.dom.Document;
7
8import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
9
10public interface SessionManager {
11    /**
12     * Connection method
13     *
14     * @return 0 if Ok, 1 if not Ok (reason not specified), 2 if proxy error
15     *
16     *
17     */
18    public int processLogin();
19
20    /**
21     * Executes a method on the webservice and returns the result as a string
22     * @param methode the method to execute
23     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
24     * @return the result
25     * @throws UnsupportedEncodingException
26     * @throws ProxyAuthenticationException
27     */
28    public String executeReturnString(String methode, String... parametres) throws UnsupportedEncodingException,
29            ProxyAuthenticationException;
30
31    /**
32     * Executes a method on the webservice and returns the result as a Dom document
33     * @param methode the method to execute
34     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
35     * @return the result
36     * @throws IOException
37     * @throws ProxyAuthenticationException
38     */
39    public Document executeReturnDocument(String methode, String... parametres) throws IOException,
40            ProxyAuthenticationException;
41
42    /**
43     * Executes a method on the webservice and returns the result as a Dom document
44     * @param methode the method to execute
45     * @return the result
46     * @throws ProxyAuthenticationException
47     */
48    public Document executeReturnDocument(String methode) throws ProxyAuthenticationException;
49
50    /**
51     * Getter of the login
52     * @return the login
53     */
54    public String getLogin();
55
56    /**
57     * Setter of the login
58     * @param login
59     */
60    public void setLogin(String login);
61
62    /**
63     * Setter of the user agent
64     * @param userAgent
65     */
66    public void setUserAgent(String userAgent);
67
68    /**
69     * Setter of the password to access piwigo
70     * @param password
71     */
72    public void setPassword(String password);
73
74    /**
75     * Setter of the proxy login
76     * @param loginProxy
77     */
78    public void setLoginProxy(String loginProxy);
79
80    /**
81     * Setter of the proxy port
82     * @param port
83     */
84    public void setPortProxy(int port);
85
86    /**
87     * Setter of the proxy url
88     * @param urlProxy
89     */
90    public void setUrlProxy(String urlProxy);
91
92    /**
93     * Setter of the proxy pass
94     * @param proxyPass
95     */
96    public void setPassProxy(String proxyPass);
97
98    /**
99     * Setter of the proxy url
100     * @param url
101     */
102    public void setUrl(String url);
103
104    /**
105     * Setter of the boolean that tells to use a proxy or not
106     * @param usesProxy
107     */
108    public void setUsesProxy(boolean usesProxy);
109
110    /**
111     * Function that returns true if there is a proxy error
112     * @return
113     */
114    public boolean isProxyError();
115}
Note: See TracBrowser for help on using the repository browser.