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 Details

    • queryFactory

      protected final com.querydsl.sql.SQLQueryFactory queryFactory
  • Constructor Details

  • Method Details

    • getEnvironmentRepo

      public javax.inject.Provider<EnvironmentRepositoryImpl> getEnvironmentRepo()
    • getSystemCategoryRepo

      public javax.inject.Provider<SystemCategoryRepositoryImpl> getSystemCategoryRepo()
    • getConnectionRepo

      public javax.inject.Provider<ConnectionRepositoryImpl> getConnectionRepo()
    • getById

      @Nullable public System getById(@Nonnull UUID id)
    • getShortById

      @Nullable public System getShortById(UUID id)
    • existsById

      public boolean existsById(@Nonnull UUID id)
    • getProjectId

      @Nonnull public UUID getProjectId(@Nonnull UUID systemId)
      TODO Make javadoc documentation for this method.
    • getByIdV2

      @Nullable public System getByIdV2(@Nonnull UUID id)
      This method get system by id.
      Parameters:
      id - System id.
    • getSystemsByProjectId

      public List<System> getSystemsByProjectId(UUID projectId)
      Get system in project.
      Parameters:
      projectId - project Id.
    • getAll

      @Nonnull public List<System> 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

      @Nonnull public List<System> getAllByParentId(@Nonnull UUID environmentId, String systemType)
      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

      @Nonnull public List<System> getAllShortByParentId(@Nonnull UUID environmentId)
      TODO Make javadoc documentation for this method.
    • getSystemNamesByProjectId

      @Nonnull public List<String> getSystemNamesByProjectId(@Nonnull UUID projectId)
      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 identifier
      systemName - 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

      @Nonnull public Collection<System> getAllByParentIdV2(@Nonnull UUID environmentId)
      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 autogenerated UUID field.
      Parameters:
      environmentId - environmentId
      name - name
      description - description
      created - created
      createdBy - createdBy
      systemCategoryId - systemCategoryId
      parametersGettingVersion - parametersGettingVersion
      parentSystemId - parentSystemId
      serverItf - 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 created UUID field.
      Parameters:
      environmentId - environmentId
      name - name
      description - description
      created - created
      createdBy - createdBy
      systemCategoryId - systemCategoryId
      parametersGettingVersion - parametersGettingVersion
      parentSystemId - parentSystemId
      serverItf - serverItf
      sourceId - sourceId
      Returns:
      an instance of System.
    • share

      @Nonnull @CacheEvict(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID", key="#targetEnvironment.getId()", condition="#targetEnvironment.getId()!=null") public System share(@Nonnull UUID systemId, @Nonnull Environment targetEnvironment, Long modified, UUID modifiedBy)
      TODO Make javadoc documentation for this method.
    • unShare

      @Nonnull @CacheEvict(value="ATP_ENVIRONMENTS-SYSTEMS_BY_ENVIRONMENT_ID", key="#environmentId", condition="#environmentId!=null") public System unShare(@Nonnull UUID systemId, @Nonnull UUID environmentId, Long modified, UUID modifiedBy)
      Stops system's sharing in specified environment.
      Parameters:
      systemId - System id.
      environmentId - Environment id where this system in use.
    • 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

      public List<System> getByListIds(List<UUID> systems)
    • getByLinkToSystemId

      public List<System> getByLinkToSystemId(UUID linkToSystemId)
    • getBySourceId

      public System getBySourceId(UUID sourceId)
      Get system by source id and environment id.
      Parameters:
      sourceId - the source id
      Returns:
      the by name and project id
    • getSystemsByIdsAndProjectId

      public List<System> getSystemsByIdsAndProjectId(List<UUID> systemIds, UUID projectId)
      Get projectIds by systemIds.
      Parameters:
      systemIds - Ids of systems
      Returns:
      the list of project ids
    • getSystemByNameAndEnvironmentId

      public System getSystemByNameAndEnvironmentId(String name, UUID environmentId)
      Get system by name and environmentId.
      Parameters:
      name - name of system
      environmentId - id of system
      Returns:
      found system
    • getContext

      public Context getContext()
      Specified by:
      getContext in interface ProjectionRepository<System>
    • getFullProjection

      public com.querydsl.core.types.MappingProjection<System> getFullProjection()
      Specified by:
      getFullProjection in interface ProjectionRepository<System>
    • getLazyProjection

      public com.querydsl.core.types.MappingProjection<System> getLazyProjection()
      Specified by:
      getLazyProjection in interface ProjectionRepository<System>
    • getShortProjection

      public com.querydsl.core.types.MappingProjection<System> getShortProjection()
      Specified by:
      getShortProjection in interface ProjectionRepository<System>