]> sjero.net Git - linphone/blobdiff - java/impl/org/linphone/core/LinphoneAuthInfoImpl.java
full LinphoneAuthInfo impl for Android
[linphone] / java / impl / org / linphone / core / LinphoneAuthInfoImpl.java
index 45fd8a45e23fc1b20d493eb4e4b9cc38af7fe418..dee96fe5dd4341b27faa2cfc22fa710977217c4d 100644 (file)
@@ -20,36 +20,66 @@ package org.linphone.core;
 
 class LinphoneAuthInfoImpl implements LinphoneAuthInfo {
        protected final long nativePtr;
-       private native long newLinphoneAuthInfo(String username, String userid, String passwd, String ha1,String realm);
+       private native long newLinphoneAuthInfo();
        private native void  delete(long ptr);
+       private native String getPassword(long ptr);
+       private native String getRealm(long ptr);
+       private native String getUsername(long ptr);
+       private native void setPassword(long ptr, String password);
+       private native void setRealm(long ptr, String realm);
+       private native void setUsername(long ptr, String username);
+       private native void setUserId(long ptr, String username);
+       private native void setHa1(long ptr, String ha1);
+       private native String getUserId(long ptr);
+       private native String getHa1(long ptr);
+       
        protected LinphoneAuthInfoImpl(String username,String password, String realm)  {
-               nativePtr = newLinphoneAuthInfo(username,"",password,"","");
+               this(username,null,password,null,null);
+       }
+       protected LinphoneAuthInfoImpl(String username, String userid, String passwd, String ha1,String realm)  {
+               nativePtr = newLinphoneAuthInfo();
+               this.setUsername(username);
+               this.setUserId(userid);
+               this.setPassword(passwd);
+               this.setHa1(ha1);
        }
        protected void finalize() throws Throwable {
                delete(nativePtr);
        }
        public String getPassword() {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               return getPassword (nativePtr);
        }
        public String getRealm() {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               return getRealm (nativePtr);
        }
        public String getUsername() {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               return getUsername (nativePtr);
        }
        public void setPassword(String password) {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               setPassword(nativePtr,password);
        }
        public void setRealm(String realm) {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               setRealm(nativePtr,realm);
        }
        public void setUsername(String username) {
-               // TODO Auto-generated method stub
-               throw new RuntimeException("not implemeneted yet");
+               setUsername(nativePtr,username);
+       }
+       @Override
+       public String getUserId() {
+               return getUserId(nativePtr);
+       }
+       @Override
+       public void setUserId(String userid) {
+               setUserId(nativePtr,userid);
+               
+       }
+       @Override
+       public String getHa1() {
+               return getHa1(nativePtr);
+       }
+       @Override
+       public void setHa1(String ha1) {
+               setHa1(nativePtr,ha1);
+               
        }
 }