Class SystemRepositoryImpl
java.lang.Object
org.qubership.atp.environments.repo.impl.AbstractRepository
org.qubership.atp.environments.repo.impl.SystemRepositoryImpl
- All Implemented Interfaces:
ProjectionRepository<System>
@Repository
public class SystemRepositoryImpl
extends AbstractRepository
implements ProjectionRepository<System>
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionSystemRepositoryImpl(com.querydsl.sql.SQLQueryFactory queryFactory, javax.inject.Provider<EnvironmentRepositoryImpl> environmentRepo, javax.inject.Provider<SystemCategoryRepositoryImpl> systemCategoryRepo, javax.inject.Provider<ConnectionRepositoryImpl> connectionRepo, CommitEntityService<System> commitSystemService, CommitEntityService<Environment> commitEnvironmentService, KafkaService kafkaService, org.springframework.cache.CacheManager cacheManager, ContextRepository contextRepository) TODO Make javadoc documentation for this method. -
Method Summary
Modifier and TypeMethodDescriptionList<com.querydsl.core.Tuple> checkSystemNameIsUniqueUnderEnvironment(UUID environmentId, String systemName) Getting a list of systems with specified name under environment.List<com.querydsl.core.Tuple> checkSystemNameIsUniqueUnderEnvironments(List<UUID> environmentIds, String systemName) Getting a list of systems with specified name under environment.create(UUID environmentId, String name, String description, Long created, UUID createdBy, UUID systemCategoryId, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, String externalName) Creates system with autogeneratedUUIDfield.create(UUID environmentId, UUID systemId, String name, String description, Long created, UUID createdBy, UUID systemCategoryId, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, UUID sourceId, String externalName) Creates system with manual createdUUIDfield.voiddelete(UUID id, UUID environmentId, Long modified, UUID modifiedBy, boolean sendKafkaUpdateEnvironmentEvent) This method delete communication system with the environment if the system is a shared or the whole system, if the system is used in one place.booleanexistsById(UUID id) getAll()getAllByParentId(UUID environmentId) TODO Make javadoc documentation for this method.getAllByParentId(UUID environmentId, String systemType) TODO Make javadoc documentation for this method.getAllByParentIdAndCategoryId(UUID environmentId, UUID categoryId) TODO Make javadoc documentation for this method.getAllByParentIdV2(UUID environmentId) TODO Make javadoc documentation for this method.getAllByParentIdV2(UUID environmentId, String systemType) TODO Make javadoc documentation for this method.getAllShortByParentId(UUID environmentId) TODO Make javadoc documentation for this method.This method get system by id.getByLinkToSystemId(UUID linkToSystemId) getByListIds(List<UUID> systems) getBySourceId(UUID sourceId) Get system by source id and environment id.javax.inject.Provider<ConnectionRepositoryImpl> javax.inject.Provider<EnvironmentRepositoryImpl> com.querydsl.core.types.MappingProjection<System> com.querydsl.core.types.MappingProjection<System> getProjectId(UUID systemId) TODO Make javadoc documentation for this method.getShortById(UUID id) com.querydsl.core.types.MappingProjection<System> getSystemByNameAndEnvironmentId(String name, UUID environmentId) Get system by name and environmentId.javax.inject.Provider<SystemCategoryRepositoryImpl> getSystemNamesByProjectId(UUID projectId) Getting a list of project system names.getSystemsByIdsAndProjectId(List<UUID> systemIds, UUID projectId) Get projectIds by systemIds.getSystemsByProjectId(UUID projectId) Get system in project.share(UUID systemId, Environment targetEnvironment, Long modified, UUID modifiedBy) TODO Make javadoc documentation for this method.Stops system's sharing in specified environment.update(UUID id, String name, String description, Long modified, UUID modifiedBy, UUID systemCategoryId, Status status, Long dateOfLastCheck, String version, Long dateOfCheckVersion, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, String externalName, boolean useProxy, boolean sendKafkaUpdate) TODO Make javadoc documentation for this method.voidupdateSystemCategory(UUID id, UUID systemCategoryId, Long modified, UUID modifiedBy) Update system category.voidupdateSystemsModified(UUID id, Timestamp modified, UUID modifiedBy, boolean sendKafkaNotification, UUID projectId) Method update "modified" info of system and send kafka notification.voidupdateSystemsModified(UUID id, Timestamp modified, UUID modifiedBy, List<Environment> environments) Method update "modified" info of system and send kafka notification for system and all depended environments.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
-
Field Details
-
queryFactory
protected final com.querydsl.sql.SQLQueryFactory queryFactory
-
-
Constructor Details
-
SystemRepositoryImpl
@Autowired public SystemRepositoryImpl(com.querydsl.sql.SQLQueryFactory queryFactory, javax.inject.Provider<EnvironmentRepositoryImpl> environmentRepo, javax.inject.Provider<SystemCategoryRepositoryImpl> systemCategoryRepo, javax.inject.Provider<ConnectionRepositoryImpl> connectionRepo, CommitEntityService<System> commitSystemService, CommitEntityService<Environment> commitEnvironmentService, KafkaService kafkaService, org.springframework.cache.CacheManager cacheManager, ContextRepository contextRepository) TODO Make javadoc documentation for this method.
-
-
Method Details
-
getEnvironmentRepo
-
getSystemCategoryRepo
-
getConnectionRepo
-
getById
-
getShortById
-
existsById
-
getProjectId
TODO Make javadoc documentation for this method. -
getByIdV2
This method get system by id.- Parameters:
id- System id.
-
getSystemsByProjectId
Get system in project.- Parameters:
projectId- project Id.
-
getAll
-
getAllByParentId
@Nonnull @Cacheable(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID", key="#environmentId", condition="#environmentId!=null") public List<System> getAllByParentId(@Nonnull UUID environmentId) TODO Make javadoc documentation for this method. -
getAllByParentId
TODO Make javadoc documentation for this method. -
getAllByParentIdAndCategoryId
public List<System> getAllByParentIdAndCategoryId(@Nonnull UUID environmentId, @Nonnull UUID categoryId) TODO Make javadoc documentation for this method. -
getAllShortByParentId
TODO Make javadoc documentation for this method. -
getSystemNamesByProjectId
Getting a list of project system names.- Parameters:
projectId- Project identifier- Returns:
- list of system names
-
checkSystemNameIsUniqueUnderEnvironment
@Nonnull public List<com.querydsl.core.Tuple> checkSystemNameIsUniqueUnderEnvironment(@Nonnull UUID environmentId, String systemName) Getting a list of systems with specified name under environment.- Parameters:
environmentId- Environment identifiersystemName- name of the specified system- Returns:
- list of system names
-
checkSystemNameIsUniqueUnderEnvironments
@Nonnull public List<com.querydsl.core.Tuple> checkSystemNameIsUniqueUnderEnvironments(@Nonnull List<UUID> environmentIds, String systemName) Getting a list of systems with specified name under environment.- Parameters:
environmentIds- Environment identifiers.systemName- name of the specified system.- Returns:
- list of system names
-
getAllByParentIdV2
TODO Make javadoc documentation for this method. -
getAllByParentIdV2
@Nonnull public Collection<System> getAllByParentIdV2(@Nonnull UUID environmentId, String systemType) TODO Make javadoc documentation for this method. -
create
@Nonnull @CacheEvict(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID", key="#environmentId", condition="#environmentId!=null") public System create(@Nonnull UUID environmentId, @Nonnull String name, String description, Long created, UUID createdBy, UUID systemCategoryId, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, String externalName) Creates system with autogeneratedUUIDfield.- Parameters:
environmentId- environmentIdname- namedescription- descriptioncreated- createdcreatedBy- createdBysystemCategoryId- systemCategoryIdparametersGettingVersion- parametersGettingVersionparentSystemId- parentSystemIdserverItf- serverItf- Returns:
- an instance of
System.
-
create
@CacheEvict(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID", key="#environmentId", condition="#environmentId!=null") public System create(@Nonnull UUID environmentId, @Nonnull UUID systemId, @Nonnull String name, String description, Long created, UUID createdBy, UUID systemCategoryId, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, UUID sourceId, String externalName) Creates system with manual createdUUIDfield.- Parameters:
environmentId- environmentIdname- namedescription- descriptioncreated- createdcreatedBy- createdBysystemCategoryId- systemCategoryIdparametersGettingVersion- parametersGettingVersionparentSystemId- parentSystemIdserverItf- serverItfsourceId- sourceId- Returns:
- an instance of
System.
-
updateSystemCategory
@Nonnull public void updateSystemCategory(@Nonnull UUID id, UUID systemCategoryId, Long modified, UUID modifiedBy) Update system category. -
update
@Nonnull @CachePut(value="ATP_ENVIRONMENTS-SYSTEM_VERSION", key="#id", condition="#useProxy && @systemCachedMap.get(#id) != null") @CacheEvict(value="ATP_ENVIRONMENTS-CONNECTIONS", key="#id", condition="#id!=null") public System update(@Nonnull UUID id, @Nonnull String name, String description, Long modified, UUID modifiedBy, UUID systemCategoryId, Status status, Long dateOfLastCheck, String version, Long dateOfCheckVersion, ParametersGettingVersion parametersGettingVersion, UUID parentSystemId, ServerItf serverItf, Boolean mergeByName, UUID linkToSystemId, UUID externalId, String externalName, boolean useProxy, boolean sendKafkaUpdate) TODO Make javadoc documentation for this method. -
delete
@CacheEvict(value={"ATP_ENVIRONMENTS-SYSTEM_VERSION","ATP_ENVIRONMENTS-CONNECTIONS","ATP_ENVIRONMENTS-ENVIRONMENTS_BY_SYSTEM_ID"},key="#id",condition="#id!=null && #environmentId!=null") @CacheEvict(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID",key="#environmentId",condition="#environmentId!=null") public void delete(UUID id, UUID environmentId, Long modified, UUID modifiedBy, boolean sendKafkaUpdateEnvironmentEvent) This method delete communication system with the environment if the system is a shared or the whole system, if the system is used in one place.- Parameters:
id- System id.environmentId- Environment id where this system in use.
-
updateSystemsModified
public void updateSystemsModified(@Nonnull UUID id, Timestamp modified, UUID modifiedBy, boolean sendKafkaNotification, UUID projectId) Method update "modified" info of system and send kafka notification. -
updateSystemsModified
public void updateSystemsModified(@Nonnull UUID id, Timestamp modified, UUID modifiedBy, List<Environment> environments) Method update "modified" info of system and send kafka notification for system and all depended environments. -
getByListIds
-
getByLinkToSystemId
-
getBySourceId
Get system by source id and environment id.- Parameters:
sourceId- the source id- Returns:
- the by name and project id
-
getSystemsByIdsAndProjectId
Get projectIds by systemIds.- Parameters:
systemIds- Ids of systems- Returns:
- the list of project ids
-
getSystemByNameAndEnvironmentId
Get system by name and environmentId.- Parameters:
name- name of systemenvironmentId- id of system- Returns:
- found system
-
getContext
- Specified by:
getContextin interfaceProjectionRepository<System>
-
getFullProjection
- Specified by:
getFullProjectionin interfaceProjectionRepository<System>
-
getLazyProjection
- Specified by:
getLazyProjectionin interfaceProjectionRepository<System>
-
getShortProjection
- Specified by:
getShortProjectionin interfaceProjectionRepository<System>
-