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

Last change on this file since 10505 was 10505, checked in by anthony43, 13 years ago

huge refactoring to introduce JiwigoException : a generic exception encapsulating low level exceptions (IOException, ProxyAuthentication, etc...)
The aim is to have, on the consumer side, just one exception to catch them all.
this refactoring may need a code review to check the changes.

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