Class XindiceOperations

java.lang.Object
  |
  +--XindiceOperations

public class XindiceOperations
extends java.lang.Object

This class has methods for using Xindice


Constructor Summary
XindiceOperations()
           
 
Method Summary
 void addDocument(java.lang.String collectionName, java.lang.String documentURL, java.lang.String documentId)
          Adds a XML document to the XML database
 void createCollection(java.lang.String colName)
          Creates a collection in the XML database
 void deleteCollection(java.lang.String colName)
          Deletes a collection in the XML database
 void deleteDocument(java.lang.String collectionName, java.lang.String documentId)
          Deletes a XML document to the XML database
 java.lang.String getResourceByNumber(java.lang.String collectionName, int number)
          Gets a resource from the collection
 int getResourceCount(java.lang.String collectionName)
          Returns no of resources in the collection
static void main(java.lang.String[] args)
          Used for testing
static java.lang.String readFileFromDisk(java.lang.String fileName)
          Reads a file and returns the contents as a String
 void retrieveDocument(java.lang.String collectionName, java.lang.String documentId)
          Retrieves a XML document from the XML database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XindiceOperations

public XindiceOperations()
Method Detail

addDocument

public void addDocument(java.lang.String collectionName,
                        java.lang.String documentURL,
                        java.lang.String documentId)
                 throws java.lang.Exception
Adds a XML document to the XML database

java.lang.Exception

readFileFromDisk

public static java.lang.String readFileFromDisk(java.lang.String fileName)
                                         throws java.lang.Exception
Reads a file and returns the contents as a String

Returns:
String File contents
java.lang.Exception

createCollection

public void createCollection(java.lang.String colName)
                      throws java.lang.Exception
Creates a collection in the XML database

java.lang.Exception

deleteCollection

public void deleteCollection(java.lang.String colName)
                      throws java.lang.Exception
Deletes a collection in the XML database

java.lang.Exception

deleteDocument

public void deleteDocument(java.lang.String collectionName,
                           java.lang.String documentId)
                    throws java.lang.Exception
Deletes a XML document to the XML database

java.lang.Exception

retrieveDocument

public void retrieveDocument(java.lang.String collectionName,
                             java.lang.String documentId)
                      throws java.lang.Exception
Retrieves a XML document from the XML database

java.lang.Exception

getResourceCount

public int getResourceCount(java.lang.String collectionName)
                     throws java.lang.Exception
Returns no of resources in the collection

Returns:
int Number of resources in the collection
java.lang.Exception

getResourceByNumber

public java.lang.String getResourceByNumber(java.lang.String collectionName,
                                            int number)
                                     throws java.lang.Exception
Gets a resource from the collection

Returns:
String Resource as string
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Used for testing

java.lang.Exception