KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > cli > services > CollectionManagementServiceImpl


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
package org.ozoneDB.xml.cli.services;
8
9 import org.xmldb.api.base.XMLDBException;
10 import org.xmldb.api.base.Collection;
11 import org.xmldb.api.base.ErrorCodes;
12
13 /**
14  * @author Per Nyfelt
15  */

16 public class CollectionManagementServiceImpl implements org.xmldb.api.modules.CollectionManagementService {
17
18     private final String JavaDoc version = "0.1";
19     private Collection collection = null;
20     //private OzoneInterface db = null;
21

22     /** Creates new CollectionManagementServiceImpl */
23     public CollectionManagementServiceImpl() {
24         //db = new Database();
25
}
26
27     /** Create a new child collection */
28     public Collection createCollection(String JavaDoc name) throws XMLDBException {
29         try {
30             // get the XMLCollection from the database
31
// create a new XMLCollection
32
// set the parent-child relationships
33
throw new XMLDBException(ErrorCodes.VENDOR_ERROR,"Not yet implemented");
34         }
35         catch (Exception JavaDoc e) {
36             throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage());
37         }
38     }
39
40     /** Remove the named collection */
41     public void removeCollection(String JavaDoc name) throws XMLDBException {
42         try {
43             throw new XMLDBException(ErrorCodes.VENDOR_ERROR,"Not implemented yet");
44             //db.deleteObject((XMLCollection)db.objectForName(name));
45
//System.out.println("CollectionStorageHelper.deleteCollection() - deleted " + name);
46
}
47         catch (Exception JavaDoc e) {
48             throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage());
49         }
50     }
51
52     /**
53      * Gets the Version attribute of the Service object
54      *
55      * @return The Version value
56      * @exception XMLDBException with expected error codes.<br />
57      * <code>ErrorCodes.VENDOR_ERROR</code> for any vendor
58      * specific errors that occur.<br />
59      */

60     public String JavaDoc getVersion() throws XMLDBException {
61         return version;
62     }
63
64     /**
65      * Returns the name associated with the Configurable object.
66      *
67      * @return the name of the object.
68      * @exception XMLDBException with expected error codes.<br />
69      * <code>ErrorCodes.VENDOR_ERROR</code> for any vendor
70      * specific errors that occur.<br />
71      */

72     public String JavaDoc getName() throws XMLDBException {
73         // return "CollectionManagementService"
74
return super.getClass().getName();
75     }
76
77     /**
78      * Sets the property <code>name</code> to have the value provided in
79      * <code>value</code>.
80      *
81      * @param name the name of the property to set.
82      * @param value the value to set for the property.
83      * @exception XMLDBException with expected error codes.<br />
84      * <code>ErrorCodes.VENDOR_ERROR</code> for any vendor
85      * specific errors that occur.<br />
86      */

87     public void setProperty(String JavaDoc name, String JavaDoc value) throws XMLDBException {
88         // do nothing
89
}
90
91     /**
92      * Sets the Collection attribute of the Service object
93      *
94      * @param col The new Collection value
95      * @exception XMLDBException with expected error codes.<br />
96      * <code>ErrorCodes.VENDOR_ERROR</code> for any vendor
97      * specific errors that occur.<br />
98      */

99     public void setCollection(Collection col) throws XMLDBException {
100         this.collection = col;
101     }
102
103     /**
104      * Returns the value of the property identified by <code>name</code>.
105      *
106      * @param name the name of the property to retrieve.
107      * @return the property value or null if no property exists.
108      * @exception XMLDBException with expected error codes.<br />
109      * <code>ErrorCodes.VENDOR_ERROR</code> for any vendor
110      * specific errors that occur.<br />
111      */

112     public String JavaDoc getProperty(String JavaDoc name) throws XMLDBException {
113         return null;
114     }
115 }
116
Popular Tags