uk.org.ogsadai.client.dbcreate
Class CreateTestXindiceDB

java.lang.Object
  |
  +--uk.org.ogsadai.client.dbcreate.CreateTestDB
        |
        +--uk.org.ogsadai.client.dbcreate.CreateTestXindiceDB

public class CreateTestXindiceDB
extends CreateTestDB

This program will create a new Xindice collection called /db/littleblackbook and populate it with 10,000 address documents, consisting of a name (First, Surname) Address and telephone number. The numberOfDocuments field may be modified to generate a database with any desired number of documents. The nth document in each possible database will be identical across each one which has at least n documents (assuming Random is implemented the same way on all Java JDKs). Usage: java uk.org.ogsadai.client.dbcreate.CreateTestXindiceDB [-driverclass XindiceDriverClass] [-host XindiceHostName] [-port XindicePortNumber] [-database XindiceDatabaseName] [-collectionname NameOfCollectionToCreate] [-documents NumberOfDocumentsToCreate] Default Settings: XindiceDriverClass: org.apache.xindice.client.xmldb.DatabaseImpl XindiceHostName: localhost XindicePortNumber: 4080 XindiceDatabaseName: db NameOfCollectionToCreate: littleblackbook NumberOfDocumentsToCreate: 10000

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.lang.String mNewCollectionName
          Name of the collection to hold the test data.
 
Fields inherited from class uk.org.ogsadai.client.dbcreate.CreateTestDB
mData, mDatabase, mDBMS, mDriver, mHost, mNumberOfEntries, mPassword, mPort, mTable, mUsername
 
Constructor Summary
CreateTestXindiceDB(java.lang.String[] args)
          Creates and populates Xindice test database according to the specified settings or the default settings if no arguments are used.
 
Method Summary
private  void closeCollection(org.xmldb.api.base.Collection child)
          Closes the specified collection
static void main(java.lang.String[] args)
           
private  java.lang.String makeDocument(int i)
           
protected  void populateDatabase()
          Populates the test database with the test data.
protected  void printUsage()
          Prints the general usage instructions for a CreateTestDB client.
protected  void printVariables(java.lang.String prefix)
          Displays the settings prefixed by the specified string.
protected  void setDefaultSettings()
          Sets the default settings for the client.
protected  boolean setupArguments(java.lang.String[] args)
          Configures the class based on string arguments.
 
Methods inherited from class uk.org.ogsadai.client.dbcreate.CreateTestDB
loadDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mNewCollectionName

private java.lang.String mNewCollectionName
Name of the collection to hold the test data.

Constructor Detail

CreateTestXindiceDB

public CreateTestXindiceDB(java.lang.String[] args)
Creates and populates Xindice test database according to the specified settings or the default settings if no arguments are used.

Parameters:
args - arguments passed to the main method.
Method Detail

main

public static void main(java.lang.String[] args)

setDefaultSettings

protected void setDefaultSettings()
Description copied from class: CreateTestDB
Sets the default settings for the client.

Specified by:
setDefaultSettings in class CreateTestDB

populateDatabase

protected void populateDatabase()
                         throws CreateTestDatabaseException
Description copied from class: CreateTestDB
Populates the test database with the test data.

Specified by:
populateDatabase in class CreateTestDB
CreateTestDatabaseException

closeCollection

private void closeCollection(org.xmldb.api.base.Collection child)
Closes the specified collection


makeDocument

private java.lang.String makeDocument(int i)

setupArguments

protected boolean setupArguments(java.lang.String[] args)
Configures the class based on string arguments. Returns false if the arguments are wrong.

Overrides:
setupArguments in class CreateTestDB
Parameters:
args - the argument string
Returns:
true if the arguments are parsed correctly, otherwise false

printUsage

protected void printUsage()
Description copied from class: CreateTestDB
Prints the general usage instructions for a CreateTestDB client. This may be overridden if a client requires special usage.

Overrides:
printUsage in class CreateTestDB

printVariables

protected void printVariables(java.lang.String prefix)
Description copied from class: CreateTestDB
Displays the settings prefixed by the specified string.

Overrides:
printVariables in class CreateTestDB
Parameters:
prefix - the displayed settings begin with "prefix Settings:"