Dataman
Class Dataman

java.lang.Object
  extended by Dataman.Dataman

public class Dataman
extends java.lang.Object

Global entries for Dataman programs. The master and workfile records and the last accessed index are made available here. The master record is where data retrieved from indexes are stored. The workfile record is where data from the command line workfile is stored. Also, methods to initialize the two types of Dataman processes. There are two types of Dataman processes. The first is the end sort program, where new indexes are built. The second is the file edit program, where records are retrieved, perused, and/or modified. makeIndex initializes the sort program, and initDataman initializes the edit programs.


Field Summary
static DatamanIndex cur_index
          This is a reference to the last operated on index.
static DatamanRecord master
          This is the master data record.
static DatamanRecord workfile
          This is the workfile record.
 
Constructor Summary
Dataman()
          Construct an instance to reference Dataman.
 
Method Summary
static boolean commit()
          Commit a transaction.
static void initDataman(java.lang.String ClassName, java.lang.String[] argv)
          Initialize a Dataman file edit routine.
static DatamanIndex makeIndex(java.lang.String ClassName, java.lang.String[] argv)
          Initialize a Dataman end sort routine.
static void rollback()
          Roll back a transaction.
static void startTransaction()
          Start a new transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

master

public static DatamanRecord master
This is the master data record. This is where any data record is stored from any of the index routines.


workfile

public static DatamanRecord workfile
This is the workfile record. This is where the data record for the named work file is stored.


cur_index

public static DatamanIndex cur_index
This is a reference to the last operated on index.

Constructor Detail

Dataman

public Dataman()
Construct an instance to reference Dataman.

Method Detail

initDataman

public static void initDataman(java.lang.String ClassName,
                               java.lang.String[] argv)
Initialize a Dataman file edit routine. This is the first function to call to initialize the dataman system. The arugments are the main class name (what you want displayed in error messages), and the argv argument vector that was passed to main. The calling sequence is currently: java ClassName -h hostname -r root workfile. where hostname is the name of the server hosting the database, root is the root directory of the database, and workfile is the name of the workfile.

Parameters:
ClassName - - name of the calling class
argv - - the argument vector to main()
Throws:
DatamanRuntimeException

makeIndex

public static DatamanIndex makeIndex(java.lang.String ClassName,
                                     java.lang.String[] argv)
Initialize a Dataman end sort routine. This is the first function to call to initialize a dataman sort program. The arugments are the main class name (what you want displayed in error messages), and the argv argument vector that was passed to main. The calling sequence is currently: java ClassName -h hostname -r root [-size] idxname file_1, file_2, ... file_n where hostname is the name of the server hosting the database, root is the root directory of the database, size is the maximum key length allowed in the index (1-32), idxname is the index to create, and each subsequent file name are the files to sort through and build the index on.

Parameters:
ClassName - - name of the calling class
argv - - the argument vector to main()
Throws:
DatamanRuntimeException

startTransaction

public static void startTransaction()
Start a new transaction. Any changes to a database between this command and either commit or rollback will not be committed to the database until the commit method is called.

Throws:
DatamanRuntimeException

rollback

public static void rollback()
Roll back a transaction. This command terminates a transaction and does not commit any part of the transaction to the database.

Throws:
DatamanRuntimeException

commit

public static boolean commit()
Commit a transaction. This command terminates a transaction and commits the transaction to the database. It is atomic. If any part of the transaction fails, all parts fail and it is as if a rollback were called.

Returns:
true if the commit was successful, else false.
Throws:
DatamanRuntimeException