Class EnvironmentRepositoryImpl
java.lang.Object
org.qubership.atp.environments.repo.impl.AbstractRepository
org.qubership.atp.environments.repo.impl.EnvironmentRepositoryImpl
- All Implemented Interfaces:
ProjectionRepository<Environment>
@Repository
public class EnvironmentRepositoryImpl
extends AbstractRepository
implements ProjectionRepository<Environment>
-
Field Summary
Fields inherited from class org.qubership.atp.environments.repo.impl.AbstractRepository
ALERT_EVENTS, ALERTS, CONNECTIONS, DATABASE_DIRECTORY, ENVIRONMENT_CATEGORIES, ENVIRONMENT_SYSTEMS, ENVIRONMENTS, JV_COMMIT, JV_COMMIT_PROPERTY, JV_GLOBAL_ID, JV_SNAPSHOT, PROJECTS, SUBSCRIBERS, SUBSCRIPTIONS, SYSTEM_CATEGORIES, SYSTEMS, UPDATE_EVENTS, USER_SETTINGS -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentRepositoryImpl(com.querydsl.sql.SQLQueryFactory queryFactory, javax.inject.Provider<ProjectRepositoryImpl> projectRepo, javax.inject.Provider<SystemRepositoryImpl> systemRepo, javax.inject.Provider<ConnectionRepositoryImpl> connectionRepo, javax.inject.Provider<SystemCategoryRepositoryImpl> systemCategoryRepo, CommitEntityService<Environment> commitEntityService, KafkaService kafkaService, ContextRepository contextRepository, EnvironmentMapper mapper) TODO Make javadoc documentation for this method. -
Method Summary
Modifier and TypeMethodDescriptioncreate(String name, String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, Long created, UUID createdBy, UUID projectId, UUID categoryId, List<String> tags) Creates an environment with autogeneratedUUID.create(UUID environmentId, String name, String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, Long created, UUID createdBy, UUID projectId, UUID categoryId, UUID sourceId, List<String> tags) Creates an environment with manualUUID.org.postgresql.util.PGobjectcreateTagsPgObject(List<String> tags) Create PgObject for tags setting in environments table.voidDelete environment.booleanexistsById(UUID id) findBySearchRequest(BaseSearchRequestDto searchRequest, List<UUID> projectIdsWithAccess) Search environments by request with criteria.geShortByIds(List<UUID> uuids) Gets environments id by list of id.getAll()Returns environments by categoryId.getAllByParentId(UUID projectId) TODO Make javadoc documentation for this method.getAllByParentId(UUID projectId, UUID... categoryIds) TODO Make javadoc documentation for this method.getAllBySystemId(UUID systemId) TODO Make javadoc documentation for this method.getAllShortByParentId(UUID projectId, UUID... categoryIds) TODO Make javadoc documentation for this method.getAllShortBySystemId(UUID systemId) TODO Make javadoc documentation for this method.TODO.Gets environments id by list of id.getByNameAndProjectId(String name, UUID projectId) Gets by name and project id.getBySourceIdAndProjectId(UUID sourceId, UUID projectId) Get environment by source id and project id.getConnectionNamesByProjectId(UUID projectId) Getting a list of project connection names.getEnvironmentsByFilterPaged(EnvironmentsWithFilterRequest request, Integer size, Integer offset) Search environments by project id and systemCategoryId.com.querydsl.core.types.MappingProjection<Environment> com.querydsl.core.types.MappingProjection<Environment> getNameById(UUID id) getProjectId(UUID environmentId) Method for getting projectId by environmentId.getProjectIdByEnvironmentId(UUID environmentId) Get project ID by environment ID.getProjectIdBySystemId(UUID systemId) Gets project id by system id.javax.inject.Provider<ProjectRepositoryImpl> com.querydsl.core.types.MappingProjection<Environment> getSystemNamesByProjectId(UUID projectId) Getting a list of project system names.javax.inject.Provider<SystemRepositoryImpl> update(UUID environmentId, String name, String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, Long modified, UUID modifiedBy, UUID projectId, UUID categoryId, List<String> tags) TODO Make javadoc documentation for this method.voidupdateEnvironmentsModified(UUID environmentId, Timestamp modified, UUID modifiedBy, UUID projectId) Method for updating environment modified info.voidupdateEnvironmentsModified(Environment environment, Timestamp modified, UUID modifiedBy) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.environments.repo.impl.ProjectionRepository
resolveProjection
-
Constructor Details
-
EnvironmentRepositoryImpl
@Autowired public EnvironmentRepositoryImpl(com.querydsl.sql.SQLQueryFactory queryFactory, javax.inject.Provider<ProjectRepositoryImpl> projectRepo, javax.inject.Provider<SystemRepositoryImpl> systemRepo, javax.inject.Provider<ConnectionRepositoryImpl> connectionRepo, javax.inject.Provider<SystemCategoryRepositoryImpl> systemCategoryRepo, CommitEntityService<Environment> commitEntityService, KafkaService kafkaService, ContextRepository contextRepository, EnvironmentMapper mapper) TODO Make javadoc documentation for this method.
-
-
Method Details
-
getProjectRepo
-
getSystemRepo
-
getById
TODO. -
getNameById
-
existsById
-
getAll
-
getAll
Returns environments by categoryId. -
getAllByParentId
TODO Make javadoc documentation for this method. -
getAllByParentId
@Nullable public List<Environment> getAllByParentId(@Nonnull UUID projectId, @Nonnull UUID... categoryIds) TODO Make javadoc documentation for this method. -
getAllShortByParentId
@Nullable public List<Environment> getAllShortByParentId(@Nonnull UUID projectId, @Nonnull UUID... categoryIds) TODO Make javadoc documentation for this method. -
getSystemNamesByProjectId
Getting a list of project system names.- Parameters:
projectId- Project identifier- Returns:
- list of system names
-
getConnectionNamesByProjectId
Getting a list of project connection names.- Parameters:
projectId- Project identifier- Returns:
- list of connection names
-
create
@Nonnull public Environment create(@Nonnull UUID environmentId, @Nonnull String name, @Nonnull String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, @Nonnull Long created, @Nonnull UUID createdBy, @Nonnull UUID projectId, @Nonnull UUID categoryId, UUID sourceId, List<String> tags) Creates an environment with manualUUID.- Parameters:
environmentId- environmentIdname- namedescription- descriptioncreated- createdcreatedBy- createdByprojectId- projectIdcategoryId- categoryIdsourceId- sourceId- Returns:
- an istance of
Environment
-
create
@Nonnull public Environment create(@Nonnull String name, @Nonnull String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, @Nonnull Long created, @Nonnull UUID createdBy, @Nonnull UUID projectId, @Nonnull UUID categoryId, List<String> tags) Creates an environment with autogeneratedUUID.- Parameters:
name- namedescription- descriptioncreated- createdcreatedBy- createdByprojectId- projectIdcategoryId- categoryId- Returns:
- an istance of
Environment
-
update
@Nonnull public Environment update(@Nonnull UUID environmentId, @Nonnull String name, @Nonnull String graylogName, String description, String ssmSolutionAlias, String ssmInstanceAlias, String consulEgressConfigPath, @Nonnull Long modified, @Nonnull UUID modifiedBy, @Nonnull UUID projectId, @Nonnull UUID categoryId, List<String> tags) TODO Make javadoc documentation for this method. -
delete
Delete environment. -
updateEnvironmentsModified
public void updateEnvironmentsModified(@Nonnull Environment environment, Timestamp modified, UUID modifiedBy) -
updateEnvironmentsModified
public void updateEnvironmentsModified(@Nonnull UUID environmentId, Timestamp modified, UUID modifiedBy, UUID projectId) Method for updating environment modified info. -
getProjectId
Method for getting projectId by environmentId. -
getAllBySystemId
@Cacheable(value="ATP_ENVIRONMENTS-ENVIRONMENTS_BY_SYSTEM_ID", key="#systemId", condition="#systemId!=null") public List<Environment> getAllBySystemId(UUID systemId) TODO Make javadoc documentation for this method. -
getAllShortBySystemId
TODO Make javadoc documentation for this method. -
getByIds
Gets environments id by list of id. -
geShortByIds
Gets environments id by list of id. -
getProjectIdBySystemId
Gets project id by system id. -
getProjectIdByEnvironmentId
Get project ID by environment ID.- Parameters:
environmentId- environment ID- Returns:
- project ID
-
getByNameAndProjectId
Gets by name and project id.- Parameters:
name- the nameprojectId- the project id- Returns:
- the by name and project id
-
getBySourceIdAndProjectId
Get environment by source id and project id.- Parameters:
sourceId- the source idprojectId- the project id- Returns:
- the by name and project id
-
findBySearchRequest
public List<Environment> findBySearchRequest(BaseSearchRequestDto searchRequest, List<UUID> projectIdsWithAccess) throws Exception Search environments by request with criteria.- Parameters:
searchRequest- search request- Returns:
- found environments
- Throws:
Exception
-
getContext
- Specified by:
getContextin interfaceProjectionRepository<Environment>
-
getFullProjection
- Specified by:
getFullProjectionin interfaceProjectionRepository<Environment>
-
getLazyProjection
- Specified by:
getLazyProjectionin interfaceProjectionRepository<Environment>
-
getShortProjection
- Specified by:
getShortProjectionin interfaceProjectionRepository<Environment>
-
getEnvironmentsByFilterPaged
public List<Environment> getEnvironmentsByFilterPaged(EnvironmentsWithFilterRequest request, Integer size, Integer offset) Search environments by project id and systemCategoryId.- Parameters:
request- EnvironmentsWithFilterRequest.size- size of the requested list.offset- start position for search.- Returns:
- found environments
-
createTagsPgObject
Create PgObject for tags setting in environments table.- Parameters:
tags- list of the tags.- Returns:
- PgObject with "jsonb" type.
-