|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xvsm.lookup.gnutella.GnutellaPeer
public class GnutellaPeer
Is the class that handles the Gnutella functions of a peer.
Constructor Summary | |
---|---|
GnutellaPeer(int port,
java.lang.String serverIp,
int serverPort)
Constructor to initiate a peer using the local port and the server ip-address as well as the port of the server |
Method Summary | |
---|---|
void |
connect()
connects the peer to the server to retrieve some addresses of other peers |
java.util.Hashtable<java.lang.String,java.lang.Object> |
getAnswer()
|
java.util.Hashtable<java.lang.String,java.lang.Object> |
getList()
returns the list of objects, which have been published |
int |
getLocalPort()
|
java.lang.String |
getServerIp()
|
int |
getServerPort()
|
static void |
main(java.lang.String[] args)
starting a standalone peer. |
void |
publish(java.lang.String searchString,
java.lang.Object object)
adds an additional object to the list of objects, which have been published |
java.lang.Object |
search(java.lang.String searchString)
function to search for an object in the gnutella network by its string. |
void |
senden(GnutellaRequest request,
boolean throwException)
sends a request to another peer. |
void |
unpublish(java.lang.String searchString)
removes an object for the list of objects, which have been published |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GnutellaPeer(int port, java.lang.String serverIp, int serverPort) throws java.net.UnknownHostException, java.io.IOException, java.lang.ClassNotFoundException
port
- serverIp
- serverPort
-
java.net.UnknownHostException
java.io.IOException
java.lang.ClassNotFoundException
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.io.IOException, java.lang.ClassNotFoundException
args
-
java.io.IOException
java.lang.ClassNotFoundException
public void connect() throws java.net.UnknownHostException, java.io.IOException, java.lang.ClassNotFoundException
java.net.UnknownHostException
java.io.IOException
java.lang.ClassNotFoundException
public java.util.Hashtable<java.lang.String,java.lang.Object> getList()
public void publish(java.lang.String searchString, java.lang.Object object)
searchString
- object
- public void unpublish(java.lang.String searchString)
searchString
- public void senden(GnutellaRequest request, boolean throwException) throws NotFoundException, java.net.UnknownHostException, java.io.IOException, java.lang.ClassNotFoundException
request
- throwException
-
NotFoundException
java.net.UnknownHostException
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object search(java.lang.String searchString) throws java.net.UnknownHostException, java.io.IOException, java.lang.ClassNotFoundException, NotFoundException
searchString
-
java.net.UnknownHostException
java.io.IOException
java.lang.ClassNotFoundException
NotFoundException
public int getLocalPort()
public java.lang.String getServerIp()
public int getServerPort()
public java.util.Hashtable<java.lang.String,java.lang.Object> getAnswer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |