KickJava   Java API By Example, From Geeks To Geeks.

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


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.ItemExistsException;
18 import javax.jcr.ItemNotFoundException;
19 import javax.jcr.Node;
20 import javax.jcr.PathNotFoundException;
21 import javax.jcr.RepositoryException;
22 import javax.jcr.UnsupportedRepositoryOperationException;
23 import javax.jcr.lock.LockException;
24 import javax.jcr.nodetype.ConstraintViolationException;
25 import javax.jcr.version.VersionException;
26
27
28 /**
29  * Date: Mar 29, 2005 Time: 2:57:55 PM
30  * @author Sameer Charles
31  */

32
33 public class QueryImpl implements Query {
34
35     private javax.jcr.query.Query query;
36
37     private AccessManager accessManager;
38
39     protected QueryImpl(javax.jcr.query.Query query, AccessManager accessManager) {
40         this.query = query;
41         this.accessManager = accessManager;
42     }
43
44     public QueryResult execute() throws RepositoryException {
45         javax.jcr.query.QueryResult result = this.query.execute();
46         QueryResultImpl filteredResult = new QueryResultImpl(result, this.accessManager);
47         return filteredResult;
48     }
49
50     public String JavaDoc getStatement() {
51         return this.query.getStatement();
52     }
53
54     public String JavaDoc getLanguage() {
55         return this.query.getLanguage();
56     }
57
58     public String JavaDoc getStoredQueryPath() throws ItemNotFoundException, RepositoryException {
59         return this.query.getStoredQueryPath();
60     }
61
62     public Node storeAsNode(String JavaDoc s) throws ItemExistsException, PathNotFoundException, VersionException,
63         ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
64         return this.query.storeAsNode(s);
65     }
66 }
67
Popular Tags