org.jSyncManager.Conduit.NetInstaller
Class NetInstaller
- ActionListener, Serializable
public class NetInstaller
implements ActionListener
This jConduit allows for the installation of PRC and PDB files from URLs
described by a text file at the specified URL.
This jConduit works by reading a text file as retrieved from a URL, which is a simple
list of URLs pointing to PRC and/or PDB files. Each file is downloaded and installed to the
handheld if the handheld doesn't already have the database, or only has an older
version of the database available.
constructConfigPanel, doInitialization, getConduitDescription, getConduitName, getConduitResourceBundle, getConfigurationPanel, getPriority, getResourceBundleName, initialize, jConduitDialogActionPerformed, startSync, toString |
PROPERTY_FILENAME
public static final String PROPERTY_FILENAME
NetInstaller
public NetInstaller()
Net Installer Constructor.
actionPerformed
public void actionPerformed(ActionEvent ae)
This method handles events generated when the "Set" button is pressed in the GUI dialog.
ae - the ActionEvent that triggered this method call.
clearDatabaseList
protected void clearDatabaseList()
A method to clear the database list.
This class doesn't clear the list, as it may live on a non-writable network, and other users
may need it. Besides which, this implementation skips databases which are already installed, so it's
unnecessary. Calling this method is a no-op.
- clearDatabaseList in interface AbstractInstaller
constructConfigPanel
protected JPanel constructConfigPanel()
Constructs a configuration panel for this jConduit.
- constructConfigPanel in interface AbstractConduit
- a JPanel containing the configuration widgets this jConduit requires.
exceptionInstallingDatabase
protected void exceptionInstallingDatabase(DLPDatabase db,
ConduitHandler handler,
ConduitHandlerException e)
throws NotConnectedExceptionA method to handle when an exception is encountered while trying to install a database.
You may use this method to provide an alert to the user when the installation of a database
is aborted due to a ConduitHandlerException. You may refer to the exception to determine why
the exception occurred, and to then display a message to the user.
- exceptionInstallingDatabase in interface AbstractInstaller
db - the database that was being installed when the exception occurred.
getDatabaseList
protected DLPDatabase[] getDatabaseList(ConduitHandler handler,
DLPUserInfo userInfo)Returns a list of databases to be installed to the handheld at sync time.
This method will try to load the file "netinstaller.properties" in order to get the URL of the database list,
and then attempt to read each line from the database list and pass them into the DLPDatabase URL loader
to create the list of dataase to be installed.
- getDatabaseList in interface AbstractInstaller
handler - the ConduitHandler object for this sync (so you can check handheld data if necessary)userInfo - the DLPUserInfo object for the currently synchronizing user.
- an array of DLPDatabase objects.
getDatabaseListURL
protected URL getDatabaseListURL()
Get the URL containing the location of the database list file.
This method returns a URL object containing the URL of the file containing the database URL list.
- the URL containing the database list file.
getPriority
public byte getPriority()
This method returns the jConduits priority byte.
This jConduit requires a very low priority in order to ensure the install is done towards the end.
- getPriority in interface AbstractConduit
- the jConduits priority ordering byte.
getResourceBundleName
protected String getResourceBundleName()
Retrieves the name of the class to use as the Conduits Resource Bundle.
- getResourceBundleName in interface AbstractConduit
- the fully-qualified classname of the class to use as this jConduits resource bundle.
isDatabaseInstallAllowed
protected boolean isDatabaseInstallAllowed(DLPDatabase db,
ConduitHandler handler,
DLPUserInfo user)
throws NotConnectedExceptionDetermines whether or not this database should be installed.
This method will check to see if the database is already installed, and if so,
wether or not the database the be installed is newer than that present on the handheld.
If it's newer (or not present), we install it, otherwise we skip it.
- isDatabaseInstallAllowed in interface AbstractInstaller
db - the database object to be installed.handler - the ConduitHandler object for this sync (so you can check handheld data if necessary)user - the DLPUserInfo object for the currently syncing user.
- true if this database can be installed, false otherwise.