org.apache.continuum.profile
Class DefaultProfileService

java.lang.Object
  extended by org.apache.continuum.profile.DefaultProfileService
All Implemented Interfaces:
ProfileService

@Service(value="profileService")
public class DefaultProfileService
extends Object
implements ProfileService

Since:
15 juin 07
Version:
$Id: DefaultProfileService.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.profile.ProfileService
ROLE
 
Constructor Summary
DefaultProfileService()
           
 
Method Summary
 void addEnvVarInProfile(Profile profile, Installation envVar)
           
 void addInstallationInProfile(Profile profile, Installation installation)
           
 Profile addProfile(Profile profile)
          Add an empty profile without builder, jdk and envVars
 boolean alreadyExistsProfileName(Profile profile)
           
 void deleteProfile(int profileId)
           
 List<Profile> getAllProfiles()
           
 Profile getProfile(int profileId)
           
 Profile getProfileWithName(String profileName)
           
 void removeInstallationFromProfile(Profile profile, Installation installation)
           
 void setBuilderInProfile(Profile profile, Installation builder)
           
 void setJdkInProfile(Profile profile, Installation jdk)
           
 void updateProfile(Profile profile)
           
 void updateProfileCheckDuplicateName(Profile profile, boolean checkDuplicateName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProfileService

public DefaultProfileService()
Method Detail

updateProfile

public void updateProfile(Profile profile)
                   throws ProfileException,
                          AlreadyExistsProfileException
Specified by:
updateProfile in interface ProfileService
Throws:
ProfileException
AlreadyExistsProfileException - if a profile with the same name already exists
See Also:
ProfileService.updateProfile(org.apache.maven.continuum.model.system.Profile)

updateProfileCheckDuplicateName

public void updateProfileCheckDuplicateName(Profile profile,
                                            boolean checkDuplicateName)
                                     throws ProfileException,
                                            AlreadyExistsProfileException
Throws:
ProfileException
AlreadyExistsProfileException

addProfile

public Profile addProfile(Profile profile)
                   throws ProfileException,
                          AlreadyExistsProfileException
Description copied from interface: ProfileService
Add an empty profile without builder, jdk and envVars

Specified by:
addProfile in interface ProfileService
Returns:
Throws:
ProfileException
AlreadyExistsProfileException - if a profile with the same name already exists
See Also:
ProfileService.addProfile(org.apache.maven.continuum.model.system.Profile)

deleteProfile

public void deleteProfile(int profileId)
                   throws ProfileException
Specified by:
deleteProfile in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.deleteProfile(int)

getAllProfiles

public List<Profile> getAllProfiles()
                             throws ProfileException
Specified by:
getAllProfiles in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.getAllProfiles()

getProfile

public Profile getProfile(int profileId)
                   throws ProfileException
Specified by:
getProfile in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.getProfile(int)

setBuilderInProfile

public void setBuilderInProfile(Profile profile,
                                Installation builder)
                         throws ProfileException
Specified by:
setBuilderInProfile in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.setBuilderInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)

setJdkInProfile

public void setJdkInProfile(Profile profile,
                            Installation jdk)
                     throws ProfileException
Specified by:
setJdkInProfile in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.setJdkInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)

addEnvVarInProfile

public void addEnvVarInProfile(Profile profile,
                               Installation envVar)
                        throws ProfileException
Specified by:
addEnvVarInProfile in interface ProfileService
Throws:
ProfileException
See Also:
ProfileService.addEnvVarInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)

addInstallationInProfile

public void addInstallationInProfile(Profile profile,
                                     Installation installation)
                              throws ProfileException
Specified by:
addInstallationInProfile in interface ProfileService
Throws:
ProfileException

removeInstallationFromProfile

public void removeInstallationFromProfile(Profile profile,
                                          Installation installation)
                                   throws ProfileException
Specified by:
removeInstallationFromProfile in interface ProfileService
Throws:
ProfileException

getProfileWithName

public Profile getProfileWithName(String profileName)
                           throws ProfileException
Specified by:
getProfileWithName in interface ProfileService
Throws:
ProfileException

alreadyExistsProfileName

public boolean alreadyExistsProfileName(Profile profile)
                                 throws ProfileException
Specified by:
alreadyExistsProfileName in interface ProfileService
Parameters:
profile -
Returns:
true if profile with same name (case sensitive) exists
Throws:
ProfileException


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