Administration Tools

org.topcased.service.updatesite
Class UpdateSiteWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.topcased.service.updatesite.UpdateSiteWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard

public class UpdateSiteWizard
extends org.eclipse.jface.wizard.Wizard

The main update Site wizard. It add all necessary pages It also jars or copy the features/plugins to the destination It can create a FTP or SSH connection and give some information about them. It copy the features/plugins jared to the remote FTP or SSH server


Field Summary
static int FILENOSEC
          FILENOSEC - Identifier of connection host protocol
static int FILESEC
          FILESEC - Identifier of connection host protocol
static int FTP
          FTP - Identifier of connection host protocol
static java.lang.String PRIVATE_KEY_PATH
          PRIVATE_KEY_PATH - If a SSH connection is used
static int SSH
          SSH - Identifier of connection host protocol
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
UpdateSiteWizard()
          Constructor initializing the updateSiteToolAdminPath
 
Method Summary
 void addPages()
          Add all the necessary pages of the wizard
 boolean canFinish()
          Function returning if the button 'Finish' is enabled or not
static java.lang.String checkPath(java.lang.String pathToCheck, boolean pathNature)
          This method is aimed to solve path problems independantly of the system.
 void createConnectionFTP()
           
 boolean createConnectionSSH()
          This method establishes a SSH connection in two major steps : - key exchange between the client and the server - authentication of a user
 void disconnect()
          This method disconnect a client form a remote FTP or SSH server.
 org.eclipse.ftp.internal.FTPClient getClientFTP()
           
 SftpClient getClientSFTP()
           
 SshClient getClientSSH()
           
 ConnectUpdateSiteWizardPage getConnectionPage()
           
 CreateSiteUpdateSiteWizardPage getCreateSitePage()
           
 java.lang.String getDirectory()
           
 org.eclipse.core.runtime.IPath getFeatureUpdateSitePath()
          Returns the absolute path to the directory 'features' of tje platform source
 java.lang.String getHost()
           
 java.util.Vector getIOErrorVector()
           
 java.util.Map getMapAddPluginFeatureUS()
           
 java.util.Map getMapFeatureInclude()
           
 java.util.Map getMapPluginUS()
           
 java.util.Map getMapRequiredPlugins()
           
 java.lang.String getPassword()
           
 org.eclipse.core.runtime.IPath getPluginUpdateSitePath()
          Returns the absolute path to the directory 'plugins' of the platform source
 int getPort()
           
 int getProtocolConnex()
           
 TreeUpdateSiteWizardPage getRequiredPage()
           
 BrowseUpdateSiteWizardPage getSelectionPage()
           
 java.lang.String getUpdateSitePath()
           
 java.lang.String getUpdateSiteToolAdminPath()
          Return the path of the source of the features
 java.lang.String getUsername()
           
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
           
 boolean isConnected()
           
 void jarMapToDestination(java.util.Map map)
          Jar the file contained in the map
 boolean performCancel()
          Function executed when the button 'Cancel' is clicked
 boolean performFinish()
          Function executed when the button 'Finish' is clicked
static java.lang.String[] readManifestFile(java.lang.String filename)
          Reads a manifest file and returns an array containing the dependencies.
 void setHost(java.lang.String host)
           
 void setPassword(java.lang.String password)
           
 void setPort(int port)
           
 void setProtocolConnex(int protocol)
           
 void setUpdateSitePath(java.lang.String path)
           
 void setUpdateSiteToolAdminPath(java.lang.String path)
          Set the path of the source of the features
 void setUsername(java.lang.String user)
           
 boolean userAuthenticationSHH(SshAuthenticationClient client)
          This method authenticates a client according to the choosen method (public key, interactive keyboard, password)
 void zipFile(java.io.File[] files, java.util.jar.JarOutputStream output, java.lang.String path)
          Zip Files
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FTP

public static final int FTP
FTP - Identifier of connection host protocol

See Also:
Constant Field Values

SSH

public static final int SSH
SSH - Identifier of connection host protocol

See Also:
Constant Field Values

FILESEC

public static final int FILESEC
FILESEC - Identifier of connection host protocol

See Also:
Constant Field Values

FILENOSEC

public static final int FILENOSEC
FILENOSEC - Identifier of connection host protocol

See Also:
Constant Field Values

PRIVATE_KEY_PATH

public static final java.lang.String PRIVATE_KEY_PATH
PRIVATE_KEY_PATH - If a SSH connection is used

See Also:
Constant Field Values
Constructor Detail

UpdateSiteWizard

public UpdateSiteWizard()
Constructor initializing the updateSiteToolAdminPath

Method Detail

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
Parameters:
workbench -
selection -

checkPath

public static java.lang.String checkPath(java.lang.String pathToCheck,
                                         boolean pathNature)
This method is aimed to solve path problems independantly of the system. First, the good file separator is added at the end of the path. Secondly, the function check that all the file separators contained are correct. If it is not the case, they are replaced by the good one.

Parameters:
pathToCheck - The string to evaluate
pathNature - The string nature : true for a local path, false for a distant path.
Returns:
The new path corrected.

performCancel

public boolean performCancel()
Function executed when the button 'Cancel' is clicked

