ucr.core
Class SearchMessage

java.lang.Object
  extended byucr.core.Message
      extended byucr.core.SearchMessage

public class SearchMessage
extends Message

SearchMessage, the message for queries


Field Summary
private  java.lang.String criteria
           
 
Fields inherited from class ucr.core.Message
guid, hops, originatingConnection, payload, payloadSize, QUERY, QUERYREPLY, SIZE, SIZE_QUERY_PAYLOAD, SIZE_QUERYREPLY_PAYLOAD, TRACE, TRACEREPLY, ttl, type
 
Constructor Summary
(package private) SearchMessage(short[] rawMessage, Connection originatingConnection)
          Construct a SearchMessage from data read from network
  SearchMessage(java.lang.String criteria)
          Construct a GNUTella search query
 
Method Summary
(package private)  void buildPayload()
          Contructs the payload for the search message Bytes 0-1 download speed followed by search query (null terminated)
 int getMinimumDownloadSpeed()
          Get the minimum download speed for responses
 java.lang.String getSearchCriteria()
          Query the search criteria for this message
 
Methods inherited from class ucr.core.Message
addPayload, addPayload, getByteArray, getGUID, getHops, getOriginatingConnection, getPayload, getPayloadLength, getTTL, getType, setGUID, setHops, setTTL, toRawString, toString, validatePayloadSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

criteria

private java.lang.String criteria
Constructor Detail

SearchMessage

public SearchMessage(java.lang.String criteria)
Construct a GNUTella search query


SearchMessage

SearchMessage(short[] rawMessage,
              Connection originatingConnection)
Construct a SearchMessage from data read from network

Parameters:
rawMessage - binary data from a connection
originatingConnection - Connection creating this message
Method Detail

buildPayload

void buildPayload()
Contructs the payload for the search message Bytes 0-1 download speed followed by search query (null terminated)


getMinimumDownloadSpeed

public int getMinimumDownloadSpeed()
Get the minimum download speed for responses

Returns:
download speed

getSearchCriteria

public java.lang.String getSearchCriteria()
Query the search criteria for this message

Returns:
search criteria