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_REGISTER = "REGISTER";
42  
43      public static final String COMMAND_SEARCH = "SEARCH";
44  
45      public static final String COMMAND_UNREGISTER = "UNREGISTER";
46  
47      public static final String COMMAND_UPDATE = "UPDATE";
48  
49      public SearchRequest() {
50      }
51  
52      public String getCommand() {
53          return _command;
54      }
55  
56      public void setCommand(String command) {
57          _command = command;
58      }
59  
60      public long getCompanyId() {
61          return _companyId;
62      }
63  
64      public void setCompanyId(long companyId) {
65          _companyId = companyId;
66      }
67  
68      public String getId() {
69          return _id;
70      }
71  
72      public void setId(String id) {
73          _id = id;
74      }
75  
76      public Document getDocument() {
77          return _doc;
78      }
79  
80      public void setDocument(Document doc) {
81          _doc = doc;
82      }
83  
84      public Query getQuery() {
85          return _query;
86      }
87  
88      public void setQuery(Query query) {
89          _query = query;
90      }
91  
92      public Sort[] getSorts() {
93          return _sorts;
94      }
95  
96      public void setSorts(Sort[] sorts) {
97          _sorts = sorts;
98      }
99  
100     public int getStart() {
101         return _start;
102     }
103 
104     public void setStart(int start) {
105         _start = start;
106     }
107 
108     public int getEnd() {
109         return _end;
110     }
111 
112     public void setEnd(int end) {
113         _end = end;
114     }
115 
116     public String toString() {
117         StringBuilder sb = new StringBuilder();
118 
119         sb.append("{command=");
120         sb.append(_command);
121         sb.append(", companyId=");
122         sb.append(_companyId);
123         sb.append(", id=");
124         sb.append(_id);
125         sb.append(", doc=");
126         sb.append(_doc);
127         sb.append(", query=");
128         sb.append(_query);
129         sb.append(", sorts=");
130         sb.append(_sorts);
131         sb.append(", start=");
132         sb.append(_start);
133         sb.append(", end=");
134         sb.append(_end);
135         sb.append("}");
136 
137         return sb.toString();
138     }
139     private String _command;
140     private long _companyId;
141     private String _id;
142     private Document _doc;
143     private Query _query;
144     private Sort[] _sorts;
145     private int _start;
146     private int _end;
147 
148 }