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 java.util.List;
23  
24  import org.apache.maven.continuum.execution.ExecutorConfigurator;
25  import org.apache.maven.continuum.model.system.Installation;
26  import org.apache.maven.continuum.model.system.Profile;
27  import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
28  
29  /**
30   * @author <a href="mailto:olamy@codehaus.org">olamy</a>
31   * @version $Id: InstallationService.java 729143 2008-12-23 22:21:06Z olamy $
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 List<Installation> getAllInstallations()
64          throws InstallationException;
65  
66      public String getEnvVar( String type );
67  
68      /**
69       * @param type
70       * @return ExecutorConfigurator or null if unknown type
71       */
72      public ExecutorConfigurator getExecutorConfigurator( String type );
73  
74  
75      /**
76       * @param installation
77       * @return output of JAVA_HOME/bin/java -version (JAVA_HOME = installation.getVarValue()
78       * @throws InstallationException
79       */
80      public List<String> getJdkInformations( Installation installation )
81          throws InstallationException;
82  
83      /**
84       * @return output of JAVA_HOME/bin/java -version
85       * @throws InstallationException
86       */
87      public List<String> getDefaultJdkInformations()
88          throws InstallationException;
89  
90      /**
91       * @param path
92       * @param executorConfigurator (ec)
93       * @return the cli output of $path/ec.relativePath.ec.executable ec.versionArgument
94       * @throws InstallationException
95       */
96      public List<String> getExecutorConfiguratorVersion( String path, ExecutorConfigurator executorConfigurator, Profile profile )
97          throws InstallationException;
98  
99  }