|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jetrix.services.AbstractService
net.jetrix.services.ScheduledService
net.jetrix.services.PublishingService
public class PublishingService
A service publishing the address of the server on public server lists (tetrinet.org, tfast.org and tsrv.com). The host parameter can be specified if not explicitely defined in the config.xml file (with the host attribute on the tetrinet-server element), if no hostname is provided the service will try to guess the address automatically. The name of the server is used as the description. The address is published once a day by default.
Field Summary |
---|
Fields inherited from class net.jetrix.services.AbstractService |
---|
autoStart |
Constructor Summary | |
---|---|
PublishingService()
|
Method Summary | |
---|---|
protected InetAddress |
findInetAddress()
Search through the available network interfaces and return the first global internet address found. |
String |
getHost()
|
String |
getName()
Return the name of the service. |
protected String |
getPublishedAddress()
Find the address to publish by looking at the service host parameter, the server host attribute in the config.xml file, and the IP associated to the network interfaces. |
protected void |
post(String url,
Map<String,String> parameters)
Send a POST http request to the specified URL. |
protected void |
run()
Execute the task |
void |
setHost(String host)
|
Methods inherited from class net.jetrix.services.ScheduledService |
---|
getDelay, getPeriod, init, isRunning, setDelay, setPeriod, start, stop |
Methods inherited from class net.jetrix.services.AbstractService |
---|
isAutoStart, setAutoStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PublishingService()
Method Detail |
---|
public void setHost(String host)
public String getHost()
public String getName()
Service
protected void run()
ScheduledService
run
in class ScheduledService
protected void post(String url, Map<String,String> parameters) throws IOException
url
- the URLparameters
- the parameters of the request
IOException
protected String getPublishedAddress()
protected InetAddress findInetAddress()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |