|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.dbcreate2.CreateTestXindiceDB
This program will create three new Xindice collections called /db/example_{traveller,destination,booking} and populate them with a total of 40,000 entries. 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 CollectionPrefix: example_ NumberOfDocumentsToCreate: 40000
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE |
protected java.lang.String |
mBookingCollection |
protected java.lang.String |
mCollectionPrefix |
protected TravelDataCreator |
mData Generates the test data. |
protected java.lang.String |
mDatabase |
protected java.lang.String |
mDBMS |
protected java.lang.String |
mDestinationCollection |
protected java.lang.String |
mDriver |
protected int |
mEntries |
protected java.lang.String |
mHost |
protected int |
mNumberOfBookings |
protected int |
mNumberOfDestinations |
protected int |
mNumberOfTravellers |
protected java.lang.String |
mPassword |
protected java.lang.String |
mPort |
protected java.lang.String |
mTravellerCollection |
protected java.lang.String |
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 |
private void |
createBookingCollection(org.xmldb.api.modules.CollectionManagementService service) Creates a collection with booking data. |
private void |
createDestinationCollection(org.xmldb.api.modules.CollectionManagementService service) Creates a collection with destination data. |
private void |
createTravellerCollection(org.xmldb.api.modules.CollectionManagementService service) Creates a collection with traveller data. |
static void |
main(java.lang.String[] args) |
private java.lang.String |
makeBookingEntry(long i) |
private java.lang.String |
makeDestinationEntry(int i) Constructs the documents for the destination collection. |
private java.lang.String |
makeTravellerEntry(int i) Constructs the entry documents for the traveller collection. |
protected void |
populateDatabase() |
protected void |
printUsage() |
protected void |
printVariables(java.lang.String prefix) |
private void |
removeCollectionIfExists(org.xmldb.api.modules.CollectionManagementService service, org.xmldb.api.base.Collection parent, java.lang.String collectionName) Remove a collection. |
protected void |
setDefaultSettings() |
protected boolean |
setupArguments(java.lang.String[] args) Configures the class based on string arguments. |
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
protected final TravelDataCreator mData
protected java.lang.String mDBMS
protected java.lang.String mDriver
protected java.lang.String mHost
protected java.lang.String mPort
protected java.lang.String mDatabase
protected java.lang.String mUsername
protected java.lang.String mPassword
protected java.lang.String mCollectionPrefix
protected java.lang.String mTravellerCollection
protected java.lang.String mDestinationCollection
protected java.lang.String mBookingCollection
protected int mEntries
protected int mNumberOfTravellers
protected int mNumberOfDestinations
protected int mNumberOfBookings
Constructor Detail |
public CreateTestXindiceDB(java.lang.String[] args)
args
- arguments passed to the main method.Method Detail |
public static void main(java.lang.String[] args)
protected void setDefaultSettings()
protected void populateDatabase() throws CreateTestDatabaseException
CreateTestDatabaseException
private void removeCollectionIfExists(org.xmldb.api.modules.CollectionManagementService service, org.xmldb.api.base.Collection parent, java.lang.String collectionName) throws org.xmldb.api.base.XMLDBException
service
- CollectionManagementService of the parent collectionparent
- the parent collectioncollectionName
- the name of the collection to be removedorg.xmldb.api.base.XMLDBException
private void createTravellerCollection(org.xmldb.api.modules.CollectionManagementService service) throws org.xmldb.api.base.XMLDBException
service
- CollectionManagementService
of the parent collectionorg.xmldb.api.base.XMLDBException
private void createDestinationCollection(org.xmldb.api.modules.CollectionManagementService service) throws org.xmldb.api.base.XMLDBException
service
- CollectionManagementService
of the parent collectionorg.xmldb.api.base.XMLDBException
private void createBookingCollection(org.xmldb.api.modules.CollectionManagementService service) throws org.xmldb.api.base.XMLDBException
service
- CollectionManagementService
of the parent collectionorg.xmldb.api.base.XMLDBException
private void closeCollection(org.xmldb.api.base.Collection child)
private java.lang.String makeTravellerEntry(int i)
i
- document idString
private java.lang.String makeDestinationEntry(int i)
i
- number of documentString
private java.lang.String makeBookingEntry(long i)
protected boolean setupArguments(java.lang.String[] args)
protected void printUsage()
protected void printVariables(java.lang.String prefix)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |