use of com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig in project spring-boot-student by wyh-spring-ecosystem-student.
the class ClusterConfigService method modifyClusterServerConfig.
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet).thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig)).thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig)).thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
use of com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig in project Sentinel by alibaba.
the class ClusterConfigService method modifyClusterServerConfig.
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet).thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig)).thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig)).thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
use of com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig in project pig by pig-mesh.
the class ClusterConfigService method modifyClusterServerConfig.
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet).thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig)).thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig)).thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
use of com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig in project XHuiCloud by sindaZeng.
the class ClusterConfigService method modifyClusterServerConfig.
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet).thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig)).thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig)).thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
use of com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig in project RuoYi-Cloud-Plus by JavaLionLi.
the class ClusterConfigService method modifyClusterServerConfig.
public CompletableFuture<Void> modifyClusterServerConfig(ClusterServerModifyRequest request) {
ServerTransportConfig transportConfig = request.getTransportConfig();
ServerFlowConfig flowConfig = request.getFlowConfig();
Set<String> namespaceSet = request.getNamespaceSet();
if (invalidTransportConfig(transportConfig)) {
throw new IllegalArgumentException("Invalid transport config in request");
}
if (invalidFlowConfig(flowConfig)) {
throw new IllegalArgumentException("Invalid flow config in request");
}
if (namespaceSet == null) {
throw new IllegalArgumentException("namespace set cannot be null");
}
String app = request.getApp();
String ip = request.getIp();
int port = request.getPort();
return sentinelApiClient.modifyClusterServerNamespaceSet(app, ip, port, namespaceSet).thenCompose(v -> sentinelApiClient.modifyClusterServerTransportConfig(app, ip, port, transportConfig)).thenCompose(v -> sentinelApiClient.modifyClusterServerFlowConfig(app, ip, port, flowConfig)).thenCompose(v -> sentinelApiClient.modifyClusterMode(ip, port, ClusterStateManager.CLUSTER_SERVER));
}
Aggregations