org.jSyncManager.API.Protocol.Util
Class DLPUserInfo
java.lang.Objectorg.jSyncManager.API.Protocol.Util.DLPUserInfo
- Serializable
public class DLPUserInfo
extends java.lang.Object
implements Serializable
The DLP User Information class.
This class holds the user information for the handheld.
DLPUserInfo(int uid, int vid, int hostID, String userName)- Construct a new DLP User Info object using the specified information.
|
DLPUserInfo(userBlock[] )- Create a new DLP User Info object based on the data queried from the handheld.
|
static byte[] | encodePasswordV1(String passwd)- Encodes a pasword using the pre-OS4 encoding mechanism.
|
static byte[] | encryptPasswordV4(String passwd)- Method to encrypt a password String.
|
byte[] | getEncryptedPassword()- Retreives the encrypted password for this user.
|
int | getLastHostID()- Retreives the last sync host ID.
|
Calendar | getLastSuccessfulSyncDate()- Retreives the last successful sync date.
|
Calendar | getLastSyncDate()- Retreives the last sync date.
|
int | getUserID()- Retreives the user ID for this user object.
|
String | getUserName()- Retreives the user name for this user object.
|
int | getViewerID()- Retreives the viewer ID for this user object.
|
static void | main(args[] )
|
byte[] | object2Bytes()- Convert this object to a byte array suitable for writing to the handheld.
|
void | setLastHostID(int i)- Set the last sync host ID.
|
void | setLastSyncDate(Calendar date)- Set the last sync date.
|
void | setUserID(int i)- Set the user ID.
|
void | setUserName(String s)- Set the user name.
|
void | setViewerID(int i)- Set the viewer ID.
|
String | toString()- Create a human-readable String representation of this object.
|
boolean | validatePassword(String passwd)- Validates the specified password.
|
boolean | verifyPasswordV1(String passwd)- This method is called to test to see if the supplied password matches the
password stored within this DLPUserInfo object.
|
boolean | verifyPasswordV4(String passwd)- This method is called to test to see if the supplied password matches the
password stored within this DLPUserInfo object.
|
DLPUserInfo
public DLPUserInfo(int uid,
int vid,
int hostID,
String userName)Construct a new DLP User Info object using the specified information.
uid - the user ID.vid - the viewer ID.hostID - the host PC ID.userName - the user name to create.
DLPUserInfo
public DLPUserInfo(userBlock[] )
throws DLPFunctionCallExceptionCreate a new DLP User Info object based on the data queried from the handheld.
encodePasswordV1
public static byte[] encodePasswordV1(String passwd)
Encodes a pasword using the pre-OS4 encoding mechanism.
passwd - the password to be encoded.
- an arrray of bytes containing the encoded password.
encryptPasswordV4
public static byte[] encryptPasswordV4(String passwd)
throws EncryptionNotSupportedExceptionMethod to encrypt a password String.
This method will encrypt a password in the manner used by the PalmOS v4.
passwd - the plain-text password to encrypt.
- an array of bytes containing the encrypted password.
getEncryptedPassword
public byte[] getEncryptedPassword()
Retreives the encrypted password for this user.
- the encrypted password for this user, as a byte array.
getLastHostID
public int getLastHostID()
Retreives the last sync host ID.
getLastSuccessfulSyncDate
public Calendar getLastSuccessfulSyncDate()
Retreives the last successful sync date.
- the last successful sync date.
getLastSyncDate
public Calendar getLastSyncDate()
Retreives the last sync date.
getUserID
public int getUserID()
Retreives the user ID for this user object.
- the user ID for this user object.
getUserName
public String getUserName()
Retreives the user name for this user object.
- the user name for this user object.
getViewerID
public int getViewerID()
Retreives the viewer ID for this user object.
- the viewer ID for this user object.
object2Bytes
public byte[] object2Bytes()
Convert this object to a byte array suitable for writing to the handheld.
- a byte array representing the data in this object.
setLastHostID
public void setLastHostID(int i)
Set the last sync host ID.
i - the last sync host ID.
setLastSyncDate
public void setLastSyncDate(Calendar date)
Set the last sync date.
date - the last sync date.
setUserID
public void setUserID(int i)
Set the user ID.
setUserName
public void setUserName(String s)
throws DLPFunctionCallExceptionSet the user name.
s - the user name to set.
setViewerID
public void setViewerID(int i)
Set the viewer ID.
toString
public String toString()
Create a human-readable String representation of this object.
- a human-readable String representation of this object.
validatePassword
public boolean validatePassword(String passwd)
throws EncryptionNotSupportedExceptionValidates the specified password.
This method currently works by attempting to validate the supplied password against
the stored password using both the v1 and v4 encoding mechanisms.
If either encoding mechanism matches, we'll return true.
In some future release, this behaviour will probably be changed to testing against only
the mechanism in use by the handheld.
passwd - the clear-text pasword to be tested.
- true if one of the encoding mechanisms validates, false otherwise.
verifyPasswordV1
public boolean verifyPasswordV1(String passwd)
This method is called to test to see if the supplied password matches the
password stored within this DLPUserInfo object.
Note that method uses pre-PalmOS v4 password encryption.
passwd - the clear-text password to test against the encrypted password.
- true if the password is correct, false otherwise.
verifyPasswordV4
public boolean verifyPasswordV4(String passwd)
throws EncryptionNotSupportedExceptionThis method is called to test to see if the supplied password matches the
password stored within this DLPUserInfo object.
Note that this method uses PalmOS v4 password encryption.
passwd - the clear-text password to test against the encrypted password.
- true if the password is correct, false otherwise.