SUPPORT-8529: Добавлены компоненты взаимодействия с ConfigDataExecutor
This commit is contained in:
parent
d318a8bdae
commit
c246132121
7 changed files with 197 additions and 61 deletions
27
backend/src/main/java/rpc/ConfigExecutorRpcService.java
Normal file
27
backend/src/main/java/rpc/ConfigExecutorRpcService.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package rpc;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import ru.cg.webbpm.modules.webkit.annotations.RpcCall;
|
||||
import ru.cg.webbpm.modules.webkit.annotations.RpcService;
|
||||
import ru.cg.webbpm.modules.webkit.beans.Behavior;
|
||||
import service.ConfigExecutorService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Evgenii Malkov
|
||||
*/
|
||||
@RpcService
|
||||
public class ConfigExecutorRpcService extends Behavior {
|
||||
|
||||
private final ConfigExecutorService configExecutorService;
|
||||
|
||||
public ConfigExecutorRpcService(@Autowired ConfigExecutorService configExecutorService) {
|
||||
this.configExecutorService = configExecutorService;
|
||||
}
|
||||
|
||||
@RpcCall
|
||||
public void callConfigExecutor(String path, List<String> ids) {
|
||||
configExecutorService.callConfigExecutor(path, ids);
|
||||
}
|
||||
}
|
||||
31
backend/src/main/java/service/ConfigExecutorService.java
Normal file
31
backend/src/main/java/service/ConfigExecutorService.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Evgenii Malkov
|
||||
*/
|
||||
@Service
|
||||
public class ConfigExecutorService {
|
||||
|
||||
@Value("${config-data-executor.host}")
|
||||
String host;
|
||||
@Value("${config-data-executor.port}")
|
||||
String port;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
public void callConfigExecutor(String path, List<String> ids) {
|
||||
LOGGER.info("host: " + host);
|
||||
LOGGER.info("port " + port);
|
||||
LOGGER.info("path: " + path);
|
||||
ids.forEach(LOGGER::info);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue