/********************************************************************************
Copyright 2008 Rick Miller and Pulp Free Press - All Rights Reserved
The source code contained within this file is intended for educational
purposes only. No warranty as to the quality of the code is expressed or
implied.
Feel free to use this code provided you include the copyright notice in its
entirety.
**********************************************************************************/
using System;
public interface LegacyDatafileInterface {
///
/// Read the record indicated by the rec_no and return a string array
/// were each element contains a field value.
///
///
/// A string array populated with the contents of each field
///
String[] ReadRecord(long rec_no);
///
/// Update a record's fields. The record must be locked with the lockRecord()
/// method and the lock_token must be valid. The value for field n appears in
/// element record[n].
///
///
///
///
///
///
void UpdateRecord(long rec_no, String[] record, long lock_token);
///
/// Marks a record for deletion by setting the deleted field to 1. The lock_token
/// must be valid otherwise a SecurityException is thrown.
///
///
///
///
///
void DeleteRecord(long rec_no, long lock_token);
///
/// Creates a new datafile record and returns the record number.
///
///
/// Record number of newly created record
///
long CreateRecord(String[] record);
///
/// Locks a record for updates and deletes and returns an integer
/// representing a lock token.
///
///
/// Lock record token
///
long LockRecord(long rec_no);
///
/// Unlocks a previously locked record. The lock_token must be valid or a
/// SecurityException is thrown.
///
///
///
///
void UnlockRecord(long rec_no, long lock_token);
///
/// Searches the records in the datafile for records that match the String
/// values of search_criteria. search_criteria[n] contains the search value
/// applied against field n.
///
///
/// An array of longs containing the matched record numbers
long[] SearchRecords(String[] search_criteria);
}//end interface definition