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