ucr.core
Class ConnectionData

java.lang.Object
  extended byucr.core.ConnectionData

public class ConnectionData
extends java.lang.Object

Provides a linkage between the Servant and JTella. ConnectionInformation is used by NetConnection and others in determining current parameters settable by the Servant application.


Field Summary
private  java.lang.String connectionGreeting
           
private  int DROP_CHECK
           
private  double DROP_RATE
           
private  int incommingConnectionCount
           
private  int incommingConnectionPort
           
private  int outgoingConnectionCount
           
private  int sharedFileCount
           
private  int sharedFileSize
           
private  int SLEEP_INTERVAL
           
private  java.lang.String vendorCode
           
 
Constructor Summary
ConnectionData()
           
 
Method Summary
 java.lang.String getConnectionGreeting()
          Get the connection handshake greeting
 long getDropCheck()
           
 double getDropRate()
           
 int getIncomingPort()
          Get the port to used for incoming connections Defaults to 6346.
 int getIncommingConnectionCount()
          Get the requested number of incomming connection return requested incomming connection count
 int getOutgoingConnectionCount()
          Returns the requested number of outgoing connections
 int getSharedFileCount()
          Get the value for shared file count
 int getSharedFileSize()
          Get the value for shared file size, this is the total size of shared files
 int getSleepInterval()
           
 java.lang.String getVendorCode()
          Get Vendor code for use in QueryReply messages.
 void setConnectionGreeting(java.lang.String greeting)
          Set the connection handshake greeting.
 void setDrop(int DROP_CHECK, double DROP_RATE, int SLEEP_INTERVAL)
           
 void setIncomingPort(int port)
          Set the port to used for incomming connections.
 void setIncommingConnectionCount(int count)
          Set the requesting number of incomming connections.
 void setOutgoingConnectionCount(int count)
          Set the requested number of outgoing connections.
 void setSharedFileCount(int count)
          Set the value for current number of shared files Defaults to zero
 void setSharedFileSize(int size)
          Set the value for shared file size Defaults to zero
 void setVendorCode(java.lang.String vendorCode)
          Set Vendor code for use in QueryReply messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outgoingConnectionCount

private int outgoingConnectionCount

incommingConnectionCount

private int incommingConnectionCount

incommingConnectionPort

private int incommingConnectionPort

sharedFileCount

private int sharedFileCount

sharedFileSize

private int sharedFileSize

connectionGreeting

private java.lang.String connectionGreeting

vendorCode

private java.lang.String vendorCode

DROP_CHECK

private int DROP_CHECK

DROP_RATE

private double DROP_RATE

SLEEP_INTERVAL

private int SLEEP_INTERVAL
Constructor Detail

ConnectionData

public ConnectionData()
Method Detail

setDrop

public void setDrop(int DROP_CHECK,
                    double DROP_RATE,
                    int SLEEP_INTERVAL)

getDropCheck

public long getDropCheck()

getSleepInterval

public int getSleepInterval()

getDropRate

public double getDropRate()

getOutgoingConnectionCount

public int getOutgoingConnectionCount()
Returns the requested number of outgoing connections

Returns:
requested outgoing connection count

setOutgoingConnectionCount

public void setOutgoingConnectionCount(int count)
Set the requested number of outgoing connections. Defaults to two connections

Parameters:
count - count of desired output connections

getIncommingConnectionCount

public int getIncommingConnectionCount()
Get the requested number of incomming connection return requested incomming connection count


setIncommingConnectionCount

public void setIncommingConnectionCount(int count)
Set the requesting number of incomming connections. Defaults to four connections

Parameters:
count - count of requested incomming connections

getIncomingPort

public int getIncomingPort()
Get the port to used for incoming connections Defaults to 6346. This property must be set appropriately before constructing NetworkConnection

Returns:
port number

setIncomingPort

public void setIncomingPort(int port)
Set the port to used for incomming connections. The port number defaults to 6346. This property must be set appropriately before constructions NetworkConnection

Returns:
port number

getSharedFileCount

public int getSharedFileCount()
Get the value for shared file count

Returns:
shared file count

setSharedFileCount

public void setSharedFileCount(int count)
Set the value for current number of shared files Defaults to zero

Parameters:
count - number of shared files

getSharedFileSize

public int getSharedFileSize()
Get the value for shared file size, this is the total size of shared files

Returns:
shared file size in KB

setSharedFileSize

public void setSharedFileSize(int size)
Set the value for shared file size Defaults to zero

Parameters:
size - size of shared files in KB

getConnectionGreeting

public java.lang.String getConnectionGreeting()
Get the connection handshake greeting

Returns:
connection greeting

setConnectionGreeting

public void setConnectionGreeting(java.lang.String greeting)
Set the connection handshake greeting. Using alternate greetings can create private greetings. The default value is GNUTELLA CONNECT/0.4\n\n

Parameters:
greeting -

getVendorCode

public java.lang.String getVendorCode()
Get Vendor code for use in QueryReply messages. Vendor code is a 4 character code that must be registered with the GDF

Returns:
vendor code

setVendorCode

public void setVendorCode(java.lang.String vendorCode)
Set Vendor code for use in QueryReply messages. Vendor code is a 4 character code that must be registered with the GDF

Parameters:
vendorCode - 4 character code