Specified by:
performCancel in interface org.eclipse.jface.wizard.IWizard
Overrides:
performCancel in class org.eclipse.jface.wizard.Wizard
Returns:
boolean true if the wizard is canceled, false otherwise

performFinish

public boolean performFinish()
Function executed when the button 'Finish' is clicked

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard
Returns:
boolean true if the wizard is finished, false otherwise

canFinish

public boolean canFinish()
Function returning if the button 'Finish' is enabled or not

Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard
Returns:
boolean true if the button is enable, false otherwise

addPages

public void addPages()
Add all the necessary pages of the wizard

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

getUpdateSiteToolAdminPath

public java.lang.String getUpdateSiteToolAdminPath()
Return the path of the source of the features

Returns:
String the path

setUpdateSiteToolAdminPath

public void setUpdateSiteToolAdminPath(java.lang.String path)
Set the path of the source of the features

Parameters:
path - the path

getUpdateSitePath

public java.lang.String getUpdateSitePath()
Returns:
Returns the updateSitePath.

getPluginUpdateSitePath

public org.eclipse.core.runtime.IPath getPluginUpdateSitePath()
Returns the absolute path to the directory 'plugins' of the platform source

Returns:
the absolute path to the directory 'plugins' of the update site

getFeatureUpdateSitePath

public org.eclipse.core.runtime.IPath getFeatureUpdateSitePath()
Returns the absolute path to the directory 'features' of tje platform source

Returns:
the absolute path to the directory 'features' of the update site

setUpdateSitePath

public void setUpdateSitePath(java.lang.String path)
Parameters:
updateSitePath - The updateSitePath to set.

getRequiredPage

public TreeUpdateSiteWizardPage getRequiredPage()
Returns:
Returns the requiredPage.

getConnectionPage

public ConnectUpdateSiteWizardPage getConnectionPage()
Returns:
Returns the connectionPage.

getSelectionPage

public BrowseUpdateSiteWizardPage getSelectionPage()
Returns:
Returns the selectionPage.

getCreateSitePage

public CreateSiteUpdateSiteWizardPage getCreateSitePage()
Returns:
Returns the wizard page aimed to build the site.xml file.

getMapAddPluginFeatureUS

public java.util.Map getMapAddPluginFeatureUS()
Returns:
Returns the mapAddPluginFeatureUS.

getMapFeatureInclude

public java.util.Map getMapFeatureInclude()
Returns:
Returns the mapFeatureInclude.

getMapPluginUS

public java.util.Map getMapPluginUS()
Returns:
Returns the mapPluginUS.

getMapRequiredPlugins

public java.util.Map getMapRequiredPlugins()
Returns:
Returns the mapRequiredPlugins.

getHost

public java.lang.String getHost()
Returns:
Returns the host.

setHost

public void setHost(java.lang.String host)
Parameters:
host - The host to set.

getPort

public int getPort()
Returns:
Returns the port.

setPort

public void setPort(int port)
Parameters:
port - The port to set.

getPassword

public java.lang.String getPassword()
Returns:
Returns the password.

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The password to set.

getProtocolConnex

public int getProtocolConnex()
Returns:
Returns the protocolConnex.

setProtocolConnex

public void setProtocolConnex(int protocol)
Parameters:
protocolConnex - The protocolConnex to set.

getUsername

public java.lang.String getUsername()
Returns:
Returns the username.

setUsername

public void setUsername(java.lang.String user)
Parameters:
username - The username to set.

getClientFTP

public org.eclipse.ftp.internal.FTPClient getClientFTP()

getClientSFTP

public SftpClient getClientSFTP()
Returns:
Returns the clientSFTP.

getClientSSH

public SshClient getClientSSH()
Returns:
Returns the clientSSH.

getDirectory

public java.lang.String getDirectory()

getIOErrorVector

public java.util.Vector getIOErrorVector()
Returns:
Returns the iOErrorVector.

createConnectionFTP

public void createConnectionFTP()

userAuthenticationSHH

public boolean userAuthenticationSHH(SshAuthenticationClient client)
This method authenticates a client according to the choosen method (public key, interactive keyboard, password)

Parameters:
client - represents the current method authentication tried by a client
Returns:
returns true is the user is authenticated, false if the authentication method has failed.

createConnectionSSH

public boolean createConnectionSSH()
This method establishes a SSH connection in two major steps : - key exchange between the client and the server - authentication of a user

Returns:
returns true if the connection is established for a given user, false if the connection failed

disconnect

public void disconnect()
This method disconnect a client form a remote FTP or SSH server. First, the connection state is checked with the method isConnected().


isConnected

public boolean isConnected()

jarMapToDestination

public void jarMapToDestination(java.util.Map map)
Jar the file contained in the map

Parameters:
map - contains files which will be zipped

zipFile

public void zipFile(java.io.File[] files,
                    java.util.jar.JarOutputStream output,
                    java.lang.String path)
             throws java.io.IOException
Zip Files

Parameters:
files - : all files to zip
output - : destination jar
path - : path in the jar
Throws:
java.io.IOException

readManifestFile

public static java.lang.String[] readManifestFile(java.lang.String filename)
Reads a manifest file and returns an array containing the dependencies.

Parameters:
filename - the manifest filename
Returns:
an String array containing the dependencies
Throws:
java.io.IOException - if an error occur while reading the file

Administration Tools

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.