org.sixdml.xindice
Class xiSixdmlCollectionManagementService
java.lang.Object
|
+--org.sixdml.xindice.xiServiceBase
|
+--org.sixdml.xindice.xiSixdmlCollectionManagementService
- All Implemented Interfaces:
- CollectionManagementService, Configurable, Service, SixdmlCollectionManagementService, SixdmlConstants
- class xiSixdmlCollectionManagementService
- extends xiServiceBase
- implements SixdmlCollectionManagementService, SixdmlConstants
xiSixdmlCollectionManagementService.java
Manages the creation and deletion of collections in the database.
- Version:
- 1.0
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
collection
private xiSixdmlCollection collection
- The underlying collection object that provides the context for this service.
xiSixdmlCollectionManagementService
xiSixdmlCollectionManagementService(xiSixdmlCollection collection)
- Initializes the service.
- Parameters:
collection - the collection that owns this CollectionManagementService
getSupportedIndexTypes
public SixdmlIndexType[] getSupportedIndexTypes()
- Gets the types of index that are supported by the this database.
- Specified by:
getSupportedIndexTypes in interface SixdmlCollectionManagementService
- Returns:
- an array of SixdmlIndexTypes which the database supports.
createIndex
public SixdmlIndex createIndex(String name,
HashMap indexFields)
throws UnsupportedIndexTypeException
- Creates an index with a name and an indexFields table in the Xindice database.
NOTE: Runtime error may occur if table not properly populated.
- Specified by:
createIndex in interface SixdmlCollectionManagementService
- Parameters:
name - the name of the index.indexFields - the index fields for the class.- Throws:
UnsupportedIndexTypeException - if the type of index requested is unsupported by the
database.
createCollection
public Collection createCollection(String name)
throws XMLDBException
- Creates a new Collection in the database.
- Specified by:
createCollection in interface CollectionManagementService
- Parameters:
name - The name of the collection to create.- Returns:
- The created Collection instance.
- Throws:
XMLDBException - if the collection already exists or
one of the collections in the path given does not exist.- See Also:
ErrorCodes.NO_SUCH_COLLECTION,
ErrorMessages.DUPLICATE_COLLECTION
createCollection
public Collection createCollection(String name,
URL schemaFile)
throws XMLDBException,
IOException,
InvalidSchemaException
- Creates a collection that is constrained by a particular schema.
- Specified by:
createCollection in interface SixdmlCollectionManagementService
- Parameters:
name - The name of the collection to create.schemaFile - the location of the schema file either on the local file
system or over the internet.- Throws:
XMLDBException - if the collection already exists or
one of the collections in the path given does not exist.IOException - if an error occurs while trying to retrieve the file.InvalidSchemaException - if the schema is invalid.- See Also:
ErrorCodes.NO_SUCH_COLLECTION,
ErrorMessages.DUPLICATE_COLLECTION
removeCollection
public void removeCollection(String name)
throws XMLDBException
- Removes a collection from the database.
- Specified by:
removeCollection in interface CollectionManagementService
- Parameters:
name - The name of the collection to delete.- Throws:
XMLDBException - if the path is invalid.- See Also:
ErrorCodes.NO_SUCH_COLLECTION
getName
public String getName()
- Gets the name of the service.
- Specified by:
getName in interface Service- Overrides:
getName in class xiServiceBase
- Returns:
- the name of the service.
main
public static void main(String[] args)
throws Exception
- Main used for testing class.
- Parameters:
args - IGNORED