org.apache.continuum.installation
Class DefaultInstallationService

java.lang.Object
  extended by org.apache.continuum.installation.DefaultInstallationService
All Implemented Interfaces:
InstallationService, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

@Service(value="installationService")
public class DefaultInstallationService
extends Object
implements InstallationService, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

Since:
13 juin 07
Version:
$Id: DefaultInstallationService.java 1372260 2012-08-13 04:29:09Z brett $ TODO use some cache mechanism to prevent always reading from store ?
Author:
olamy

Field Summary
 
Fields inherited from interface org.apache.maven.continuum.installation.InstallationService
ANT_TYPE, ENVVAR_TYPE, JDK_TYPE, MAVEN1_TYPE, MAVEN2_TYPE, ROLE
 
Constructor Summary
DefaultInstallationService()
           
 
Method Summary
 Installation add(Installation installation)
           
 Installation add(Installation installation, boolean automaticProfile)
           
 void delete(Installation installation)
           
 List<Installation> getAllInstallations()
           
 List<String> getDefaultJdkInformations()
          TODO replace with calling getExecutorConfiguratorVersion
 String getEnvVar(String type)
           
 ExecutorConfigurator getExecutorConfigurator(String type)
           
 List<String> getExecutorConfiguratorVersion(String path, ExecutorConfigurator executorConfigurator, Profile profile)
           
 Installation getInstallation(int installationId)
           
 Installation getInstallation(String installationName)
           
 List<String> getJdkInformations(Installation installation)
          TODO replace with calling getExecutorConfiguratorVersion
 void initialize()
           
 void update(Installation installation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInstallationService

public DefaultInstallationService()
Method Detail

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

add

public Installation add(Installation installation)
                 throws InstallationException,
                        AlreadyExistsInstallationException
Specified by:
add in interface InstallationService
Throws:
InstallationException
AlreadyExistsInstallationException
See Also:
InstallationService.add(org.apache.maven.continuum.model.system.Installation)

add

public Installation add(Installation installation,
                        boolean automaticProfile)
                 throws InstallationException,
                        AlreadyExistsProfileException,
                        AlreadyExistsInstallationException
Specified by:
add in interface InstallationService
Throws:
InstallationException
AlreadyExistsProfileException
AlreadyExistsInstallationException

delete

public void delete(Installation installation)
            throws InstallationException
Specified by:
delete in interface InstallationService
Throws:
InstallationException
See Also:
InstallationService.delete(org.apache.maven.continuum.model.system.Installation)

getAllInstallations

public List<Installation> getAllInstallations()
                                       throws InstallationException
Specified by:
getAllInstallations in interface InstallationService
Throws:
InstallationException
See Also:
InstallationService.getAllInstallations()

getInstallation

public Installation getInstallation(int installationId)
                             throws InstallationException
Specified by:
getInstallation in interface InstallationService
Throws:
InstallationException
See Also:
InstallationService.getInstallation(int)

getInstallation

public Installation getInstallation(String installationName)
                             throws InstallationException
Specified by:
getInstallation in interface InstallationService
Throws:
InstallationException
See Also:
InstallationService.getInstallation(String)

update

public void update(Installation installation)
            throws InstallationException,
                   AlreadyExistsInstallationException
Specified by:
update in interface InstallationService
Throws:
InstallationException
AlreadyExistsInstallationException
See Also:
InstallationService.update(org.apache.maven.continuum.model.system.Installation)

getExecutorConfigurator

public ExecutorConfigurator getExecutorConfigurator(String type)
Specified by:
getExecutorConfigurator in interface InstallationService
Returns:
ExecutorConfigurator or null if unknown type
See Also:
InstallationService.getExecutorConfigurator(java.lang.String)

getEnvVar

public String getEnvVar(String type)
Specified by:
getEnvVar in interface InstallationService
See Also:
InstallationService.getEnvVar(java.lang.String)

getDefaultJdkInformations

public List<String> getDefaultJdkInformations()
                                       throws InstallationException
TODO replace with calling getExecutorConfiguratorVersion

Specified by:
getDefaultJdkInformations in interface InstallationService
Returns:
output of JAVA_HOME/bin/java -version
Throws:
InstallationException
See Also:
InstallationService.getDefaultJdkInformations()

getJdkInformations

public List<String> getJdkInformations(Installation installation)
                                throws InstallationException
TODO replace with calling getExecutorConfiguratorVersion

Specified by:
getJdkInformations in interface InstallationService
Returns:
output of JAVA_HOME/bin/java -version (JAVA_HOME = installation.getVarValue()
Throws:
InstallationException
See Also:
InstallationService.getJdkInformations(org.apache.maven.continuum.model.system.Installation)

getExecutorConfiguratorVersion

public List<String> getExecutorConfiguratorVersion(String path,
                                                   ExecutorConfigurator executorConfigurator,
                                                   Profile profile)
                                            throws InstallationException
Specified by:
getExecutorConfiguratorVersion in interface InstallationService
executorConfigurator - (ec)
Returns:
the cli output of $path/ec.relativePath.ec.executable ec.versionArgument
Throws:
InstallationException
See Also:
InstallationService.getExecutorConfiguratorVersion(java.lang.String, org.apache.maven.continuum.execution.ExecutorConfigurator, Profile)


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.