This project has retired. For details please refer to its Attic page.
OperationContext xref

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.chemistry.opencmis.client.api;
20  
21  import java.io.Serializable;
22  import java.util.Set;
23  
24  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
25  
26  /**
27   * An <code>OperationContext</code> object defines the filtering, paging and
28   * caching of an operation.
29   */
30  public interface OperationContext extends Serializable {
31  
32      /**
33       * Returns the current filter.
34       * 
35       * @return a set of <em>query names</em>
36       */
37      Set<String> getFilter();
38  
39      /**
40       * Sets the current filter.
41       * 
42       * @param propertyFilter
43       *            a set of <em>query names</em>
44       */
45      void setFilter(Set<String> propertyFilter);
46  
47      /**
48       * Sets the current filter.
49       * 
50       * @param propertyFilter
51       *            a comma separated list of <em>query names</em>
52       */
53      void setFilterString(String propertyFilter);
54  
55      /**
56       * Returns the filter extended by cmis:objectId, cmis:objectTypeId and
57       * cmis:baseTypeId.
58       */
59      String getFilterString();
60  
61      /**
62       * Returns if allowable actions should returned.
63       */
64      boolean isIncludeAllowableActions();
65  
66      /**
67       * Sets if allowable actions should returned.
68       */
69      void setIncludeAllowableActions(boolean include);
70  
71      /**
72       * Returns if ACLs should returned.
73       */
74      boolean isIncludeAcls();
75  
76      /**
77       * Sets if ACLs should returned.
78       */
79      void setIncludeAcls(boolean include);
80  
81      /**
82       * Returns which relationships should be returned.
83       */
84      IncludeRelationships getIncludeRelationships();
85  
86      /**
87       * Sets which relationships should be returned.
88       */
89      void setIncludeRelationships(IncludeRelationships include);
90  
91      /**
92       * Returns if policies should returned.
93       */
94      boolean isIncludePolicies();
95  
96      /**
97       * Sets if policies should returned.
98       */
99      void setIncludePolicies(boolean include);
100 
101     /**
102      * Returns the current rendition filter. (See CMIS spec
103      * "2.2.1.2.4.1 Rendition Filter Grammar")
104      * 
105      * @return a set of rendition filter terms
106      */
107     Set<String> getRenditionFilter();
108 
109     /**
110      * Sets the current rendition filter. (See CMIS spec
111      * "2.2.1.2.4.1 Rendition Filter Grammar")
112      * 
113      * @param renditionFilter
114      *            a set of rendition filter terms
115      */
116     void setRenditionFilter(Set<String> renditionFilter);
117 
118     /**
119      * Sets the current rendition filter. (See CMIS spec
120      * "2.2.1.2.4.1 Rendition Filter Grammar")
121      * 
122      * @param renditionFilter
123      *            a comma separated list of rendition filter terms
124      */
125     void setRenditionFilterString(String renditionFilter);
126 
127     /**
128      * Returns the current rendition filter. (See CMIS spec
129      * "2.2.1.2.4.1 Rendition Filter Grammar")
130      * 
131      * @return a comma separated list of rendition filter terms
132      */
133     String getRenditionFilterString();
134 
135     /**
136      * Returns if path segments should returned.
137      */
138     boolean isIncludePathSegments();
139 
140     /**
141      * Sets if path segments should returned.
142      */
143     void setIncludePathSegments(boolean include);
144 
145     /**
146      * Returns the order by rule for operations that return lists.
147      * 
148      * @return a comma-separated list of <em>query names</em> and the ascending
149      *         modifier "ASC" or the descending modifier "DESC" for each query
150      *         name
151      */
152     String getOrderBy();
153 
154     /**
155      * Sets the order by rule for operations that return lists.
156      * 
157      * @param orderBy
158      *            a comma-separated list of <em>query names</em> and the
159      *            ascending modifier "ASC" or the descending modifier "DESC" for
160      *            each query name
161      */
162     void setOrderBy(String orderBy);
163 
164     /**
165      * Return if caching is enabled.
166      */
167     boolean isCacheEnabled();
168 
169     /**
170      * Enables or disables the cache.
171      */
172     void setCacheEnabled(boolean cacheEnabled);
173 
174     /**
175      * Returns a key for this OperationContext object that is used for caching.
176      */
177     String getCacheKey();
178 
179     /**
180      * Set the max number of items per page for operations that return lists.
181      * 
182      * @param maxItemsPerPage
183      *            max number of items (must be >0)
184      */
185     void setMaxItemsPerPage(int maxItemsPerPage);
186 
187     /**
188      * Returns the current max number of items per page.
189      */
190     int getMaxItemsPerPage();
191 }