j_waste.network
Class SearchPacket

java.lang.Object
  extended byj_waste.network.Packet
      extended byj_waste.network.HeadedPacket
          extended byj_waste.network.SearchPacket
All Implemented Interfaces:
NetworkConstants

public class SearchPacket
extends HeadedPacket

This is the class for the Search packet type.

Version:
0.1
Author:
Jan Lindblom (cl0wn@users.sourceforge.net)

Field Summary
 
Fields inherited from class j_waste.network.HeadedPacket
packetData, padBytes
 
Fields inherited from class j_waste.network.Packet
packet
 
Fields inherited from interface j_waste.network.NetworkConstants
ABORT, CAP_BANDWIDTH, CAP_REMOTE_IP, CAP_SATURATION, GENERAL_TYPE_BROADCAST, GENERAL_TYPE_LOCAL, GENERAL_TYPE_ROUTED, HEADER_SIZE, MAX_BROADCAST_SIZE, MAX_ROUTED_SIZE, NO_ABORT, PREMATURE_ABORT, PRIO_CHAT, PRIO_CHAT_REPLY, PRIO_FILE_REQ_REPLY, PRIO_FILE_REQUEST, PRIO_KEYDIST, PRIO_KEYDIST_REPLY, PRIO_LCAPS, PRIO_LOCAL_SATURATE, PRIO_PING, PRIO_SEARCH, PRIO_SEARCH_REPLY, PRIO_SEARCH_USERLIST, PRIO_UPLOAD, TYPE_CHAT, TYPE_CHAT_REPLY, TYPE_FILE_REQ_REPLY, TYPE_FILE_REQUEST, TYPE_KEYDIST, TYPE_KEYDIST_REPLY, TYPE_LCAPS, TYPE_LOCAL_SATURATE, TYPE_PING, TYPE_SEARCH, TYPE_SEARCH_REPLY, TYPE_SEARCH_USERLIST, TYPE_UPLOAD
 
Constructor Summary
SearchPacket()
          Base constructor of the SearchPacket class.
SearchPacket(byte[] pkg)
           
SearchPacket(java.lang.String s)
          Alternative constructor of the SearchPacket class.
SearchPacket(java.lang.String s, byte[] guid)
          Alternative constructor of the SearchPacket class.
 
Method Summary
 void finalizePacket()
          Finalizes this SearchPacket.
 java.lang.String getSearchString()
          Returns the search string of this SearchPacket.
 void setSearchString(java.lang.String s)
          Sets the search string of this SearchPacket.
 byte[] toByteArray()
          Returns a byte array representation of this packet.
 
Methods inherited from class j_waste.network.HeadedPacket
createPacket, getData, getGeneralType, getGUID, getHeader, getIntPrio, getIntType, getLength, getMD5, getPrio, getTTL, getType, setLength, setTTL
 
Methods inherited from class j_waste.network.Packet
padCD, reverseBytes, reverseInt, reverseShort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchPacket

public SearchPacket()
Base constructor of the SearchPacket class. Constructs an empty SearchPacket.


SearchPacket

public SearchPacket(java.lang.String s)
Alternative constructor of the SearchPacket class. Takes a search string as an argument.

Parameters:
s - the search string.

SearchPacket

public SearchPacket(java.lang.String s,
                    byte[] guid)
Alternative constructor of the SearchPacket class. Takes a search string and a GUID as arguments.

Parameters:
s - the search string.
guid - the GUID.

SearchPacket

public SearchPacket(byte[] pkg)
             throws InvalidPacketException
Method Detail

setSearchString

public void setSearchString(java.lang.String s)
Sets the search string of this SearchPacket.

Parameters:
s - the search string.

getSearchString

public java.lang.String getSearchString()
Returns the search string of this SearchPacket.

Returns:
Returns the search string of this SearchPacket.

finalizePacket

public void finalizePacket()
Finalizes this SearchPacket.

Overrides:
finalizePacket in class HeadedPacket

toByteArray

public byte[] toByteArray()
Returns a byte array representation of this packet.

Overrides:
toByteArray in class HeadedPacket
Returns:
a byte array representation of this packet.