jSyncManager

org.jSyncManager.Conduit.Installer
Class Installer

java.lang.Object
  |
  +--org.jSyncManager.API.Conduit.AbstractConduit
        |
        +--org.jSyncManager.API.Conduit.AbstractInstaller
              |
              +--org.jSyncManager.Conduit.Installer.Installer
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.io.Serializable

public class Installer
extends AbstractInstaller
implements java.awt.event.ActionListener

A jConduit used to install PRC and PDB files. This jConduit allows the user to install PRC and PDB files from either a local or network filesystem, or via a specified URL.

Version:
$Revision: 1.8 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: dingodave $ on $Date: 2003/07/09 01:54:41 $.
See Also:
Serialized Form

Inner Class Summary
(package private)  class Installer.DatabaseFileFilter
           
 
Fields inherited from class org.jSyncManager.API.Conduit.AbstractConduit
configurationPanel, HIGH_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY, resources
 
Constructor Summary
Installer()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Implementation of ActionListener.actionPerformed(ActionEvent).
protected  void clearDatabaseList()
          A method to clear the database list vector.
protected  javax.swing.JPanel constructConfigPanel()
          Constructs a configuration panel for this jConduit.
protected  void exceptionInstallingDatabase(DLPDatabase db, ConduitHandler handler, ConduitHandlerException e)
          A method to handle when an exception is encountered while trying to install a database.
protected  DLPDatabase[] getDatabaseList()
          Returns a list of databases to be installed to the handheld at sync time.
 byte getPriority()
          This method returns the jConduits priority byte.
protected  java.lang.String getResourceBundleName()
          Retrieves the name of the class to use as the Conduits Resource Bundle.
protected  void installingDatabase(DLPDatabase db, ConduitHandler handler)
          A method to handle when a database is to be installed.
protected  boolean isDatabaseInstallAllowed(DLPDatabase db, ConduitHandler handler, DLPUserInfo user)
          Determines wether or not this database should be installed.
 void removeDatabase(java.lang.String s)
           
protected  void skippingDatabase(DLPDatabase db, ConduitHandler handler)
          A method to handle when a database is to be skipped (ie: not installed).
 
Methods inherited from class org.jSyncManager.API.Conduit.AbstractInstaller
startSync
 
Methods inherited from class org.jSyncManager.API.Conduit.AbstractConduit
getConduitDescription, getConduitName, getConduitResourceBundle, getConfigurationPanel, getHandler, setHandler, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Installer

public Installer()
Method Detail

getPriority

public byte getPriority()
Description copied from class: AbstractConduit
This method returns the jConduits priority byte. The priority byte is used to determine when a jConduit should be run during synchronization. The value is a signed byte, with 127 being highest priority, and -128 the lowest. jConduits with a higher priority will be run first. jConduits with the same priority are run in an undefined order. By default, jConduits will have priority 0. Conduits that are a part of a suite of conduits should implement descending priority values to ensure they are run in a predetermined ordes. Please resist the temptation to use priority 127 and -128. These should be reserved for core jSyncManager conduits which do maintenence tasks (such as Installer and Deleter). Using the maximum and minimum priorities may interfere with correct operation of these tools. For convienence, AbstractConduit defines constants HIGH_PRIORITY, NORMAL_PRIORITY, and LOW_PRIORITY.
Overrides:
getPriority in class AbstractConduit
Returns:
byte

removeDatabase

public void removeDatabase(java.lang.String s)

getResourceBundleName

protected java.lang.String getResourceBundleName()
Retrieves the name of the class to use as the Conduits Resource Bundle.
Overrides:
getResourceBundleName in class AbstractConduit
Returns:
the fully-qualified classname of the class to use as this jConduits resource bundle.

constructConfigPanel

protected javax.swing.JPanel constructConfigPanel()
Constructs a configuration panel for this jConduit.
Overrides:
constructConfigPanel in class AbstractConduit
Returns:
a JPanel containing the configuration widgets for the Installer jConduit.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Implementation of ActionListener.actionPerformed(ActionEvent). Whenever one of the config buttons is pressed, this method will be called.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the incoming action event.

isDatabaseInstallAllowed

protected boolean isDatabaseInstallAllowed(DLPDatabase db,
                                           ConduitHandler handler,
                                           DLPUserInfo user)
Determines wether or not this database should be installed. This implementation will attempt to install all the databases, and thus always returns true
Overrides:
isDatabaseInstallAllowed in class AbstractInstaller
Parameters:
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.
Returns:
true. Always :).

clearDatabaseList

protected void clearDatabaseList()
A method to clear the database list vector.
Overrides:
clearDatabaseList in class AbstractInstaller

installingDatabase

protected void installingDatabase(DLPDatabase db,
                                  ConduitHandler handler)
A method to handle when a database is to be installed. We'll just tell the user that we're installing the specified database.
Overrides:
installingDatabase in class AbstractInstaller
Parameters:
db - the database that is about to be installed.

skippingDatabase

protected void skippingDatabase(DLPDatabase db,
                                ConduitHandler handler)
A method to handle when a database is to be skipped (ie: not installed). This jConduit never skips installing a database, thus this jConduit has a null implementation for this method.
Overrides:
skippingDatabase in class AbstractInstaller
Parameters:
db - the database that is about to be skipped.

exceptionInstallingDatabase

protected void exceptionInstallingDatabase(DLPDatabase db,
                                           ConduitHandler handler,
                                           ConduitHandlerException e)
A 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.
Overrides:
exceptionInstallingDatabase in class AbstractInstaller
Parameters:
db - the database that was being installed when the exception occurred.

getDatabaseList

protected DLPDatabase[] getDatabaseList()
Returns a list of databases to be installed to the handheld at sync time.
Overrides:
getDatabaseList in class AbstractInstaller
Returns:
an array of DLPDatabas objects.
See Also:
DLPDatabase

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.