@Transactional(rollbackFor={com.netflix.genie.common.exceptions.GenieException.class,com.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException.class,javax.validation.ConstraintViolationException.class})
public class JpaApplicationPersistenceServiceImpl
extends java.lang.Object
implements ApplicationPersistenceService
| Constructor and Description |
|---|
JpaApplicationPersistenceServiceImpl(JpaTagPersistenceService tagPersistenceService,
JpaFilePersistenceService filePersistenceService,
JpaApplicationRepository applicationRepository,
JpaClusterRepository clusterRepository,
JpaCommandRepository commandRepository)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigsToApplication(@NotBlank(message="No application id entered. Unable to add configurations.") java.lang.String id,
@NotEmpty(message="No configuration files entered.") java.util.Set<java.lang.String> configs)
Add a configuration file to the application.
|
void |
addDependenciesForApplication(@NotBlank(message="No application id entered. Unable to add dependencies.") java.lang.String id,
@NotEmpty(message="No dependencies entered. Unable to add dependencies.") java.util.Set<java.lang.String> dependencies)
Add dependency files to the application.
|
void |
addTagsForApplication(@NotBlank(message="No application id entered. Unable to add tags.") java.lang.String id,
@NotEmpty(message="No tags entered. Unable to add.") java.util.Set<java.lang.String> tags)
Add tags to the application.
|
java.lang.String |
createApplication(@NotNull(message="No application entered to create.") @Valid com.netflix.genie.common.internal.dto.v4.ApplicationRequest applicationRequest)
Create new application.
|
void |
deleteAllApplications()
Delete all applications from database.
|
void |
deleteApplication(@NotBlank(message="No application id entered. Unable to delete.") java.lang.String id)
Delete an application configuration from database.
|
com.netflix.genie.common.internal.dto.v4.Application |
getApplication(@NotBlank(message="No id entered. Unable to get") java.lang.String id)
Gets application for given id.
|
org.springframework.data.domain.Page<com.netflix.genie.common.internal.dto.v4.Application> |
getApplications(java.lang.String name,
java.lang.String user,
java.util.Set<com.netflix.genie.common.dto.ApplicationStatus> statuses,
java.util.Set<java.lang.String> tags,
java.lang.String type,
org.springframework.data.domain.Pageable page)
Get applications for given filter criteria.
|
java.util.Set<com.netflix.genie.common.internal.dto.v4.Command> |
getCommandsForApplication(@NotBlank(message="No application id entered. Unable to get commands.") java.lang.String id,
java.util.Set<com.netflix.genie.common.dto.CommandStatus> statuses)
Get all the commands the application with given id is associated with.
|
java.util.Set<java.lang.String> |
getConfigsForApplication(@NotBlank(message="No application id entered. Unable to get configs.") java.lang.String id)
Get the set of configuration files associated with the application with
given id.
|
java.util.Set<java.lang.String> |
getDependenciesForApplication(@NotBlank(message="No application id entered. Unable to get dependencies.") java.lang.String id)
Get the set of dependency files associated with the application with given id.
|
java.util.Set<java.lang.String> |
getTagsForApplication(@NotBlank(message="No application id entered. Cannot retrieve tags.") java.lang.String id)
Get the set of tags associated with the application with given
id.
|
void |
patchApplication(@NotBlank java.lang.String id,
@NotNull com.github.fge.jsonpatch.JsonPatch patch)
Patch an application with the given json patch.
|
void |
removeAllConfigsForApplication(@NotBlank(message="No application id entered. Unable to remove configs.") java.lang.String id)
Remove all configuration files from the application.
|
void |
removeAllDependenciesForApplication(@NotBlank(message="No application id entered. Unable to remove dependencies.") java.lang.String id)
Remove all dependency files from the application.
|
void |
removeAllTagsForApplication(@NotBlank(message="No application id entered. Unable to remove tags.") java.lang.String id)
Remove all tags from the application.
|
void |
removeConfigForApplication(@NotBlank(message="No application id entered. Unable to remove configuration.") java.lang.String id,
@NotBlank(message="No config entered. Unable to remove.") java.lang.String config)
Remove a configuration file from the application.
|
void |
removeDependencyForApplication(@NotBlank(message="No application id entered. Unable to remove dependency.") java.lang.String id,
@NotBlank(message="No dependency entered. Unable to remove dependency.") java.lang.String dependency)
Remove a dependency file from the application.
|
void |
removeTagForApplication(@NotBlank(message="No application id entered. Unable to remove tag.") java.lang.String id,
@NotBlank(message="No tag entered. Unable to remove.") java.lang.String tag)
Remove a tag from the application.
|
void |
updateApplication(@NotBlank(message="No application id entered. Unable to update.") java.lang.String id,
@NotNull(message="No application information entered. Unable to update.") @Valid com.netflix.genie.common.internal.dto.v4.Application updateApp)
Update an application.
|
void |
updateConfigsForApplication(@NotBlank(message="No application id entered. Unable to update configurations.") java.lang.String id,
@NotNull(message="No configs entered. Unable to update. If you want, use delete API.") java.util.Set<java.lang.String> configs)
Update the set of configuration files associated with the application
with given id.
|
void |
updateDependenciesForApplication(@NotBlank(message="No application id entered. Unable to update dependencies.") java.lang.String id,
@NotNull(message="No dependencies entered. Unable to update.") java.util.Set<java.lang.String> dependencies)
Update the set of dependency files associated with the application with given
id.
|
void |
updateTagsForApplication(@NotBlank(message="No application id entered. Unable to update tags.") java.lang.String id,
@NotNull(message="No tags entered unable to update tags.") java.util.Set<java.lang.String> tags)
Update the set of tags associated with the application with
given id.
|
public JpaApplicationPersistenceServiceImpl(JpaTagPersistenceService tagPersistenceService, JpaFilePersistenceService filePersistenceService, JpaApplicationRepository applicationRepository, JpaClusterRepository clusterRepository, JpaCommandRepository commandRepository)
tagPersistenceService - The JpaTagPersistenceService to usefilePersistenceService - The JpaFilePersistenceService to useapplicationRepository - The JpaApplicationRepository to useclusterRepository - The JpaClusterRepository to usecommandRepository - The JpaCommandRepository to usepublic java.lang.String createApplication(@NotNull(message="No application entered to create.") @Valid
@NotNull(message="No application entered to create.") @Valid com.netflix.genie.common.internal.dto.v4.ApplicationRequest applicationRequest)
throws com.netflix.genie.common.exceptions.GenieException
createApplication in interface ApplicationPersistenceServiceapplicationRequest - The application request containing the metadata of the application to createcom.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public com.netflix.genie.common.internal.dto.v4.Application getApplication(@NotBlank(message="No id entered. Unable to get")
@NotBlank(message="No id entered. Unable to get") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
getApplication in interface ApplicationPersistenceServiceid - unique id for application configuration to get. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public org.springframework.data.domain.Page<com.netflix.genie.common.internal.dto.v4.Application> getApplications(@Nullable
java.lang.String name,
@Nullable
java.lang.String user,
@Nullable
java.util.Set<com.netflix.genie.common.dto.ApplicationStatus> statuses,
@Nullable
java.util.Set<java.lang.String> tags,
@Nullable
java.lang.String type,
org.springframework.data.domain.Pageable page)
getApplications in interface ApplicationPersistenceServicename - Name of application. Can be null or empty.user - The user who created the application. Can be null/emptystatuses - The statuses of the applications to find. Can be null.tags - Tags allocated to this applicationtype - The type of the application to findpage - The page requested from the search resultspublic void updateApplication(@NotBlank(message="No application id entered. Unable to update.")
@NotBlank(message="No application id entered. Unable to update.") java.lang.String id,
@NotNull(message="No application information entered. Unable to update.") @Valid
@NotNull(message="No application information entered. Unable to update.") @Valid com.netflix.genie.common.internal.dto.v4.Application updateApp)
throws com.netflix.genie.common.exceptions.GenieException
updateApplication in interface ApplicationPersistenceServiceid - The id of the application configuration to updateupdateApp - Information to update for the application configuration
withcom.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void patchApplication(@NotBlank
@NotBlank java.lang.String id,
@NotNull
@NotNull com.github.fge.jsonpatch.JsonPatch patch)
throws com.netflix.genie.common.exceptions.GenieException
patchApplication in interface ApplicationPersistenceServiceid - The id of the application to updatepatch - The json patch to use to update the given applicationcom.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void deleteAllApplications()
throws com.netflix.genie.common.exceptions.GenieException
deleteAllApplications in interface ApplicationPersistenceServicecom.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void deleteApplication(@NotBlank(message="No application id entered. Unable to delete.")
@NotBlank(message="No application id entered. Unable to delete.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
deleteApplication in interface ApplicationPersistenceServiceid - unique id of application configuration to deletecom.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void addConfigsToApplication(@NotBlank(message="No application id entered. Unable to add configurations.")
@NotBlank(message="No application id entered. Unable to add configurations.") java.lang.String id,
@NotEmpty(message="No configuration files entered.")
@NotEmpty(message="No configuration files entered.") java.util.Set<java.lang.String> configs)
throws com.netflix.genie.common.exceptions.GenieException
addConfigsToApplication in interface ApplicationPersistenceServiceid - The id of the application to add the configuration file to. Not
null/empty/blank.configs - The configuration files to add. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public java.util.Set<java.lang.String> getConfigsForApplication(@NotBlank(message="No application id entered. Unable to get configs.")
@NotBlank(message="No application id entered. Unable to get configs.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
getConfigsForApplication in interface ApplicationPersistenceServiceid - The id of the application to get the configuration files for.
Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void updateConfigsForApplication(@NotBlank(message="No application id entered. Unable to update configurations.")
@NotBlank(message="No application id entered. Unable to update configurations.") java.lang.String id,
@NotNull(message="No configs entered. Unable to update. If you want, use delete API.")
@NotNull(message="No configs entered. Unable to update. If you want, use delete API.") java.util.Set<java.lang.String> configs)
throws com.netflix.genie.common.exceptions.GenieException
updateConfigsForApplication in interface ApplicationPersistenceServiceid - The id of the application to update the configuration files
for. Not null/empty/blank.configs - The configuration files to replace existing configurations
with. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeAllConfigsForApplication(@NotBlank(message="No application id entered. Unable to remove configs.")
@NotBlank(message="No application id entered. Unable to remove configs.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
removeAllConfigsForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the configuration file
from. Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeConfigForApplication(@NotBlank(message="No application id entered. Unable to remove configuration.")
@NotBlank(message="No application id entered. Unable to remove configuration.") java.lang.String id,
@NotBlank(message="No config entered. Unable to remove.")
@NotBlank(message="No config entered. Unable to remove.") java.lang.String config)
throws com.netflix.genie.common.exceptions.GenieException
removeConfigForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the configuration file
from. Not null/empty/blank.config - The configuration file to remove. Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void addDependenciesForApplication(@NotBlank(message="No application id entered. Unable to add dependencies.")
@NotBlank(message="No application id entered. Unable to add dependencies.") java.lang.String id,
@NotEmpty(message="No dependencies entered. Unable to add dependencies.")
@NotEmpty(message="No dependencies entered. Unable to add dependencies.") java.util.Set<java.lang.String> dependencies)
throws com.netflix.genie.common.exceptions.GenieException
addDependenciesForApplication in interface ApplicationPersistenceServiceid - The id of the application to add the dependency file to. Not
null/empty/blank.dependencies - The dependency files to add. Not null.com.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public java.util.Set<java.lang.String> getDependenciesForApplication(@NotBlank(message="No application id entered. Unable to get dependencies.")
@NotBlank(message="No application id entered. Unable to get dependencies.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
getDependenciesForApplication in interface ApplicationPersistenceServiceid - The id of the application to get the dependency files for. Not
null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void updateDependenciesForApplication(@NotBlank(message="No application id entered. Unable to update dependencies.")
@NotBlank(message="No application id entered. Unable to update dependencies.") java.lang.String id,
@NotNull(message="No dependencies entered. Unable to update.")
@NotNull(message="No dependencies entered. Unable to update.") java.util.Set<java.lang.String> dependencies)
throws com.netflix.genie.common.exceptions.GenieException
updateDependenciesForApplication in interface ApplicationPersistenceServiceid - The id of the application to update the dependency files for. Not
null/empty/blank.dependencies - The dependency files to replace existing dependencies with. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeAllDependenciesForApplication(@NotBlank(message="No application id entered. Unable to remove dependencies.")
@NotBlank(message="No application id entered. Unable to remove dependencies.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
removeAllDependenciesForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the configuration file
from. Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeDependencyForApplication(@NotBlank(message="No application id entered. Unable to remove dependency.")
@NotBlank(message="No application id entered. Unable to remove dependency.") java.lang.String id,
@NotBlank(message="No dependency entered. Unable to remove dependency.")
@NotBlank(message="No dependency entered. Unable to remove dependency.") java.lang.String dependency)
throws com.netflix.genie.common.exceptions.GenieException
removeDependencyForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the dependency file from. Not
null/empty/blank.dependency - The dependency file to remove. Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void addTagsForApplication(@NotBlank(message="No application id entered. Unable to add tags.")
@NotBlank(message="No application id entered. Unable to add tags.") java.lang.String id,
@NotEmpty(message="No tags entered. Unable to add.")
@NotEmpty(message="No tags entered. Unable to add.") java.util.Set<java.lang.String> tags)
throws com.netflix.genie.common.exceptions.GenieException
addTagsForApplication in interface ApplicationPersistenceServiceid - The id of the application to add the tags to. Not
null/empty/blank.tags - The tags to add. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public java.util.Set<java.lang.String> getTagsForApplication(@NotBlank(message="No application id entered. Cannot retrieve tags.")
@NotBlank(message="No application id entered. Cannot retrieve tags.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
getTagsForApplication in interface ApplicationPersistenceServiceid - The id of the application to get the tags for. Not
null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void updateTagsForApplication(@NotBlank(message="No application id entered. Unable to update tags.")
@NotBlank(message="No application id entered. Unable to update tags.") java.lang.String id,
@NotNull(message="No tags entered unable to update tags.")
@NotNull(message="No tags entered unable to update tags.") java.util.Set<java.lang.String> tags)
throws com.netflix.genie.common.exceptions.GenieException
updateTagsForApplication in interface ApplicationPersistenceServiceid - The id of the application to update the tags for.
Not null/empty/blank.tags - The tags to replace existing tags
with. Not null/empty.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeAllTagsForApplication(@NotBlank(message="No application id entered. Unable to remove tags.")
@NotBlank(message="No application id entered. Unable to remove tags.") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieException
removeAllTagsForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the tags from.
Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an errorpublic void removeTagForApplication(@NotBlank(message="No application id entered. Unable to remove tag.")
@NotBlank(message="No application id entered. Unable to remove tag.") java.lang.String id,
@NotBlank(message="No tag entered. Unable to remove.")
@NotBlank(message="No tag entered. Unable to remove.") java.lang.String tag)
throws com.netflix.genie.common.exceptions.GenieException
removeTagForApplication in interface ApplicationPersistenceServiceid - The id of the application to remove the tag from. Not
null/empty/blank.tag - The tag to remove. Not null/empty/blank.com.netflix.genie.common.exceptions.GenieException - if there is an error@Transactional(readOnly=true)
public java.util.Set<com.netflix.genie.common.internal.dto.v4.Command> getCommandsForApplication(@NotBlank(message="No application id entered. Unable to get commands.")
@NotBlank(message="No application id entered. Unable to get commands.") java.lang.String id,
@Nullable
java.util.Set<com.netflix.genie.common.dto.CommandStatus> statuses)
throws com.netflix.genie.common.exceptions.GenieException
getCommandsForApplication in interface ApplicationPersistenceServiceid - The id of the application to get the commands for.statuses - The status of the commands returnedcom.netflix.genie.common.exceptions.GenieException - if there is an error