1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.search.messaging;
21  
22  import com.liferay.portal.kernel.search.Document;
23  import com.liferay.portal.kernel.search.Query;
24  import com.liferay.portal.kernel.search.Sort;
25  
26  /**
27   * <a href="SearchRequest.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Bruno Farache
30   *
31   */
32  public class SearchRequest {
33  
34      public static final String COMMAND_ADD = "ADD";
35  
36      public static final String COMMAND_DELETE = "DELETE";
37  
38      public static final String COMMAND_DELETE_PORTLET_DOCS =
39          "DELETE_PORTLET_DOCS";
40  
41      public static final String COMMAND_INDEX_ONLY = "INDEX_ONLY";
42  
43      public static final String COMMAND_REGISTER = "REGISTER";
44  
45      public static final String COMMAND_SEARCH = "SEARCH";
46  
47      public static final String COMMAND_UNREGISTER = "UNREGISTER";
48  
49      public static final String COMMAND_UPDATE = "UPDATE";
50  
51      public SearchRequest() {
52      }
53  
54      public String getCommand() {
55          return _command;
56      }
57  
58      public void setCommand(String command) {
59          _command = command;
60      }
61  
62      public long getCompanyId() {
63          return _companyId;
64      }
65  
66      public void setCompanyId(long companyId) {
67          _companyId = companyId;
68      }
69  
70      public String getId() {
71          return _id;
72      }
73  
74      public void setId(String id) {
75          _id = id;
76      }
77  
78      public Document getDocument() {
79          return _doc;
80      }
81  
82      public void setDocument(Document doc) {
83          _doc = doc;
84      }
85  
86      public Query getQuery() {
87          return _query;
88      }
89  
90      public void setQuery(Query query) {
91          _query = query;
92      }
93  
94      public Sort[] getSorts() {
95          return _sorts;
96      }
97  
98      public void setSorts(Sort[] sorts) {
99          _sorts = sorts;
100     }
101 
102     public int getStart() {
103         return _start;
104     }
105 
106     public void setStart(int start) {
107         _start = start;
108     }
109 
110     public int getEnd() {
111         return _end;
112     }
113 
114     public void setEnd(int end) {
115         _end = end;
116     }
117 
118     public String toString() {
119         StringBuilder sb = new StringBuilder();
120 
121         sb.append("{command=");
122         sb.append(_command);
123         sb.append(", companyId=");
124         sb.append(_companyId);
125         sb.append(", id=");
126         sb.append(_id);
127         sb.append(", doc=");
128         sb.append(_doc);
129         sb.append(", query=");
130         sb.append(_query);
131         sb.append(", sorts=");
132         sb.append(_sorts);
133         sb.append(", start=");
134         sb.append(_start);
135         sb.append(", end=");
136         sb.append(_end);
137         sb.append("}");
138 
139         return sb.toString();
140     }
141     private String _command;
142     private long _companyId;
143     private String _id;
144     private Document _doc;
145     private Query _query;
146     private Sort[] _sorts;
147     private int _start;
148     private int _end;
149 
150 }