org.jSyncManager.API.Protocol.Util
Class DLPRecord
java.lang.Objectorg.jSyncManager.API.Protocol.Util.DLPRecord
- Serializable
public class DLPRecord
extends java.lang.Object
implements Serializable
A class to hold a handheld record of information.
This class holds a single record of data.
static byte | ARCHIVED- A flag to denote that this record is flagged for archival.
|
static byte | BUSY- A flag to denote that this record is busy.
|
static byte | DATA_INCLUDED- A flag to denote that this record includes data.
|
static byte | DELETED- A flag to denote that this record has been deleted.
|
static byte | DELETE_ALL_IN_CATEGORY- A flag to signify that all records in the specified category of the
specified database should be deleted during a record delete operation.
|
static byte | DELETE_ALL_RECORDS- A flag to signify that all records in the specified database should be
deleted during a record delete operation.
|
static byte | DIRTY- A flag to denote that this record is dirty.
|
static byte | SECRET- A flag to denote that this record is secret.
|
static byte | SORT_DATABASE- A flag to denote that the database is sorted.
|
protected byte | attributes- A field to store this records attributes bitmap.
|
protected byte | category- A field to store this records category ID.
|
protected byte[] | data- A field to store this records data array.
|
protected char | index- A field to store this records index within its database.
|
protected byte[] | inputData- A byte array to hold the input data array.
|
protected int | recordID- A field to store this records unique ID number.
|
protected char | recordSize- A field to store the size of this record.
|
DLPRecord()- Empty constructor.
|
DLPRecord(inputData[] )- Create a new DLPRecord object from an array of bytes.
|
DLPRecord(DLPRecord dlp)- Create a new DLPRecord object from another DLPRecord type.
|
void | addAttribute(byte flag)- Adds an attribute to the attributes bitmap.
|
boolean | checkAttribute(byte value)- Checks wether or not the specified attribute is present in this record.
|
void | clearAttribute(byte flag)- Clears the specified attribute.
|
protected void | generateData()- Gererates a data array from a set of object fields.
|
byte | getAttributes()- Retreives the attributes for this record.
|
byte | getCategory()- Retreives the category ID for this record.
|
byte[] | getData()- Retreives the data for this record.
|
char | getIndex()- Retreives the index for this record.
|
int | getRecordID()- Retreives the record ID for this record.
|
char | getRecordSize()- Retreives the reported size for this record.
|
protected void | parseFields()- Parses the record data array into a set of fields.
|
void | setAttributes(byte flags)- Set the attributes to the specified value.
|
void | setCategory(byte categoryID)- Set the category ID for this record.
|
void | setData(inputData[] )- Set the data byte array for this record.
|
void | setIndex(char i)- Set the index for this record.
|
void | setRecordID(int id)- Set the unique record ID for this record.
|
void | setRecordSize(char size)- Set the record size for this record.
|
String | toString()- Converts this record to a human-readable hexdump String.
|
ARCHIVED
public static final byte ARCHIVED
A flag to denote that this record is flagged for archival.
BUSY
public static final byte BUSY
A flag to denote that this record is busy.
DATA_INCLUDED
public static final byte DATA_INCLUDED
A flag to denote that this record includes data.
This flag is included for compatibility with old handhelds.
Typically you won't need to set this if your record includes data.
DELETED
public static final byte DELETED
A flag to denote that this record has been deleted.
DELETE_ALL_IN_CATEGORY
public static final byte DELETE_ALL_IN_CATEGORY
A flag to signify that all records in the specified category of the
specified database should be deleted during a record delete operation.
DELETE_ALL_RECORDS
public static final byte DELETE_ALL_RECORDS
A flag to signify that all records in the specified database should be
deleted during a record delete operation.
DIRTY
public static final byte DIRTY
A flag to denote that this record is dirty.
Dirty records are those that have been added, modified, or deleted
since the last synchronization. To test to see if it's been deleted,
check the deleted attribute.
SECRET
public static final byte SECRET
A flag to denote that this record is secret.
SORT_DATABASE
public static final byte SORT_DATABASE
A flag to denote that the database is sorted.
attributes
protected byte attributes
A field to store this records attributes bitmap.
category
protected byte category
A field to store this records category ID.
data
protected byte[] data
A field to store this records data array.
index
protected char index
A field to store this records index within its database.
inputData
protected byte[] inputData
A byte array to hold the input data array.
recordID
protected int recordID
A field to store this records unique ID number.
recordSize
protected char recordSize
A field to store the size of this record.
DLPRecord
public DLPRecord()
Empty constructor. This is useful for creating a new record entry.
DLPRecord
public DLPRecord(inputData[] )
throws DLPFunctionCallExceptionCreate a new DLPRecord object from an array of bytes.
DLPRecord
public DLPRecord(DLPRecord dlp)
Create a new DLPRecord object from another DLPRecord type.
dlp - the DLP record to make a copy object of.
addAttribute
public void addAttribute(byte flag)
Adds an attribute to the attributes bitmap.
checkAttribute
public boolean checkAttribute(byte value)
Checks wether or not the specified attribute is present in this record.
value - the attribute to be tested.
- true if the specified flag is present, false otherwise.
clearAttribute
public void clearAttribute(byte flag)
Clears the specified attribute.
flag - the attribute flag to clear.
generateData
protected void generateData()
Gererates a data array from a set of object fields.
Subclasses that parse record data should implement this method so they can
reconstruct the data byte array from their object fields so it can be written back
to the handheld. In this class, this method has a null implementation.
getAttributes
public byte getAttributes()
Retreives the attributes for this record.
- the attributes for this record.
getCategory
public byte getCategory()
Retreives the category ID for this record.
- the category ID for this record.
getData
public final byte[] getData()
Retreives the data for this record.
- the data for this record, as an array of bytes.
getIndex
public char getIndex()
Retreives the index for this record.
- the index for this record.
getRecordID
public int getRecordID()
Retreives the record ID for this record.
- the record ID for this record.
getRecordSize
public char getRecordSize()
Retreives the reported size for this record.
Due to the need for byte alignment, the value reported here and the number of bytes
in the data array may differ.
- the reported size for this record.
parseFields
protected void parseFields()
throws ParseExceptionParses the record data array into a set of fields.
This method should be implemented by subclasses. For this class, it uses
a null implementation, as we don't have anything to parse.
setAttributes
public void setAttributes(byte flags)
Set the attributes to the specified value.
flags - the attribute bitmap to use.
setCategory
public void setCategory(byte categoryID)
Set the category ID for this record.
categoryID - the category ID for this record.
setData
public void setData(inputData[] )
throws ParseExceptionSet the data byte array for this record.
setIndex
public void setIndex(char i)
Set the index for this record.
i - the index for this record.
setRecordID
public void setRecordID(int id)
Set the unique record ID for this record.
id - the unique record ID for this record.
setRecordSize
public void setRecordSize(char size)
Set the record size for this record.
size - the record size for this record.
toString
public String toString()
Converts this record to a human-readable hexdump String.
- this record as a human-readable hexdump String.