1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.nxqd.xmldb;
17
18 import java.util.logging.Level;
19 import java.util.logging.Logger;
20
21 import net.sf.nxqd.xmldb.NxqdDatabase;
22 import net.sf.nxqd.NxqdContainer;
23 import net.sf.nxqd.NxqdException;
24
25 import org.xmldb.api.base.Collection;
26 import org.xmldb.api.base.ErrorCodes;
27 import org.xmldb.api.base.XMLDBException;
28 import org.xmldb.api.modules.CollectionManagementService;
29
30 /**
31 * @author <a href="mailto:webhiker@sourceforge.net">webhiker</a>
32 * @version 1.0
33 */
34 public class NxqdCollectionManagementService extends NxqdService
35 implements CollectionManagementService {
36
37 private static Logger logger = Logger.getLogger(NxqdCollectionManagementService.class.getName());
38
39 protected NxqdCollectionManagementService(NxqdCollection parent) throws XMLDBException {
40 super("NxqdCollectionManagementService","1.0");
41 setCollection(parent);
42 }
43
44 /**
45 * @see org.xmldb.api.modules.CollectionManagementService#createCollection(java.lang.String)
46 */
47 public Collection createCollection(String name) throws XMLDBException {
48 logger.fine("Creating child "+name+" of parent "+getCollection().getName());
49 return ((NxqdCollection)getCollection()).getDatabase().createCollection(name,
50 (NxqdCollection)getCollection());
51 }
52
53 /**
54 * @see org.xmldb.api.modules.CollectionManagementService#removeCollection(java.lang.String)
55 */
56 public void removeCollection(String name) throws XMLDBException {
57 ((NxqdCollection)getCollection()).getDatabase().deleteCollection(name,
58 (NxqdCollection)getCollection());
59 }
60
61 }