|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.dbcreate.CreateTestDB | +--uk.org.ogsadai.client.dbcreate.CreateTestExistDB
This program will create a new eXist 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.CreateTestExistDB [-driverclass eXistDriverClass]
[-host eXistHostName] [-port eXistPortNumber] [-database eXistDatabaseName]
[-collectionname NameOfCollectionToCreate] [-documents NumberOfDocumentsToCreate]
Default Settings:
eXistDriverClass: org.exist.xmldb.DatabaseImpl
eXistHostName: localhost
eXistPortNumber: 8080
eXistDatabaseName: db
NameOfCollectionToCreate: littleblackbook
NumberOfDocumentsToCreate: 10000
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 | |
CreateTestExistDB(java.lang.String[] args)
Creates and populates eXist 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 |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.String mNewCollectionName
Constructor Detail |
public CreateTestExistDB(java.lang.String[] args)
args
- arguments passed to the main method.Method Detail |
public static void main(java.lang.String[] args)
protected void setDefaultSettings()
CreateTestDB
setDefaultSettings
in class CreateTestDB
protected void populateDatabase() throws CreateTestDatabaseException
CreateTestDB
populateDatabase
in class CreateTestDB
CreateTestDatabaseException
private void closeCollection(org.xmldb.api.base.Collection child)
private java.lang.String makeDocument(int i)
protected boolean setupArguments(java.lang.String[] args)
setupArguments
in class CreateTestDB
args
- the argument string
protected void printUsage()
CreateTestDB
printUsage
in class CreateTestDB
protected void printVariables(java.lang.String prefix)
CreateTestDB
printVariables
in class CreateTestDB
prefix
- the displayed settings begin with "prefix
Settings:"
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |