All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arextest.storage.service.config.impl.ApplicationInstancesConfigurableHandler Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.arextest.storage.service.config.impl;

import com.arextest.config.model.dto.application.InstancesConfiguration;
import com.arextest.config.repository.ConfigRepositoryProvider;
import com.arextest.config.repository.impl.InstancesConfigurationRepositoryImpl;
import com.arextest.storage.service.config.AbstractConfigurableHandler;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author jmo
 * @since 2022/1/23
 */
@Slf4j
@Component
public final class ApplicationInstancesConfigurableHandler extends
    AbstractConfigurableHandler {

  @Resource
  private InstancesConfigurationRepositoryImpl instancesConfigurationRepository;

  protected ApplicationInstancesConfigurableHandler(
      @Autowired ConfigRepositoryProvider repositoryProvider) {
    super(repositoryProvider);
  }

  public void createOrUpdate(InstancesConfiguration instancesConfiguration) {
    super.update(instancesConfiguration);
  }

  public List listByAppOrdered(String appId) {
    return instancesConfigurationRepository.listByAppOrdered(appId);
  }

  public boolean deleteByAppIdAndHost(String appId, String host) {
    return instancesConfigurationRepository.removeByAppIdAndHost(appId, host);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy