org.jSyncManager.API.Protocol.Util

Class DLPDatabaseInfo

Implemented Interfaces:
Serializable

public class DLPDatabaseInfo
extends java.lang.Object
implements Serializable

A class to store information on a handheld database. This class holds the information on a single database.

Field Summary

static byte
EXCLUDE_FROM_SYNC
A flag to denote that this database should be excluded from synchronization.
static byte
RAM_BASED
A flag to denote that this database is RAM based.
static char
UNKNOWN_DB_INDEX
A value denoting an unknown database index.

Constructor Summary

DLPDatabaseInfo()
DLPDatabaseInfo default constructor.
DLPDatabaseInfo(dbInfoData[] )
DLPDatabaseInfo constructor, given the byte array data block.

Method Summary

boolean
checkDatabaseFlag(char c)
Check the database flags against a char indicator to see if the flag is set.
boolean
checkMiscFlag(byte byte0)
Check the Misc flags against a byte indicator to see if the flag is set.
DLP_Date
getBackupTime()
Return the last backup time in DLP_Date format.
DLP_Date
getCreationTime()
Return the creation time of this database in DLP_Date format.
int
getCreator()
Return the creator ID for this database as an int value.
String
getCreatorID()
Return the creator ID for this database as an String value.
char
getDatabaseFlags()
Return the database flags as a char value.
char
getDatabaseIndex()
Return the database index as a char value.
byte
getMiscFlags()
Return the Misc flags as a byte value.
int
getModificationNumber()
Return the modification number of this database as an int value.
DLP_Date
getModificationTime()
Return the last modification time of this database as a DLP_Date object.
String
getName()
Return the name of this database as a String value.
int
getType()
Return the type of this database as an int value.
String
getTypeID()
Return the type ID of this database as a String value.
int
getVersion()
Return the version of this database as an int value.
boolean
hasDatabaseFlag(char testFlag)
Tests to see wether or not this DLPDatabaseInfo object has the specified database flag(s) set.
boolean
hasMiscFlag(byte testFlag)
Tests to see wether or not this DLPDatabaseInfo object has the specified misc flag(s) set.
void
setBackupTime(DLP_Date dlp_date)
Set the backup time from a DLP_Date object.
void
setCreationTime(DLP_Date dlp_date)
Set the creation time from a DLP_Date object.
void
setCreator(int i)
Set the creator ID from an int value.
void
setCreatorID(String id)
Set the creator of this database from a four-chcracter String value.
void
setDatabaseFlags(char c)
Set the database flags from a char value.
void
setDatabaseIndex(char c)
Set the database index from a char value.
void
setMiscFlags(byte flags)
Set the misc flags from a byte value.
void
setModificationNumber(int i)
Set the modification number from an int value.
void
setModificationTime(DLP_Date dlp_date)
Set the modification number from an DLP_Date value.
void
setName(String s)
Set the name of this database.
void
setType(int i)
Set the type of this database from an int value.
void
setTypeID(String id)
Set the type of this database from a four-chcracter String value.
void
setVersion(int i)
Set the version of this database from an int value.
void
setupToInstallNewer()
Prepares this database info object to be used when writing a database that is already open.
String
toString()
Return a String representation of this database info object.

Field Details

EXCLUDE_FROM_SYNC

public static final byte EXCLUDE_FROM_SYNC
A flag to denote that this database should be excluded from synchronization.
Field Value:
-128

RAM_BASED

public static final byte RAM_BASED
A flag to denote that this database is RAM based.
Field Value:
64

UNKNOWN_DB_INDEX

public static final char UNKNOWN_DB_INDEX
A value denoting an unknown database index.
Field Value:
'\uffff'

Constructor Details

DLPDatabaseInfo

public DLPDatabaseInfo()
DLPDatabaseInfo default constructor.

DLPDatabaseInfo

public DLPDatabaseInfo(dbInfoData[] )
            throws DLPFunctionCallException
DLPDatabaseInfo constructor, given the byte array data block.
Parameters:
Throws:
DLPFunctionCallException - if a parsing error occurs.

Method Details

checkDatabaseFlag

public boolean checkDatabaseFlag(char c)
Check the database flags against a char indicator to see if the flag is set.
Parameters:
c - char flag to check if set.
Returns:
boolean.

checkMiscFlag

