|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.anidb.udp.UdpConnectionFactory
public class UdpConnectionFactory
Creates and organizes UDP connections to AniDB.
UdpConnection
Field Summary | |
---|---|
static java.lang.String |
HOST
The standard host. |
static int |
MAJOR_VERSION
The major version of the Java AniDB API. |
static int |
MINOR_VERSION
The minor version of the Java AniDB API. |
static int |
PORT
The standard remote port. |
static int |
TIMEOUT
The connection timeout. |
Method Summary | |
---|---|
UdpConnection |
connect(int localPort)
Build a connection with the given local port. |
UdpConnection |
connect(int localPort,
java.lang.String host,
int remotePort)
Build a connection with the given values. |
UdpConnection |
connect(int localPort,
java.lang.String host,
int remotePort,
int timeout,
boolean floodProtection)
Build a connection with the given values. |
static UdpConnectionFactory |
getInstance()
Returns a instance of the class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOST
public static final int PORT
public static final int TIMEOUT
public static final int MAJOR_VERSION
public static final int MINOR_VERSION
Method Detail |
---|
public static UdpConnectionFactory getInstance()
public UdpConnection connect(int localPort, java.lang.String host, int remotePort, int timeout, boolean floodProtection) throws UdpConnectionException
Build a connection with the given values.
For further information for the timeout see
DatagramSocket.setSoTimeout(int)
.
localPort
- The local port.host
- The host, normally HOST
.remotePort
- The remote port, normally PORT
.timeout
- The timeout in milliseconds.floodProtection
- The state of the flood protection.
java.lang.IllegalArgumentException
- If the local port is equal or less than
1024.
java.lang.IllegalArgumentException
- If the host is null
.
java.lang.IllegalArgumentException
- If the timeout is less than
0
.
UdpConnectionException
- If a connection problem occured.UdpConnection.UdpConnection(DatagramSocket, boolean)
public UdpConnection connect(int localPort, java.lang.String host, int remotePort) throws UdpConnectionException
Build a connection with the given values.
For the timeout the standard value will be used.
The flood protection will be enabled.
localPort
- The local port.host
- The host, normally HOST
.remotePort
- The remote port, normally PORT
.
java.lang.IllegalArgumentException
- If the local port is equal or less than
1024.
java.lang.IllegalArgumentException
- If the host is null
.
UdpConnectionException
- If a connection problem occured.UdpConnection.UdpConnection(DatagramSocket, boolean)
public UdpConnection connect(int localPort) throws UdpConnectionException
Build a connection with the given local port.
For the host, the remote port and the timeout the standard values will be used.
The flood protection will be enabled.
localPort
- The local port.
java.lang.IllegalArgumentException
- If the local port is equal or less than
1024.
UdpConnectionException
- If a connection problem occured.UdpConnection.UdpConnection(DatagramSocket, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |