]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneAuthInfo.java
javadoc enhancements
[linphone] / java / common / org / linphone / core / LinphoneAuthInfo.java
1 /*
2 LinphoneAuthInfo.java
3 Copyright (C) 2010  Belledonne Communications, Grenoble, France
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 */
19 package org.linphone.core;
20 /**
21  * Object holding authentication information.
22  * In most case, authentication information consists of a username and password. Sometimes, a userid is required by proxy, and realm can be useful to discriminate different SIP domains.
23  *<br>This object is instantiated using either {@link LinphoneCoreFactory#createAuthInfo(String, String, String)} or {@link LinphoneCoreFactory#createAuthInfo(String, String, String, String, String)}.
24  *<br>
25  *Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in order to become known and used automatically when needed. 
26  *Use {@link LinphoneCore#addAuthInfo(LinphoneAuthInfo)} for that purpose.
27  *<br>
28  *The LinphoneCore object can take the initiative to request authentication information when needed to the application 
29  *through the {@link LinphoneCoreListener#authInfoRequested(LinphoneCore, String, String)} listener.
30  *<br>
31  *The application can respond to this information request later using  {@link LinphoneCore#addAuthInfo(LinphoneAuthInfo)}. 
32  *This will unblock all pending authentication transactions and retry them with authentication headers.
33  *
34  */
35 public interface LinphoneAuthInfo {
36         /**
37          * get user name
38          * @return username
39          */
40         String getUsername();
41         /**
42          * Sets the username.
43          * @param username
44          */
45         void setUsername(String username);
46         /**
47          * get password
48          * @return password
49          */
50         String getPassword();
51         /**
52          * sets password
53          * @param password
54          */
55         void setPassword(String password);
56         /**
57          * get realm
58          * @return
59          */
60         String getRealm();
61         /**
62          * set realm
63          * @param realm
64          */
65         void setRealm(String realm);
66         /**
67          * get auth userid has used in authentication header. If null, username is taken for authentication
68          * @return auth userid
69          */
70         String getUserId();
71         /**
72          * set auth userid has used in authentication header. If null, username is taken for authentication
73          * 
74          */
75         void setUserId(String userid);
76         /**
77          * get ha1
78          * @return ha1
79          */
80         String getHa1();
81         /**
82          * set ha1
83          */
84         void setHa1(String ha1);
85         
86 }
87
88