public boolean checkMiscFlag(byte byte0)
Check the Misc flags against a byte indicator to see if the flag is set.
Parameters:
byte0 - byte flag to check if set.
Returns:
boolean.

getBackupTime

public DLP_Date getBackupTime()
Return the last backup time in DLP_Date format.
Returns:
DLP_Date.

getCreationTime

public DLP_Date getCreationTime()
Return the creation time of this database in DLP_Date format.
Returns:
DLP_Date.

getCreator

public int getCreator()
Return the creator ID for this database as an int value.
Returns:
int.

getCreatorID

public String getCreatorID()
Return the creator ID for this database as an String value.
Returns:
java.lang.String.

getDatabaseFlags

public char getDatabaseFlags()
Return the database flags as a char value.
Returns:
char databaseFlags.

getDatabaseIndex

public char getDatabaseIndex()
Return the database index as a char value.
Returns:
char databaseIndex.

getMiscFlags

public byte getMiscFlags()
Return the Misc flags as a byte value.
Returns:
byte miscFlags.

getModificationNumber

public int getModificationNumber()
Return the modification number of this database as an int value.
Returns:
int modificationNumber.

getModificationTime

public DLP_Date getModificationTime()
Return the last modification time of this database as a DLP_Date object.
Returns:
DLP_Date modificationTime.

getName

public String getName()
Return the name of this database as a String value.
Returns:
java.lang.String name.

getType

public int getType()
Return the type of this database as an int value.
Returns:
int type.

getTypeID

public String getTypeID()
Return the type ID of this database as a String value.
Returns:
java.lang.String type ID.

getVersion

public int getVersion()
Return the version of this database as an int value.
Returns:
int version.

hasDatabaseFlag

public boolean hasDatabaseFlag(char testFlag)
Tests to see wether or not this DLPDatabaseInfo object has the specified database flag(s) set.
Parameters:
testFlag - the flag(s) to test.
Returns:
true if the specified flag(s) are set, false otherwise.

hasMiscFlag

public boolean hasMiscFlag(byte testFlag)
Tests to see wether or not this DLPDatabaseInfo object has the specified misc flag(s) set.
Parameters:
testFlag - the flag(s) to test.
Returns:
true if the specified flag(s) are set, false otherwise.

setBackupTime

public void setBackupTime(DLP_Date dlp_date)
Set the backup time from a DLP_Date object.
Parameters:
dlp_date - DLP_Date object.

setCreationTime

public void setCreationTime(DLP_Date dlp_date)
Set the creation time from a DLP_Date object.
Parameters:
dlp_date - DLP_Date object.

setCreator

public void setCreator(int i)
Set the creator ID from an int value.
Parameters:
i - int value of new creator ID.

setCreatorID

public void setCreatorID(String id)
Set the creator of this database from a four-chcracter String value. If the String exceeds 4 characters, only the first four will be used.
Parameters:
id - the named creator identifier.

setDatabaseFlags

public void setDatabaseFlags(char c)
Set the database flags from a char value.
Parameters:
c - char value of database flags.

setDatabaseIndex

public void setDatabaseIndex(char c)
Set the database index from a char value.
Parameters:
c - char value of new database index.

setMiscFlags

public void setMiscFlags(byte flags)
Set the misc flags from a byte value.
Parameters:
flags - byte value of misc flags.

setModificationNumber

public void setModificationNumber(int i)
Set the modification number from an int value.
Parameters:
i - int value of new modification number.

setModificationTime

public void setModificationTime(DLP_Date dlp_date)
Set the modification number from an DLP_Date value.
Parameters:
dlp_date - new DLP_Date modification time value.

setName

public void setName(String s)
Set the name of this database.
Parameters:
s - String new name.

setType

public void setType(int i)
Set the type of this database from an int value.
Parameters:
i - int new type value.

setTypeID

public void setTypeID(String id)
Set the type of this database from a four-chcracter String value. If the String exceeds 4 characters, only the first four will be used.
Parameters:
id - the named type identifier.

setVersion

public void setVersion(int i)
Set the version of this database from an int value.
Parameters:
i - int new version value.

setupToInstallNewer

public void setupToInstallNewer()
Prepares this database info object to be used when writing a database that is already open. If this database is already open on the handheld, set its write flags to install newer, and modify its name by either adding or removing a space from the end.

toString

public String toString()
Return a String representation of this database info object.
Returns:
String.