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