2 LinphoneAuthInfoImpl.java
3 Copyright (C) 2010 Belledonne Communications, Grenoble, France
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.
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.
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.
19 package org.linphone.core;
21 class LinphoneAuthInfoImpl implements LinphoneAuthInfo {
22 protected final long nativePtr;
23 private native long newLinphoneAuthInfo();
24 private native void delete(long ptr);
25 private native String getPassword(long ptr);
26 private native String getRealm(long ptr);
27 private native String getUsername(long ptr);
28 private native void setPassword(long ptr, String password);
29 private native void setRealm(long ptr, String realm);
30 private native void setUsername(long ptr, String username);
31 private native void setUserId(long ptr, String username);
32 private native void setHa1(long ptr, String ha1);
33 private native String getUserId(long ptr);
34 private native String getHa1(long ptr);
36 protected LinphoneAuthInfoImpl(String username,String password, String realm) {
37 this(username,null,password,null,null);
39 protected LinphoneAuthInfoImpl(String username, String userid, String passwd, String ha1,String realm) {
40 nativePtr = newLinphoneAuthInfo();
41 this.setUsername(username);
42 this.setUserId(userid);
43 this.setPassword(passwd);
46 protected void finalize() throws Throwable {
49 public String getPassword() {
50 return getPassword (nativePtr);
52 public String getRealm() {
53 return getRealm (nativePtr);
55 public String getUsername() {
56 return getUsername (nativePtr);
58 public void setPassword(String password) {
59 setPassword(nativePtr,password);
61 public void setRealm(String realm) {
62 setRealm(nativePtr,realm);
64 public void setUsername(String username) {
65 setUsername(nativePtr,username);
68 public String getUserId() {
69 return getUserId(nativePtr);
72 public void setUserId(String userid) {
73 setUserId(nativePtr,userid);
77 public String getHa1() {
78 return getHa1(nativePtr);
81 public void setHa1(String ha1) {
82 setHa1(nativePtr,ha1);