1
2
3
4
5
6
7 package gov.noaa.gdsg.xmldbremote.manage;
8
9 import org.apache.log4j.Logger;
10 import org.xmldb.api.base.ResourceSet;
11 import org.xmldb.api.modules.XPathQueryService;
12
13 /***
14 *
15 * @author tns
16 */
17 public class CollectionQuerier extends BaseRecordAdmin {
18
19 private static Logger log = Logger.getLogger(CollectionQuerier.class);
20
21 /*** Creates a new instance of CollectionQuerier */
22 public CollectionQuerier() {
23 }
24
25 public ResourceSet query(String xpath) throws Exception {
26 log.info("Executing query:" + xpath);
27 XPathQueryService service = (XPathQueryService)
28 this.collectionManager.getCollection().getService("XPathQueryService", "1.0");
29 ResourceSet resourceSet = service.query(xpath);
30 return resourceSet;
31 }
32
33 }