1 package org.apache.maven.continuum.profile;
2
3 import org.apache.maven.continuum.model.system.Installation;
4 import org.apache.maven.continuum.model.system.Profile;
5
6 import java.util.List;
7
8 /*
9 * Licensed to the Apache Software Foundation (ASF) under one
10 * or more contributor license agreements. See the NOTICE file
11 * distributed with this work for additional information
12 * regarding copyright ownership. The ASF licenses this file
13 * to you under the Apache License, Version 2.0 (the
14 * "License"); you may not use this file except in compliance
15 * with the License. You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing,
20 * software distributed under the License is distributed on an
21 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22 * KIND, either express or implied. See the License for the
23 * specific language governing permissions and limitations
24 * under the License.
25 */
26
27 /**
28 * @author <a href="mailto:olamy@codehaus.org">olamy</a>
29 * @version $Id: ProfileService.java 1372260 2012-08-13 04:29:09Z brett $
30 * @since 15 juin 07
31 */
32 public interface ProfileService
33 {
34 String ROLE = ProfileService.class.getName();
35
36 public Profile getProfile( int profileId )
37 throws ProfileException;
38
39 public void deleteProfile( int profileId )
40 throws ProfileException;
41
42 /**
43 * @param profile
44 * @throws ProfileException
45 * @throws AlreadyExistsProfileException if a profile with the same name already exists
46 */
47 public void updateProfile( Profile profile )
48 throws ProfileException, AlreadyExistsProfileException;
49
50 /**
51 * <b>Add an empty profile without builder, jdk and envVars</b>
52 *
53 * @param profile
54 * @return
55 * @throws ProfileException
56 * @throws AlreadyExistsProfileException if a profile with the same name already exists
57 */
58 public Profile addProfile( Profile profile )
59 throws ProfileException, AlreadyExistsProfileException;
60
61 public List<Profile> getAllProfiles()
62 throws ProfileException;
63
64 public void setJdkInProfile( Profile profile, Installation jdk )
65 throws ProfileException;
66
67 public void setBuilderInProfile( Profile profile, Installation builder )
68 throws ProfileException;
69
70 public void addEnvVarInProfile( Profile profile, Installation envVar )
71 throws ProfileException;
72
73 public void addInstallationInProfile( Profile profile, Installation installation )
74 throws ProfileException;
75
76 /**
77 * @param profile
78 * @param installation
79 * @throws ProfileException
80 * @since 1.1-beta-4
81 */
82 public void removeInstallationFromProfile( Profile profile, Installation installation )
83 throws ProfileException;
84
85 public Profile getProfileWithName( String profileName )
86 throws ProfileException;
87
88 public boolean alreadyExistsProfileName( Profile profile )
89 throws ProfileException;
90 }