Logo Search packages:      
Sourcecode: rserve version File versions  Download package

void org::rosuda::JRclient::Rconnection::login ( String  user,
String  pwd 
) throws RSrvException [inline]

login using supplied user/pwd. Note that login must be the first command if used

Parameters:
user username
pwd password
Returns:
returns true on success

Definition at line 342 of file Rconnection.java.

References AT_crypt, org::rosuda::JRclient::Rpacket::isOk(), and org::rosuda::JRclient::Rtalk::request().

                                                                    {
            if (!authReq) return;
            if (!connected || rt==null)
                  throw new RSrvException(this,"Not connected");
            if (authType==AT_crypt) {
                  if (Key==null) Key="rs";
                  Rpacket rp=rt.request(Rtalk.CMD_login,user+"\n"+jcrypt.crypt(Key,pwd));
                  if (rp!=null && rp.isOk()) return;
                  try { s.close(); } catch(Exception e) {};
                  is=null; os=null; s=null; connected=false;
            throw new RSrvException(this,"login failed",rp);
            }
            Rpacket rp=rt.request(Rtalk.CMD_login,user+"\n"+pwd);
            if (rp!=null && rp.isOk()) return;
            try {s.close();} catch (Exception e) {};
            is=null; os=null; s=null; connected=false;
        throw new RSrvException(this,"login failed",rp);
    }


Generated by  Doxygen 1.6.0   Back to index