public class ConnectionModel
extends java.lang.Object
| Constructor and Description |
|---|
ConnectionModel(java.net.InetAddress host,
int port) |
ConnectionModel(java.net.InetAddress host,
int port,
ConnectionThrottler throttler) |
ConnectionModel(int port)
Normally used to create a listener for incoming connections.
|
ConnectionModel(java.lang.String hostname,
int port) |
ConnectionModel(java.lang.String hostname,
int port,
ConnectionThrottler throttler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.net.InetAddress |
getHost() |
java.lang.String |
getHostAddress()
Convenience Method for obtaining the host IP from the InetAddress
|
java.lang.String |
getHostName()
Convenience Method for obtaining the hostname from the InetAddress
|
int |
getPort() |
ConnectionThrottler |
getThrottler() |
long |
getTimeOnlineMillis() |
java.lang.String |
getTimeOnlineString() |
long |
getTransferBPS() |
float |
getTransferKBPS() |
void |
incrementBytesTransferred(long increment)
increments the bytes transferred for calculation of throttling
as well as the bandwidth BPS
|
boolean |
isSSL()
replies whether this is secure or not
|
void |
reset()
Resets all the data fields back to the initial state.
|
void |
setEndTime(long endTime)
Sets the end time when the transfer is finished
|
void |
setHost(java.net.InetAddress host)
sets the host after the connection created
|
void |
setPort(int port)
sets the port after the connection is created
|
void |
setSSL(boolean secure)
sets this to be a secure SSL connection
|
void |
setStartTime(long startTime)
Sets the start time when the connection begins.
|
void |
setThrottler(ConnectionThrottler throttler)
sets the throttler for the connection bandwidth.
|
java.lang.String |
toString() |
public ConnectionModel(int port)
port - the port to connect to/receive frompublic ConnectionModel(java.net.InetAddress host,
int port)
host - the InetAddress containing the hostname/IPport - the port to connect to/receive frompublic ConnectionModel(java.lang.String hostname,
int port)
throws java.net.UnknownHostException
hostname - the hostname/IP to createport - the port to connect to/receive fromjava.net.UnknownHostExceptionpublic ConnectionModel(java.net.InetAddress host,
int port,
ConnectionThrottler throttler)
host - the InetAddress containing the hostname/IPport - the port to connect to/receive fromthrottler - the bandwidth throttler, or null if no throttlingpublic ConnectionModel(java.lang.String hostname,
int port,
ConnectionThrottler throttler)
throws java.net.UnknownHostException
hostname - the hostname/IP to createport - the port to connect to/receive fromthrottler - the bandwidth throttler, or null if no throttlingjava.net.UnknownHostExceptionpublic int getPort()
public java.net.InetAddress getHost()
public java.lang.String getHostName()
public java.lang.String getHostAddress()
public void setPort(int port)
public void setHost(java.net.InetAddress host)
public void setSSL(boolean secure)
public boolean isSSL()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void setThrottler(ConnectionThrottler throttler)
public ConnectionThrottler getThrottler()
public java.lang.String toString()
toString in class java.lang.Objectpublic void incrementBytesTransferred(long increment)
public float getTransferKBPS()
public long getTransferBPS()
public long getTimeOnlineMillis()
public java.lang.String getTimeOnlineString()
public void reset()
public void setStartTime(long startTime)
public void setEndTime(long endTime)
Copyright © 2001-2005 Echomine. All Rights Reserved.