View Javadoc

1   package org.apache.maven.continuum.installation;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.continuum.execution.ExecutorConfigurator;
23  import org.apache.maven.continuum.model.system.Installation;
24  import org.apache.maven.continuum.model.system.Profile;
25  import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
26  
27  import java.util.List;
28  
29  /**
30   * @author <a href="mailto:olamy@codehaus.org">olamy</a>
31   * @version $Id: InstallationService.java 1372260 2012-08-13 04:29:09Z brett $
32   * @since 13 juin 07
33   */
34  public interface InstallationService
35  {
36      String ROLE = InstallationService.class.getName();
37  
38      String JDK_TYPE = "jdk";
39  
40      String MAVEN2_TYPE = "maven2";
41  
42      String MAVEN1_TYPE = "maven1";
43  
44      String ANT_TYPE = "ant";
45  
46      String ENVVAR_TYPE = "envvar";
47  
48      public Installation add( Installation installation, boolean automaticProfile )
49          throws InstallationException, AlreadyExistsProfileException, AlreadyExistsInstallationException;
50  
51      public Installation add( Installation installation )
52          throws InstallationException, AlreadyExistsInstallationException;
53  
54      public void update( Installation installation )
55          throws InstallationException, AlreadyExistsInstallationException;
56  
57      public void delete( Installation installation )
58          throws InstallationException;
59  
60      public Installation getInstallation( int installationId )
61          throws InstallationException;
62  
63      public Installation getInstallation( String installationName )
64          throws InstallationException;
65  
66      public List<Installation> getAllInstallations()
67          throws InstallationException;
68  
69      public String getEnvVar( String type );
70  
71      /**
72       * @param type
73       * @return ExecutorConfigurator or null if unknown type
74       */
75      public ExecutorConfigurator getExecutorConfigurator( String type );
76  
77  
78      /**
79       * @param installation
80       * @return output of JAVA_HOME/bin/java -version (JAVA_HOME = installation.getVarValue()
81       * @throws InstallationException
82       */
83      public List<String> getJdkInformations( Installation installation )
84          throws InstallationException;
85  
86      /**
87       * @return output of JAVA_HOME/bin/java -version
88       * @throws InstallationException
89       */
90      public List<String> getDefaultJdkInformations()
91          throws InstallationException;
92  
93      /**
94       * @param path
95       * @param executorConfigurator (ec)
96       * @return the cli output of $path/ec.relativePath.ec.executable ec.versionArgument
97       * @throws InstallationException
98       */
99      public List<String> getExecutorConfiguratorVersion( String path, ExecutorConfigurator executorConfigurator,
100                                                         Profile profile )
101         throws InstallationException;
102 
103 }