KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > core > search > QueryManagerImpl


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.core.search;
14
15 import info.magnolia.cms.security.AccessManager;
16
17 import javax.jcr.Node;
18 import javax.jcr.RepositoryException;
19 import javax.jcr.query.InvalidQueryException;
20
21
22 /**
23  * Date: Mar 29, 2005 Time: 2:54:21 PM
24  * @author Sameer Charles
25  */

26
27 public class QueryManagerImpl implements QueryManager {
28
29     private javax.jcr.query.QueryManager queryManager;
30
31     private AccessManager accessManager;
32
33     protected QueryManagerImpl(javax.jcr.query.QueryManager queryManager, AccessManager accessManager) {
34         this.queryManager = queryManager;
35         this.accessManager = accessManager;
36     }
37
38     public Query createQuery(String JavaDoc s, String JavaDoc s1) throws InvalidQueryException, RepositoryException {
39         javax.jcr.query.Query query = this.queryManager.createQuery(s, s1);
40         return (new QueryImpl(query, this.accessManager));
41     }
42
43     public Query getQuery(Node node) throws InvalidQueryException, RepositoryException {
44         javax.jcr.query.Query query = this.queryManager.getQuery(node);
45         return (new QueryImpl(query, this.accessManager));
46     }
47
48     public String JavaDoc[] getSupportedQueryLanguages() throws RepositoryException {
49         return this.queryManager.getSupportedQueryLanguages();
50     }
51
52 }
53
Popular Tags