org.knuth.chkupdate
Class UpdateCheck

java.lang.Object
  extended by org.knuth.chkupdate.UpdateCheck

public class UpdateCheck
extends java.lang.Object

Handler-class which manages the Provider and checks for Updates.

Author:
Lukas Knuth

Field Summary
private  Provider provider
          The current Provider.
 
Constructor Summary
UpdateCheck()
          Creates a new "UpdateCheck"-Object without any Provider.
UpdateCheck(Provider provider)
          Creates a new "UpdateCheck"-Object using the given Provider.
 
Method Summary
 UpdateResult checkForUpdates()
          Checks for an Update using the current Provider.
static UpdateResult checkForUpdates(Provider provider)
          Checks for an update using the given Provider.
 void setProvider(Provider provider)
          Sets a new Provider for the Update-Check.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

provider

private Provider provider
The current Provider.

Constructor Detail

UpdateCheck

public UpdateCheck(Provider provider)
Creates a new "UpdateCheck"-Object using the given Provider.

Parameters:
provider - The Provider to use for the Update- Check.

UpdateCheck

public UpdateCheck()
Creates a new "UpdateCheck"-Object without any Provider.

See Also:
setProvider(Provider provider)
Method Detail

setProvider

public void setProvider(Provider provider)
Sets a new Provider for the Update-Check.

Parameters:
provider - The new Provider to use for the Update-Check.

checkForUpdates

public UpdateResult checkForUpdates()
                             throws UpdateRequestException,
                                    UpdateResponseException
Checks for an Update using the current Provider.

Returns:
An "UpdateResult"-Object holding the informations on the new Update.
Throws:
NoProviderException - Thrown when no Provider was specified.
UpdateRequestException - Thrown when there was a problem requesting informations from the Provider.
UpdateResponseException - Thrown when there was a problem parsing the response from the Provider.

checkForUpdates

public static UpdateResult checkForUpdates(Provider provider)
                                    throws UpdateRequestException,
                                           UpdateResponseException
Checks for an update using the given Provider.

Parameters:
provider - The Provider to use for the Update- Check.
Returns:
An "UpdateResult"-Object holding the informations on the new Update.
Throws:
UpdateRequestException - Thrown when there was a problem requesting informations from the Provider.
UpdateResponseException - Thrown when there was a problem parsing the response from the Provider.