org.sixdml.excelon
Class xlnSixdmlCollectionManagementService

java.lang.Object
  |
  +--org.sixdml.excelon.xlnServiceBase
        |
        +--org.sixdml.excelon.xlnSixdmlCollectionManagementService
All Implemented Interfaces:
CollectionManagementService, Configurable, Service, SixdmlCollectionManagementService, SixdmlConstants

public class xlnSixdmlCollectionManagementService
extends xlnServiceBase
implements SixdmlCollectionManagementService, SixdmlConstants

  
 xlnSixdmlCollectionManagementService.java

 Manages the creation and deletion of collections in the database. 

 Created: Mon Jan 14 22:58:23 2002

 

Version:
1.0
Author:
Dare Obasanjo

Field Summary
private  org.sixdml.excelon.xlnSixdmlCollection collection
          The underlying collection object that provides the context for this service.
 
Fields inherited from class org.sixdml.excelon.xlnServiceBase
properties
 
Fields inherited from interface org.sixdml.SixdmlConstants
SIXDML_NS, SIXDML_VERSION
 
Constructor Summary
private xlnSixdmlCollectionManagementService()
          Default constructor private because an instance of this class must always be instantiated with an underlying eXcelon DXE Session object.
(package private) xlnSixdmlCollectionManagementService(org.sixdml.excelon.xlnSixdmlCollection collection)
          Initializes the service.
 
Method Summary
 Collection createCollection(String name)
          Creates a new Collection in the database.
 Collection createCollection(String name, URL schemaFile)
          Creates a collection that is constrained by a particular schema.
 String getName()
          Gets the name of the service.
static void main(String[] args)
          Main used for testing class.
 void removeCollection(String name)
          Removes a collection from the database.
 
Methods inherited from class org.sixdml.excelon.xlnServiceBase
getProperty, getVersion, setCollection, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmldb.api.base.Service
getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Field Detail

collection

private org.sixdml.excelon.xlnSixdmlCollection collection
The underlying collection object that provides the context for this service.

Constructor Detail

xlnSixdmlCollectionManagementService

private xlnSixdmlCollectionManagementService()
Default constructor private because an instance of this class must always be instantiated with an underlying eXcelon DXE Session object.


xlnSixdmlCollectionManagementService

xlnSixdmlCollectionManagementService(org.sixdml.excelon.xlnSixdmlCollection collection)
Initializes the service.

Parameters:
collection - the collection associated with this object.
Method Detail

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
Specified by:
getName in class xlnServiceBase
Returns:
the name of the service.

main

public static void main(String[] args)
                 throws Exception
Main used for testing class.

Parameters:
args - IGNORED
Exception