1 package org.xvsm.lookup.gnutella.objects;
2
3 import java.io.Serializable;
4 import java.net.SocketAddress;
5
6 /***
7 * Class, which encapsulates the information belonging to a search request. The
8 * string to be searched for, the address of the request and the TTL (time to
9 * live) are stored in objects of this class.
10 *
11 * @author Hannu-Daniel Goiss
12 */
13 public class GnutellaRequest implements Serializable {
14 private static final long serialVersionUID = 7617232227114624538L;
15 private String searchString;
16 private SocketAddress requester;
17 private int counter = 0;
18
19 public int getCounter() {
20 return counter;
21 }
22
23 public void incCounter() {
24 this.counter++;
25 }
26
27 public GnutellaRequest(String searchString, SocketAddress requester) {
28 super();
29 this.searchString = searchString;
30 this.requester = requester;
31 }
32
33 public String getSearchString() {
34 return searchString;
35 }
36
37 public void setSearchString(String searchString) {
38 this.searchString = searchString;
39 }
40
41 public SocketAddress getRequester() {
42 return requester;
43 }
44
45 public void setRequester(SocketAddress requester) {
46 this.requester = requester;
47 }
48 }