Holger's
Java API

com.antelmann.net
Class DyndnsTool

java.lang.Object
  extended by com.antelmann.net.DyndnsTool

public class DyndnsTool
extends Object

makes it easy to use dyndns services (see http://www.dyndns.com/developers/specs/)

Since:
18.08.2009, 18:02:55
Author:
Holger Antelmann

Constructor Summary
DyndnsTool(String user, char[] password)
           
DyndnsTool(String user, String pwd)
           
 
Method Summary
static String checkIpAddress()
          obtains the current external ip address through the public web-site from dyndns.com.
 String[] getSites()
           
 String getUser()
           
 void setSites(String... sites)
          each site is the full hostname as in 'antelmann.dyndns.org'
 int updateIP()
          uses default parameters
 int updateIP(String myIpAddress, String... mySites)
          allows to update the ip address
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DyndnsTool

public DyndnsTool(String user,
                  String pwd)

DyndnsTool

public DyndnsTool(String user,
                  char[] password)
Method Detail

getUser

public String getUser()

getSites

public String[] getSites()

setSites

public void setSites(String... sites)
each site is the full hostname as in 'antelmann.dyndns.org'


updateIP

public int updateIP()
             throws IOException
uses default parameters

Throws:
IOException
See Also:
getSites(), checkIpAddress()

updateIP

public int updateIP(String myIpAddress,
                    String... mySites)
             throws IOException,
                    IllegalArgumentException,
                    NullPointerException
allows to update the ip address

Parameters:
myIpAddress - the ip address that should be used for forwarding
mySites - the sites that are to be forwarded to the given ip address; if no site is given, the sites of this instance are used (see getSites()); if these are not properly set either, an IllegalArgumentException is thrown
Returns:
the http response code; this should normally be 200
Throws:
IOException
IllegalArgumentException
NullPointerException

checkIpAddress

public static String checkIpAddress()
                             throws IOException,
                                    IllegalStateException
obtains the current external ip address through the public web-site from dyndns.com. Note that within the same JVM, this method can only be called once every 10 minutes, otherwise an IllegalStateException is thrown even before the connection attempt is made

Throws:
IOException
IllegalStateException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads