From 413ba111a0bc32c7abca88fa5a98bb8bb1c1f0bb Mon Sep 17 00:00:00 2001 From: "lambert@arch" Date: Wed, 27 Mar 2024 21:33:48 +0800 Subject: [PATCH 1/4] add remoting service and move models into common module --- .../dashboard/common}/constant/ApiPrefix.java | 2 +- .../health/HealthCheckTypeConstant.java | 4 +- .../constant/health/HealthConstant.java | 2 +- .../dashboard/common/enums/DataStatus.java | 4 +- .../common}/enums/KubernetesPodStatus.java | 2 +- .../dashboard/common/enums/StoreType.java | 37 ++++++++++ .../enums/health/HealthCheckStatus.java | 2 +- .../common}/enums/health/HealthCheckType.java | 18 ++--- .../metadata/MetadataServiceTypeEnum.java | 39 ++++++++++ .../enums/metadata/MetadataTypeEnum.java | 37 ++++++++++ .../common/model/metadata/AclMetadata.java | 33 +++++++++ .../common/model/metadata/ClientMetadata.java | 54 ++++++++++++++ .../model/metadata/ClusterMetadata.java | 55 ++++++++++++++ .../common/model/metadata/ConfigMetadata.java | 38 ++++++++++ .../model/metadata/ConnectionMetadata.java | 74 +++++++++++++++++++ .../model/metadata/ConnectorMetadata.java | 39 ++++++++++ .../common/model/metadata/GroupMetadata.java | 39 ++++++++++ .../common/model/metadata/MetadataConfig.java | 38 ++++++++++ .../model/metadata/RegistryMetadata.java | 56 ++++++++++++++ .../model/metadata/RuntimeMetadata.java | 47 ++++++++++++ .../model/metadata/ServiceUserMetadata.java | 30 ++++++++ .../common/model/metadata/TopicMetadata.java | 50 +++++++++++++ .../model/remoting/acl/CreateAclRequest.java | 10 +-- .../model/remoting/acl/CreateAclResponse.java | 23 ++++++ .../model/remoting/acl/CreateAclResult.java | 22 ++++++ .../model/remoting/acl/DeleteAclRequest.java | 22 ++++++ .../model/remoting/acl/DeleteAclResponse.java | 22 ++++++ .../model/remoting/acl/DeleteAclResult.java | 22 ++++++ .../model/remoting/acl/GetAclsRequest.java | 22 ++++++ .../model/remoting/acl/GetAclsResponse.java | 22 ++++++ .../model/remoting/acl/GetAclsResult.java | 22 ++++++ .../remoting/client/GetClientRequest.java | 23 ++++++ .../remoting/client/GetClientResponse.java | 28 +++++++ .../remoting/client/GetClientResult.java | 25 +++++++ .../remoting/config/GetConfigRequest.java | 37 ++++++++++ .../remoting/config/GetConfigResponse.java | 37 ++++++++++ .../remoting/config/GetConfigResult.java | 32 ++++++++ .../connector/CreateConnectorRequest.java | 25 +++++++ .../connector/CreateConnectorResponse.java | 26 +++++++ .../connector/CreateConnectorResult.java | 25 +++++++ .../connector/GetConnectorRequest.java | 23 ++++++ .../connector/GetConnectorResponse.java | 28 +++++++ .../connector/GetConnectorResult.java | 25 +++++++ .../model/remoting/group/GetGroupResult.java | 25 +++++++ .../remoting/group/GetGroupsRequest.java | 22 ++++++ .../remoting/group/GetGroupsResponse.java | 26 +++++++ .../remoting/offset/GetOffsetRequest.java | 29 ++++++++ .../remoting/offset/GetOffsetResponse.java | 23 ++++++ .../remoting/offset/GetOffsetResult.java | 25 +++++++ .../remoting/offset/ResetOffsetRequest.java | 44 +++++++++++ .../remoting/offset/ResetOffsetResponse.java | 23 ++++++ .../remoting/offset/ResetOffsetResult.java | 25 +++++++ .../subscription/GetSubscriptionRequest.java | 26 +++++++ .../subscription/GetSubscriptionResponse.java | 29 ++++++++ .../subscription/GetSubscriptionResult.java | 25 +++++++ .../remoting/topic/CreateTopicRequest.java | 33 +++++++++ .../remoting/topic/CreateTopicResponse.java | 29 ++++++++ .../remoting/topic/CreateTopicResult.java | 31 ++++++++ .../remoting/topic/DeleteTopicRequest.java | 32 ++++++++ .../remoting/topic/DeleteTopicResponse.java | 29 ++++++++ .../remoting/topic/DeleteTopicResult.java | 33 +++++++++ .../remoting/topic/GetTopicsRequest.java | 32 ++++++++ .../remoting/topic/GetTopicsResponse.java | 35 +++++++++ .../model/remoting/topic/GetTopicsResult.java | 31 ++++++++ .../remoting/user/CreateUserRequest.java | 25 +++++++ .../remoting/user/CreateUserResponse.java | 23 ++++++ .../model/remoting/user/CreateUserResult.java | 22 ++++++ .../remoting/user/DeleteUserResponse.java | 22 ++++++ .../model/remoting/user/DeleteUserResult.java | 22 ++++++ .../remoting/user/DeleterUserRequest.java | 22 ++++++ .../model/remoting/user/GetUserRequest.java | 26 +++++++ .../model/remoting/user/GetUserResponse.java | 31 ++++++++ .../model/remoting/user/GetUserResult.java | 28 +++++++ .../console/entity/client/ClientEntity.java | 6 +- .../entity/connection/ConnectionEntity.java | 12 ++- .../entity/connector/ConnectorEntity.java | 14 ++-- .../console/entity/meta/MetaEntity.java | 8 +- .../function/health/CheckResultCache.java | 4 +- .../function/health/HealthExecutor.java | 4 +- .../check/impl/meta/NacosConfigCheck.java | 10 +-- .../check/impl/meta/NacosRegisterCheck.java | 10 +-- .../health/check/impl/storage/RedisCheck.java | 2 +- .../rocketmq4/Rocketmq4BrokerCheck.java | 5 +- .../rocketmq4/Rocketmq4NameServerCheck.java | 2 +- .../rocketmq4/Rocketmq4TopicCheck.java | 4 +- .../function/health/HealthExecutorTest.java | 4 +- .../health/HealthServiceIntegrateTest.java | 2 +- .../mapper/client/ClientMapperTest.java | 4 +- .../connector/ConnectorOptService.java | 26 +++++++ .../connector/RuntimeOptService.java | 26 +++++++ .../service/remoting/AclRemotingService.java | 37 ++++++++++ .../remoting/ClientRemotingService.java | 31 ++++++++ .../remoting/ConfigRemotingService.java | 35 +++++++++ .../remoting/ConnectorRemotingService.java | 33 +++++++++ .../remoting/GroupRemotingService.java | 29 ++++++++ .../remoting/OffsetRemotingService.java | 31 ++++++++ .../remoting/SubscriptionRemotingService.java | 30 ++++++++ .../remoting/TopicRemotingService.java | 38 ++++++++++ .../service/remoting/UserRemotingService.java | 35 +++++++++ 99 files changed, 2417 insertions(+), 74 deletions(-) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/constant/ApiPrefix.java (94%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/constant/health/HealthCheckTypeConstant.java (95%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/constant/health/HealthConstant.java (97%) rename eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java (92%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/enums/KubernetesPodStatus.java (95%) create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/enums/health/HealthCheckStatus.java (94%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/enums/health/HealthCheckType.java (64%) create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConfigMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectorMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java rename eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StoreType.java => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java (83%) create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResult.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleterUserRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserRequest.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResponse.java create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResult.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/ConnectorOptService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/AclRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ClientRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConfigRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConnectorRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/GroupRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/OffsetRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/SubscriptionRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/TopicRemotingService.java create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/UserRemotingService.java diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java similarity index 94% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java index e2107cbe..14c3e050 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.constant; +package org.apache.eventmesh.dashboard.common.constant; public class ApiPrefix { public static final String API_PREFIX = "/eventmesh-dashboard/"; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthCheckTypeConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java similarity index 95% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthCheckTypeConstant.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java index 6765bab7..ff9c602a 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthCheckTypeConstant.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.constant.health; +package org.apache.eventmesh.dashboard.common.constant.health; public class HealthCheckTypeConstant { @@ -35,5 +35,5 @@ public class HealthCheckTypeConstant { public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_TOPIC = "rocketmq4-topic"; public static final String HEALTH_CHECK_SUBTYPE_NACOS_CONFIG = "nacos-config"; - public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTER = "nacos-register"; + public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY = "nacos-registry"; } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java similarity index 97% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthConstant.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java index e243b30f..bc3818b7 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/health/HealthConstant.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.constant.health; +package org.apache.eventmesh.dashboard.common.constant.health; public class HealthConstant { public static final String NEW_LINE_ENDING = "\n"; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java similarity index 92% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java index 271e3f2a..ac65cf9f 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StatusEnum.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.enums; +package org.apache.eventmesh.dashboard.common.enums; import lombok.AllArgsConstructor; import lombok.Getter; @Getter @AllArgsConstructor -public enum StatusEnum { +public enum DataStatus { INACTIVE(0, "Inactive"), ACTIVE(1, "Active"); diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java similarity index 95% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java index 4650316f..1e6d8a0e 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/KubernetesPodStatus.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.enums; +package org.apache.eventmesh.dashboard.common.enums; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java new file mode 100644 index 00000000..d5146b14 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum StoreType { + + STANDALONE(0, "Standalone"), + ROCKETMQ(1, "RocketMQ"), + KAFKA(2, "Kafka"), + PULSAR(3, "Pulsar"), + RABBITMQ(4, "RabbitMQ"), + REDIS(5, "Redis"); + + @Getter + private final Integer number; + @Getter + private final String name; +} diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java similarity index 94% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckStatus.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java index fd5bc125..17856f87 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckStatus.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.enums.health; +package org.apache.eventmesh.dashboard.common.enums.health; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java similarity index 64% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckType.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java index abd918f3..54c061e4 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/health/HealthCheckType.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java @@ -15,28 +15,24 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.enums.health; +package org.apache.eventmesh.dashboard.common.enums.health; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN; +import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant; import lombok.AllArgsConstructor; import lombok.Getter; @AllArgsConstructor public enum HealthCheckType { - UNKNOWN(0, HEALTH_CHECK_TYPE_UNKNOWN), + UNKNOWN(0, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN), - CLUSTER(1, HEALTH_CHECK_TYPE_CLUSTER), + CLUSTER(1, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER), - RUNTIME(2, HEALTH_CHECK_TYPE_RUNTIME), + RUNTIME(2, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME), - TOPIC(3, HEALTH_CHECK_TYPE_TOPIC), + TOPIC(3, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC), - STORAGE(4, HEALTH_CHECK_TYPE_STORAGE); + STORAGE(4, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE); @Getter private final Integer number; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java new file mode 100644 index 00000000..a810b0e4 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.enums.metadata; + +public enum MetadataServiceTypeEnum { + + RUNTIME, + + CENTER_ETCD, + + META_NACOS, + + TOPIC, + + CLUSTER, + + CLIENT, + + GROUP, + + CONNECTION, + + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java new file mode 100644 index 00000000..90a3e458 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.enums.metadata; + +public enum MetadataTypeEnum { + + CENTER, + + CLUSTER, + + RUNTIME, + + TOPIC, + + GROUP, + + SUBSCRIPTION, + + STORE + ; + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java new file mode 100644 index 00000000..12446b14 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import lombok.Data; + +@Data +public class AclMetadata { + + private Long clusterId; + private String principal; + private Integer operation; + private String permissionType; + private String host; + private String resourceType; + private String resourceName; + private Integer patternType; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java new file mode 100644 index 00000000..d9173217 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class ClientMetadata extends MetadataConfig { + + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.CLIENT); + } + + private String name; + + private String platform; + + /** + * programing language of client + */ + private String language; + + /** + * process id + */ + private Long pid; + + private String host; + + private Integer port; + + /** + * protocol used to connect to runtime. + */ + private String protocol; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java new file mode 100644 index 00000000..2648c188 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.StoreType; +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class ClusterMetadata extends MetadataConfig { + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.CLUSTER); + } + + private String clusterName; + + private String registryAddress; + + private String bootstrapServers; + + private String eventmeshVersion; + + private String clientProperties; + + private String jmxProperties; + + private String regProperties; + + private Integer authType; + + private Integer runState; + + private Integer status; + + private StoreType storeType; + + private String description; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConfigMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConfigMetadata.java new file mode 100644 index 00000000..11397f6b --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConfigMetadata.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import lombok.Data; + +/** + * Config metadata is a piece of config with key and value + */ +@Data +public class ConfigMetadata extends MetadataConfig { + + /** + * property key + */ + private String configKey; + + private String configValue; + + private Integer instanceType; + + private Long instanceId; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java new file mode 100644 index 00000000..2bc41419 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +/** + * when insert data to db from meta service, connection metadata operation should be called after cluster and client in order to fetch information + * from them. + */ +@Data +public class ConnectionMetadata extends MetadataConfig { + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.CONNECTION); + } + + /** + * The type of source. Possible values are "connector" or "client". + */ + private String sourceType; + + /** + * The id of the source.

It can be connectorId or clientId according to the sourceType. + */ + private Long sourceId; + + private String sourceHost; + + private Integer sourcePort; + + private String sourceName; + + /** + * The type of sink. Possible values are "connector" or "client". + */ + private String sinkType; + + private String sinkHost; + + private Integer sinkPort; + + private String sinkName; + + /** + * The id of the sink.

It can be connectorId or clientId according to the sinkType. + */ + private Long sinkId; + + private Long runtimeId; + + private String topic; + + private Long groupId; + + private String description; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectorMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectorMetadata.java new file mode 100644 index 00000000..d329ef5f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectorMetadata.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.KubernetesPodStatus; + + +public class ConnectorMetadata extends MetadataConfig { + + private String name; + + private String className; + + private String type; + + private String host; + + private Integer port; + + /** + * @see KubernetesPodStatus + */ + private Integer podState; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java new file mode 100644 index 00000000..2934f534 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class GroupMetadata extends MetadataConfig { + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.GROUP); + } + + private String name; + + private Integer memberCount; + + private String members; + + private Integer type; + + private String state; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java new file mode 100644 index 00000000..0f47a398 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +/** + * This class is used to represent a piece of metadata, which can be used in create, update or delete operations to metadata service(eventmesh meta + * center, eventmesh runtime cluster)

follow method should be called in init block which is used to indicate the type of metadata: + * {@code this.setServiceTypeEnums(MetadataServiceTypeEnums.RUNTIME);} + */ +@Data +public class MetadataConfig { + + private MetadataServiceTypeEnum serviceTypeEnums; + + //center url + private String registryAddress; + + private Long clusterId; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java new file mode 100644 index 00000000..c39e785d --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class RegistryMetadata extends MetadataConfig { + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.META_NACOS); + } + + private String clusterName; + + private String name; + + private String type; + + private String version; + + private String host; + + private Integer port; + + private String role; + + private String username; + + private String params; + + /** + * 0: not active, 1: active + * + * @see DataStatus + */ + private Integer status; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java new file mode 100644 index 00000000..25579e20 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class RuntimeMetadata extends MetadataConfig { + + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.RUNTIME); + } + + private String host; + + private Integer port; + + private Integer jmxPort; + + private String rack; + + private String endpointMap; + + private Long storageClusterId; + + private Long startTimeStamp; + + private String clusterName; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java new file mode 100644 index 00000000..15b02b02 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.StoreType; + +import lombok.Data; + +@Data +public class ServiceUserMetadata { + private String userName; + //service users are only store users by now + private StoreType serviceType; + private String password; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java new file mode 100644 index 00000000..2cc78f96 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.metadata; + +import org.apache.eventmesh.dashboard.common.enums.StoreType; +import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; + +import lombok.Data; + +@Data +public class TopicMetadata extends MetadataConfig { + + { + this.setServiceTypeEnums(MetadataServiceTypeEnum.TOPIC); + } + + private StoreType storeType; + + private String storeAddress; + + //rocketmq -> broker url + private String connectionUrl; + + private String topicName; + + private Long runtimeId; + + private Long storageId; + + private Long retentionMs; + + private Integer type; + + private String description; +} diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StoreType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java similarity index 83% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StoreType.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java index b4721cc6..2c2ae35c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/enums/StoreType.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java @@ -15,14 +15,8 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.enums; +package org.apache.eventmesh.dashboard.common.model.remoting.acl; -public enum StoreType { - ROCKETMQ, - KAFKA, - STANDALONE, - PULSAR, - RABBITMQ, - REDIS, +public class CreateAclRequest { } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResponse.java new file mode 100644 index 00000000..8e2b3a4f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResponse.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class CreateAclResponse { + + Boolean success; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResult.java new file mode 100644 index 00000000..4e3d6c26 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclResult.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class CreateAclResult { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclRequest.java new file mode 100644 index 00000000..97211b1e --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclRequest.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class DeleteAclRequest { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResponse.java new file mode 100644 index 00000000..f79d7f37 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResponse.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class DeleteAclResponse { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResult.java new file mode 100644 index 00000000..db1dbfda --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/DeleteAclResult.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class DeleteAclResult { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsRequest.java new file mode 100644 index 00000000..6454a2a2 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsRequest.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class GetAclsRequest { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResponse.java new file mode 100644 index 00000000..95688e2f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResponse.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class GetAclsResponse { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResult.java new file mode 100644 index 00000000..68f4161b --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsResult.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.acl; + +public class GetAclsResult { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientRequest.java new file mode 100644 index 00000000..2369a241 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientRequest.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.client; + +public class GetClientRequest { + + String registryAddress; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResponse.java new file mode 100644 index 00000000..f19f9e58 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResponse.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.client; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ClientMetadata; + +import java.util.List; + +public class GetClientResponse { + + List clientList; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResult.java new file mode 100644 index 00000000..340d33ac --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/client/GetClientResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.client; + +import java.util.concurrent.CompletableFuture; + +public class GetClientResult { + + CompletableFuture getClientResponseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java new file mode 100644 index 00000000..0b2c4e56 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.config; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor + +public class GetConfigRequest { + + private List registryAddress; + + private List runtimeAddress; + + private List brokerAddress; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java new file mode 100644 index 00000000..34682f91 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.config; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ConfigMetadata; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor + +public class GetConfigResponse { + + List configMetadataList; + private Boolean success; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResult.java new file mode 100644 index 00000000..3954e7f5 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResult.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.config; + +import java.util.concurrent.CompletableFuture; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor + +public class GetConfigResult { + CompletableFuture getConfigResponseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorRequest.java new file mode 100644 index 00000000..7117dd9d --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorRequest.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + +import org.apache.eventmesh.dashboard.common.model.metadata.ConnectorMetadata; + +public class CreateConnectorRequest { + + private ConnectorMetadata connectorMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResponse.java new file mode 100644 index 00000000..4e149df3 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResponse.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ConnectorMetadata; + +public class CreateConnectorResponse { + + private ConnectorMetadata connectorMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResult.java new file mode 100644 index 00000000..e6746502 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/CreateConnectorResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + +import java.util.concurrent.CompletableFuture; + +public class CreateConnectorResult { + + private CompletableFuture createConnectorResponseCompletableFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorRequest.java new file mode 100644 index 00000000..a386d7cb --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorRequest.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + +public class GetConnectorRequest { + + private String registryAddress; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResponse.java new file mode 100644 index 00000000..4de89a62 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResponse.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ConnectorMetadata; + +import java.util.List; + +public class GetConnectorResponse { + + private List connectorList; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResult.java new file mode 100644 index 00000000..e21d2393 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.connector; + +import java.util.concurrent.CompletableFuture; + +public class GetConnectorResult { + + private CompletableFuture getConnectorResponseCompletableFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java new file mode 100644 index 00000000..a8d70b83 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.group; + +import java.util.concurrent.CompletableFuture; + +public class GetGroupResult { + + private CompletableFuture future; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsRequest.java new file mode 100644 index 00000000..6586fe76 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsRequest.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.group; + +public class GetGroupsRequest { + //TODO where to get groups? +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsResponse.java new file mode 100644 index 00000000..60968105 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupsResponse.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.group; + +import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata; + +import java.util.List; + +public class GetGroupsResponse { + private List groupList; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java new file mode 100644 index 00000000..dc3b52f9 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + + +import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata; + +import lombok.Data; + +@Data +public class GetOffsetRequest { + + private GroupMetadata groupMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResponse.java new file mode 100644 index 00000000..3358b894 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResponse.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + +public class GetOffsetResponse { + + private Long offset; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResult.java new file mode 100644 index 00000000..2b0a4491 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + +import java.util.concurrent.CompletableFuture; + +public class GetOffsetResult { + + CompletableFuture getOffsetResponseCompletableFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java new file mode 100644 index 00000000..9e5f4a7a --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + + +import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata; + +import java.time.LocalDateTime; + +import lombok.Data; + +@Data +public class ResetOffsetRequest { + + LocalDateTime timestamp; + + Long offset; + + ResetOffsetMode resetOffsetMode; + + GroupMetadata groupMetadata; + + public enum ResetOffsetMode { + EARLIEST, + LATEST, + TIMESTAMP, + OFFSET + } +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java new file mode 100644 index 00000000..5369703a --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + +public class ResetOffsetResponse { + + private Long offset; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java new file mode 100644 index 00000000..89c3b60f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.offset; + +import java.util.concurrent.CompletableFuture; + +public class ResetOffsetResult { + + private CompletableFuture resetOffsetResponseCompletableFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionRequest.java new file mode 100644 index 00000000..c5271ff4 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionRequest.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.subscription; + +public class GetSubscriptionRequest { + + Integer page; + Integer size; + String dataId; + String group; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResponse.java new file mode 100644 index 00000000..2c0a0660 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResponse.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.subscription; + +public class GetSubscriptionResponse { + // client name + private String clientName; + + // group name + private String group; + + // config content + private String subscription; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResult.java new file mode 100644 index 00000000..f5a22158 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/subscription/GetSubscriptionResult.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.subscription; + +import java.util.concurrent.CompletableFuture; + +public class GetSubscriptionResult { + + CompletableFuture responseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicRequest.java new file mode 100644 index 00000000..6eefe44f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicRequest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + + +import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CreateTopicRequest { + + TopicMetadata topicMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResponse.java new file mode 100644 index 00000000..a66e4b9d --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResponse.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CreateTopicResponse { + private String result; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResult.java new file mode 100644 index 00000000..4313b284 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicResult.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import java.util.concurrent.CompletableFuture; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CreateTopicResult { + CompletableFuture createTopicResponseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java new file mode 100644 index 00000000..5b429dfe --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + + +import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class DeleteTopicRequest { + TopicMetadata topicMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResponse.java new file mode 100644 index 00000000..95d82561 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResponse.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class DeleteTopicResponse { + private String result; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResult.java new file mode 100644 index 00000000..b9241225 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicResult.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import java.util.concurrent.CompletableFuture; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor + +public class DeleteTopicResult { + + private CompletableFuture deleteTopicResponseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsRequest.java new file mode 100644 index 00000000..94e141cd --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsRequest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class GetTopicsRequest { + + private String runtimeHost; + + private Integer runtimePort; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResponse.java new file mode 100644 index 00000000..5ed2126b --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResponse.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + + + +import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class GetTopicsResponse { + List topicMetadataList; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResult.java new file mode 100644 index 00000000..effca2d1 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsResult.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.topic; + +import java.util.concurrent.CompletableFuture; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class GetTopicsResult { + CompletableFuture getTopicsResponseFuture; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserRequest.java new file mode 100644 index 00000000..24b4adc2 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserRequest.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +import org.apache.eventmesh.dashboard.common.model.metadata.ServiceUserMetadata; + +public class CreateUserRequest { + + private ServiceUserMetadata serviceUserMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResponse.java new file mode 100644 index 00000000..7d9a79bd --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResponse.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +public class CreateUserResponse { + + Boolean success; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResult.java new file mode 100644 index 00000000..3e187f28 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/CreateUserResult.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +public class CreateUserResult { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResponse.java new file mode 100644 index 00000000..f047e2ff --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResponse.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +public class DeleteUserResponse { + Boolean success; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResult.java new file mode 100644 index 00000000..d6241c23 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleteUserResult.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +public class DeleteUserResult { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleterUserRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleterUserRequest.java new file mode 100644 index 00000000..30541d7a --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/DeleterUserRequest.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +public class DeleterUserRequest { + +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserRequest.java new file mode 100644 index 00000000..420c746d --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserRequest.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +import org.apache.eventmesh.dashboard.common.enums.StoreType; + +public class GetUserRequest { + private StoreType serviceType; + + private String serviceAddress; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResponse.java new file mode 100644 index 00000000..d2257063 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResponse.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ServiceUserMetadata; + +import java.util.List; + +import lombok.Data; + +@Data +public class GetUserResponse { + + private List serviceUserMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResult.java new file mode 100644 index 00000000..8014118f --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/user/GetUserResult.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.user; + +import java.util.concurrent.CompletableFuture; + +import lombok.Data; + +@Data +public class GetUserResult { + + private CompletableFuture getUserResponseCompletableFuture; +} diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java index 4da4dada..cef62392 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.entity.client; +import org.apache.eventmesh.dashboard.common.enums.DataStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; -import org.apache.eventmesh.dashboard.console.enums.StatusEnum; import java.sql.Timestamp; @@ -69,7 +69,7 @@ public class ClientEntity extends BaseEntity { /** * 0: not active, 1: active - * @see StatusEnum + * @see DataStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active") private Integer status; @@ -88,7 +88,7 @@ public class ClientEntity extends BaseEntity { */ private Timestamp endTime; - public void setStatusEntity(StatusEnum status) { + public void setStatusEntity(DataStatus status) { this.status = status.getNumber(); } } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java index 626e793c..db7c33ad 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.entity.connection; +import org.apache.eventmesh.dashboard.common.enums.DataStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; -import org.apache.eventmesh.dashboard.console.enums.StatusEnum; import java.sql.Timestamp; import java.util.Objects; @@ -53,8 +53,7 @@ public class ConnectionEntity extends BaseEntity { private String sourceType; /** - * The id of the source.
- * It can be connectorId or clientId according to the sourceType. + * The id of the source.
It can be connectorId or clientId according to the sourceType. */ @Schema(name = "sourceId", description = "connectorId or clientId") private Long sourceId; @@ -66,8 +65,7 @@ public class ConnectionEntity extends BaseEntity { private String sinkType; /** - * The id of the sink.
- * It can be connectorId or clientId according to the sinkType. + * The id of the sink.
It can be connectorId or clientId according to the sinkType. */ @Schema(name = "sinkId", description = "connectorId or clientId") private Long sinkId; @@ -85,8 +83,8 @@ public class ConnectionEntity extends BaseEntity { private String description; - public void setStatusEnum(StatusEnum statusEnum) { - this.status = statusEnum.getNumber(); + public void setDataStatus(DataStatus dataStatus) { + this.status = dataStatus.getNumber(); } @Override diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java index 66db0f9b..ec7bb018 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java @@ -17,9 +17,9 @@ package org.apache.eventmesh.dashboard.console.entity.connector; +import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.KubernetesPodStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; -import org.apache.eventmesh.dashboard.console.enums.KubernetesPodStatus; -import org.apache.eventmesh.dashboard.console.enums.StatusEnum; import io.swagger.v3.oas.annotations.media.Schema; @@ -45,7 +45,7 @@ public class ConnectorEntity extends BaseEntity { /** * 0: not active, 1: active * - * @see StatusEnum + * @see DataStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active") private Integer status; @@ -63,11 +63,11 @@ public class ConnectorEntity extends BaseEntity { */ private String configIds; - public void setStatusEnum(StatusEnum statusEnum) { - this.status = statusEnum.getNumber(); + public void setDataStatus(DataStatus dataStatus) { + this.status = dataStatus.getNumber(); } - public void setKubernetesPodStatusEnum(KubernetesPodStatus kubernetesPodStatusEnum) { - this.podState = kubernetesPodStatusEnum.getNumber(); + public void setKubernetesPodDataStatus(KubernetesPodStatus kubernetesPodDataStatus) { + this.podState = kubernetesPodDataStatus.getNumber(); } } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java index a6871eb0..a8456441 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.entity.meta; +import org.apache.eventmesh.dashboard.common.enums.DataStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; -import org.apache.eventmesh.dashboard.console.enums.StatusEnum; import io.swagger.v3.oas.annotations.media.Schema; @@ -54,12 +54,12 @@ public class MetaEntity extends BaseEntity { /** * 0: not active, 1: active * - * @see StatusEnum + * @see DataStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active") private Integer status; - public void setStatusEnum(StatusEnum statusEnum) { - this.status = statusEnum.getNumber(); + public void setDataStatus(DataStatus dataStatus) { + this.status = dataStatus.getNumber(); } } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/CheckResultCache.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/CheckResultCache.java index 4da837fb..e2d62f71 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/CheckResultCache.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/CheckResultCache.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.function.health; -import org.apache.eventmesh.dashboard.console.constant.health.HealthConstant; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckStatus; +import org.apache.eventmesh.dashboard.common.constant.health.HealthConstant; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckStatus; import org.apache.eventmesh.dashboard.console.function.health.check.config.HealthCheckObjectConfig; import java.time.LocalDateTime; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutor.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutor.java index 5cb0e024..46cecbc1 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutor.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutor.java @@ -17,9 +17,9 @@ package org.apache.eventmesh.dashboard.console.function.health; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckStatus; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckStatus; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.CheckResultCache.CheckResult; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosConfigCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosConfigCheck.java index db82e1fb..1a2b0b1e 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosConfigCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosConfigCheck.java @@ -17,11 +17,11 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.meta; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_NACOS_CONFIG; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_META; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthConstant.NACOS_CHECK_CONTENT; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthConstant.NACOS_CHECK_DATA_ID; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthConstant.NACOS_CHECK_GROUP; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_NACOS_CONFIG; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_META; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthConstant.NACOS_CHECK_CONTENT; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthConstant.NACOS_CHECK_DATA_ID; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthConstant.NACOS_CHECK_GROUP; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosRegisterCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosRegisterCheck.java index 90ec2ea4..5d53b6fe 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosRegisterCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/meta/NacosRegisterCheck.java @@ -17,10 +17,10 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.meta; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_NACOS_REGISTER; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_META; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthConstant.NACOS_CHECK_SERVICE_CLUSTER_NAME; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthConstant.NACOS_CHECK_SERVICE_NAME; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_META; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthConstant.NACOS_CHECK_SERVICE_CLUSTER_NAME; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthConstant.NACOS_CHECK_SERVICE_NAME; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; @@ -39,7 +39,7 @@ @Slf4j -@HealthCheckType(type = HEALTH_CHECK_TYPE_META, subType = HEALTH_CHECK_SUBTYPE_NACOS_REGISTER) +@HealthCheckType(type = HEALTH_CHECK_TYPE_META, subType = HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY) public class NacosRegisterCheck extends AbstractHealthCheckService { private NamingService namingService; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/RedisCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/RedisCheck.java index 71488ac7..5be24f2d 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/RedisCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/RedisCheck.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.storage; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java index 5fb92cfa..7f8e56c7 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java @@ -17,9 +17,8 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.storage.rocketmq4; - -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER; -import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER; +import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java index 08df28b0..e855ba18 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.storage.rocketmq4; -import org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant; +import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java index 75547624..739ac445 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java @@ -19,8 +19,8 @@ import static org.apache.rocketmq.client.producer.SendStatus.SEND_OK; -import org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant; -import org.apache.eventmesh.dashboard.console.constant.health.HealthConstant; +import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant; +import org.apache.eventmesh.dashboard.common.constant.health.HealthConstant; import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutorTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutorTest.java index 9ce9abd8..3d3d4faf 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutorTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/health/HealthExecutorTest.java @@ -22,10 +22,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.ArgumentMatchers.any; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckStatus; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckStatus; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; import org.apache.eventmesh.dashboard.console.function.health.check.config.HealthCheckObjectConfig; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java index 2a780f40..ebc1a67b 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.integration.health; +import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; -import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.CheckResultCache; import org.apache.eventmesh.dashboard.console.function.health.HealthService; import org.apache.eventmesh.dashboard.console.function.health.check.config.HealthCheckObjectConfig; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java index 8388de66..034202de 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java @@ -17,9 +17,9 @@ package org.apache.eventmesh.dashboard.console.mapper.client; +import org.apache.eventmesh.dashboard.common.enums.DataStatus; import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.client.ClientEntity; -import org.apache.eventmesh.dashboard.console.enums.StatusEnum; import java.util.List; @@ -70,7 +70,7 @@ public void testInsert() { clientEntity.setDescription(""); clientEntity.setPid(1L); clientEntity.setPort(8080); - clientEntity.setStatusEntity(StatusEnum.ACTIVE); + clientEntity.setStatusEntity(DataStatus.ACTIVE); clientEntity.setConfigIds(""); clientEntity.setLanguage("rust"); clientEntity.setPlatform(""); diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/ConnectorOptService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/ConnectorOptService.java new file mode 100644 index 00000000..b2c451f0 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/ConnectorOptService.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.operation.connector; + +/** + * k8s operation service + */ +public interface ConnectorOptService { + + void createConnector(); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java new file mode 100644 index 00000000..6b8d5ecf --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.operation.connector; + +/** + * k8s operation service + */ +public interface RuntimeOptService { + + void createRuntime(); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/AclRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/AclRemotingService.java new file mode 100644 index 00000000..3f999861 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/AclRemotingService.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.acl.CreateAclRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.acl.CreateAclResult; +import org.apache.eventmesh.dashboard.common.model.remoting.acl.DeleteAclRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.acl.DeleteAclResult; +import org.apache.eventmesh.dashboard.common.model.remoting.acl.GetAclsRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.acl.GetAclsResult; + +/** + * A remoting service for ACL operations. + */ +public interface AclRemotingService { + + CreateAclResult createAcl(CreateAclRequest createAclRequest); + + DeleteAclResult deleteAcl(DeleteAclRequest deleteAclRequest); + + GetAclsResult getAllAcls(GetAclsRequest getAclsRequest); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ClientRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ClientRemotingService.java new file mode 100644 index 00000000..df1128f3 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ClientRemotingService.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + + +import org.apache.eventmesh.dashboard.common.model.metadata.ClientMetadata; + +import java.util.List; + +/** + * A remoting service for client operations. + Not implemented in eventmesh by now + */ +public interface ClientRemotingService { + List getClientList(); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConfigRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConfigRemotingService.java new file mode 100644 index 00000000..7c7a9d1a --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConfigRemotingService.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.config.GetConfigRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.config.GetConfigResult; + +/** + * A remoting service for config operations. Getting configs from different sources + */ +public interface ConfigRemotingService { + + public GetConfigResult getConfigsFromRegistry(GetConfigRequest getConfigRequest); + + public GetConfigResult getConfigsFromRuntime(GetConfigRequest getConfigRequest); + + public GetConfigResult getConfigsFromKafka(GetConfigRequest getConfigRequest); + + public GetConfigResult getConfigsFromRocketMQ(GetConfigRequest getConfigRequest); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConnectorRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConnectorRemotingService.java new file mode 100644 index 00000000..40b020c6 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/ConnectorRemotingService.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.connector.CreateConnectorRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.connector.CreateConnectorResult; +import org.apache.eventmesh.dashboard.common.model.remoting.connector.GetConnectorRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.connector.GetConnectorResult; + +/** + * A remoting service for connector operations. Get connector info from Registry. + */ +public interface ConnectorRemotingService { + + public GetConnectorResult getConnectors(GetConnectorRequest getConnectorRequest); + + public CreateConnectorResult createConnector(CreateConnectorRequest createConnectorRequest); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/GroupRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/GroupRemotingService.java new file mode 100644 index 00000000..2540746d --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/GroupRemotingService.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.group.GetGroupResult; +import org.apache.eventmesh.dashboard.common.model.remoting.group.GetGroupsRequest; + +/** + * Group Remoting Service + */ +public interface GroupRemotingService { + + GetGroupResult getAllGroups(GetGroupsRequest getGroupsRequest); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/OffsetRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/OffsetRemotingService.java new file mode 100644 index 00000000..67a771d6 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/OffsetRemotingService.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.offset.GetOffsetRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.offset.GetOffsetResult; + +/** + * interface to operate storage offset + */ +public interface OffsetRemotingService { + + GetOffsetResult getOffset(GetOffsetRequest getOffsetRequest); + + GetOffsetResult resetOffset(GetOffsetRequest getOffsetRequest); +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/SubscriptionRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/SubscriptionRemotingService.java new file mode 100644 index 00000000..887c1f8f --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/SubscriptionRemotingService.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.subscription.GetSubscriptionRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.subscription.GetSubscriptionResult; + +/** + * remoting service to get a subscription relationship between a topic and a consumer/producer + */ +public interface SubscriptionRemotingService { + + GetSubscriptionResult getSubscription(GetSubscriptionRequest request); + +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/TopicRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/TopicRemotingService.java new file mode 100644 index 00000000..00b255cf --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/TopicRemotingService.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.topic.CreateTopicRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.topic.CreateTopicResult; +import org.apache.eventmesh.dashboard.common.model.remoting.topic.DeleteTopicRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.topic.DeleteTopicResult; +import org.apache.eventmesh.dashboard.common.model.remoting.topic.GetTopicsRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.topic.GetTopicsResult; + +/** + * implement this interface to operate the eventmesh cluster + */ +public interface TopicRemotingService { + + CreateTopicResult createTopic(CreateTopicRequest createTopicRequest); + + DeleteTopicResult deleteTopic(DeleteTopicRequest deleteTopicRequest); + + GetTopicsResult getAllTopics(GetTopicsRequest getTopicsRequest); + +} diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/UserRemotingService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/UserRemotingService.java new file mode 100644 index 00000000..69ec414e --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/remoting/UserRemotingService.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.remoting; + +import org.apache.eventmesh.dashboard.common.model.remoting.user.CreateUserRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.user.DeleterUserRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.user.GetUserRequest; +import org.apache.eventmesh.dashboard.common.model.remoting.user.GetUserResult; + +/** + * Remoting Service to manage service users. For example, create a mysql user or get kafka users. + */ +public interface UserRemotingService { + + CreateUserRequest createServiceUser(CreateUserRequest request); + + DeleterUserRequest deleteServiceUser(DeleterUserRequest request); + + GetUserResult getServiceUser(GetUserRequest request); +} From 486b6f3df20515b80ef2ff4476829d21ea746b37 Mon Sep 17 00:00:00 2001 From: "lambert@arch" Date: Fri, 29 Mar 2024 15:38:29 +0800 Subject: [PATCH 2/4] chore: fix mistakes and several rename --- .../{DataStatus.java => RecordStatus.java} | 2 +- .../common/model/metadata/AclMetadata.java | 2 +- .../common/model/metadata/ClientMetadata.java | 7 ----- .../model/metadata/ClusterMetadata.java | 5 ---- .../model/metadata/ConnectionMetadata.java | 5 ---- .../common/model/metadata/GroupMetadata.java | 5 ---- .../common/model/metadata/MetadataConfig.java | 4 --- .../model/metadata/RegistryMetadata.java | 8 ++--- .../model/metadata/RuntimeMetadata.java | 7 ----- .../model/metadata/ServiceUserMetadata.java | 4 +++ .../common/model/metadata/TopicMetadata.java | 5 ---- .../remoting/config/GetConfigRequest.java | 2 +- .../remoting/config/GetConfigResponse.java | 2 +- .../model/remoting/group/GetGroupResult.java | 3 ++ .../remoting/offset/GetOffsetRequest.java | 6 ++-- .../remoting/offset/ResetOffsetRequest.java | 14 +++++---- .../remoting/offset/ResetOffsetResponse.java | 3 ++ .../remoting/offset/ResetOffsetResult.java | 6 +++- .../remoting/runtime/GetRuntimeRequest.java} | 21 ++++--------- .../remoting/runtime/GetRuntimeResponse.java | 30 +++++++++++++++++++ .../remoting/runtime/GetRuntimeResult.java} | 23 ++++---------- .../console/entity/client/ClientEntity.java | 6 ++-- .../entity/connection/ConnectionEntity.java | 4 +-- .../entity/connector/ConnectorEntity.java | 6 ++-- .../console/entity/meta/MetaEntity.java | 6 ++-- .../mapper/client/ClientMapperTest.java | 4 +-- 26 files changed, 86 insertions(+), 104 deletions(-) rename eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/{DataStatus.java => RecordStatus.java} (97%) rename eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/{enums/metadata/MetadataTypeEnum.java => model/remoting/runtime/GetRuntimeRequest.java} (80%) create mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResponse.java rename eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/{enums/metadata/MetadataServiceTypeEnum.java => model/remoting/runtime/GetRuntimeResult.java} (77%) diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java similarity index 97% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java index ac65cf9f..5ed81c75 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DataStatus.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java @@ -22,7 +22,7 @@ @Getter @AllArgsConstructor -public enum DataStatus { +public enum RecordStatus { INACTIVE(0, "Inactive"), ACTIVE(1, "Active"); diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java index 12446b14..8025b589 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/AclMetadata.java @@ -20,7 +20,7 @@ import lombok.Data; @Data -public class AclMetadata { +public class AclMetadata extends MetadataConfig { private Long clusterId; private String principal; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java index d9173217..9b2d1199 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClientMetadata.java @@ -17,18 +17,11 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; - import lombok.Data; @Data public class ClientMetadata extends MetadataConfig { - - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.CLIENT); - } - private String name; private String platform; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java index 2648c188..432f9fe0 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java @@ -18,17 +18,12 @@ package org.apache.eventmesh.dashboard.common.model.metadata; import org.apache.eventmesh.dashboard.common.enums.StoreType; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; import lombok.Data; @Data public class ClusterMetadata extends MetadataConfig { - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.CLUSTER); - } - private String clusterName; private String registryAddress; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java index 2bc41419..7543f0bd 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConnectionMetadata.java @@ -17,8 +17,6 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; - import lombok.Data; /** @@ -28,9 +26,6 @@ @Data public class ConnectionMetadata extends MetadataConfig { - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.CONNECTION); - } /** * The type of source. Possible values are "connector" or "client". diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java index 2934f534..e3df7cf7 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java @@ -17,15 +17,10 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; - import lombok.Data; @Data public class GroupMetadata extends MetadataConfig { - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.GROUP); - } private String name; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java index 0f47a398..2a8ee201 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java @@ -17,8 +17,6 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; - import lombok.Data; /** @@ -29,8 +27,6 @@ @Data public class MetadataConfig { - private MetadataServiceTypeEnum serviceTypeEnums; - //center url private String registryAddress; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java index c39e785d..56ea68a6 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java @@ -17,17 +17,13 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import lombok.Data; @Data public class RegistryMetadata extends MetadataConfig { - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.META_NACOS); - } private String clusterName; @@ -50,7 +46,7 @@ public class RegistryMetadata extends MetadataConfig { /** * 0: not active, 1: active * - * @see DataStatus + * @see RecordStatus */ private Integer status; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java index 25579e20..5bdab8f3 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java @@ -17,18 +17,11 @@ package org.apache.eventmesh.dashboard.common.model.metadata; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; - import lombok.Data; @Data public class RuntimeMetadata extends MetadataConfig { - - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.RUNTIME); - } - private String host; private Integer port; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java index 15b02b02..1ea76c91 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ServiceUserMetadata.java @@ -21,8 +21,12 @@ import lombok.Data; +/** + * Service users are users that are used by components like mysql, kafka, etc. + */ @Data public class ServiceUserMetadata { + private String userName; //service users are only store users by now private StoreType serviceType; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java index 2cc78f96..829ed224 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java @@ -18,17 +18,12 @@ package org.apache.eventmesh.dashboard.common.model.metadata; import org.apache.eventmesh.dashboard.common.enums.StoreType; -import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum; import lombok.Data; @Data public class TopicMetadata extends MetadataConfig { - { - this.setServiceTypeEnums(MetadataServiceTypeEnum.TOPIC); - } - private StoreType storeType; private String storeAddress; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java index 0b2c4e56..a3298565 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java @@ -29,7 +29,7 @@ public class GetConfigRequest { - private List registryAddress; + private List nameServerAddress; private List runtimeAddress; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java index 34682f91..c96809a5 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigResponse.java @@ -32,6 +32,6 @@ public class GetConfigResponse { - List configMetadataList; + private List configMetadataList; private Boolean success; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java index a8d70b83..75552cd8 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/group/GetGroupResult.java @@ -19,6 +19,9 @@ import java.util.concurrent.CompletableFuture; +import lombok.Data; + +@Data public class GetGroupResult { private CompletableFuture future; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java index dc3b52f9..54ba5870 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java @@ -18,12 +18,12 @@ package org.apache.eventmesh.dashboard.common.model.remoting.offset; -import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata; - import lombok.Data; @Data public class GetOffsetRequest { - private GroupMetadata groupMetadata; + private String bootStrapServers; + + private String groupName; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java index 9e5f4a7a..cf77017e 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetRequest.java @@ -18,22 +18,24 @@ package org.apache.eventmesh.dashboard.common.model.remoting.offset; -import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata; - -import java.time.LocalDateTime; - import lombok.Data; @Data public class ResetOffsetRequest { - LocalDateTime timestamp; + Long timestamp; Long offset; + private String topic; + + private String bootStrapServers; + + private Integer partitionId; + ResetOffsetMode resetOffsetMode; - GroupMetadata groupMetadata; + private String groupName; public enum ResetOffsetMode { EARLIEST, diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java index 5369703a..ed1417be 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResponse.java @@ -17,6 +17,9 @@ package org.apache.eventmesh.dashboard.common.model.remoting.offset; +import lombok.Data; + +@Data public class ResetOffsetResponse { private Long offset; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java index 89c3b60f..3c1fb225 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/ResetOffsetResult.java @@ -19,7 +19,11 @@ import java.util.concurrent.CompletableFuture; +import lombok.Data; + +@Data public class ResetOffsetResult { + private Boolean success; - private CompletableFuture resetOffsetResponseCompletableFuture; + private CompletableFuture future; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java similarity index 80% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java index 90a3e458..4fb5c7de 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java @@ -15,23 +15,12 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.enums.metadata; +package org.apache.eventmesh.dashboard.common.model.remoting.runtime; -public enum MetadataTypeEnum { +import lombok.Data; - CENTER, - - CLUSTER, - - RUNTIME, - - TOPIC, - - GROUP, - - SUBSCRIPTION, - - STORE - ; +@Data +public class GetRuntimeRequest { + private String registryAddress; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResponse.java new file mode 100644 index 00000000..27917ba9 --- /dev/null +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResponse.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.common.model.remoting.runtime; + +import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata; + +import java.util.List; + +import lombok.Data; + +@Data +public class GetRuntimeResponse { + + private List runtimeMetadata; +} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java similarity index 77% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java index a810b0e4..3fae063b 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java @@ -15,25 +15,14 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.enums.metadata; +package org.apache.eventmesh.dashboard.common.model.remoting.runtime; -public enum MetadataServiceTypeEnum { +import java.util.concurrent.CompletableFuture; - RUNTIME, - - CENTER_ETCD, - - META_NACOS, - - TOPIC, - - CLUSTER, - - CLIENT, - - GROUP, - - CONNECTION, +import lombok.Data; +@Data +public class GetRuntimeResult { + private CompletableFuture future; } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java index cef62392..e6cec83c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.entity.client; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; import java.sql.Timestamp; @@ -69,7 +69,7 @@ public class ClientEntity extends BaseEntity { /** * 0: not active, 1: active - * @see DataStatus + * @see RecordStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active") private Integer status; @@ -88,7 +88,7 @@ public class ClientEntity extends BaseEntity { */ private Timestamp endTime; - public void setStatusEntity(DataStatus status) { + public void setStatusEntity(RecordStatus status) { this.status = status.getNumber(); } } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java index db7c33ad..8283cbbb 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/ConnectionEntity.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.entity.connection; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; import java.sql.Timestamp; @@ -83,7 +83,7 @@ public class ConnectionEntity extends BaseEntity { private String description; - public void setDataStatus(DataStatus dataStatus) { + public void setDataStatus(RecordStatus dataStatus) { this.status = dataStatus.getNumber(); } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java index ec7bb018..7a5f6f29 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connector/ConnectorEntity.java @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.console.entity.connector; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; import org.apache.eventmesh.dashboard.common.enums.KubernetesPodStatus; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; @@ -45,7 +45,7 @@ public class ConnectorEntity extends BaseEntity { /** * 0: not active, 1: active * - * @see DataStatus + * @see RecordStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active") private Integer status; @@ -63,7 +63,7 @@ public class ConnectorEntity extends BaseEntity { */ private String configIds; - public void setDataStatus(DataStatus dataStatus) { + public void setDataStatus(RecordStatus dataStatus) { this.status = dataStatus.getNumber(); } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java index a8456441..fb004425 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/meta/MetaEntity.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.entity.meta; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; @@ -54,12 +54,12 @@ public class MetaEntity extends BaseEntity { /** * 0: not active, 1: active * - * @see DataStatus + * @see RecordStatus */ @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active") private Integer status; - public void setDataStatus(DataStatus dataStatus) { + public void setDataStatus(RecordStatus dataStatus) { this.status = dataStatus.getNumber(); } } diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java index 034202de..2905480f 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/client/ClientMapperTest.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.mapper.client; -import org.apache.eventmesh.dashboard.common.enums.DataStatus; +import org.apache.eventmesh.dashboard.common.enums.RecordStatus; import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.client.ClientEntity; @@ -70,7 +70,7 @@ public void testInsert() { clientEntity.setDescription(""); clientEntity.setPid(1L); clientEntity.setPort(8080); - clientEntity.setStatusEntity(DataStatus.ACTIVE); + clientEntity.setStatusEntity(RecordStatus.ACTIVE); clientEntity.setConfigIds(""); clientEntity.setLanguage("rust"); clientEntity.setPlatform(""); From b9dbe220cbca1e32490c56ef5ecb965a232b9ec2 Mon Sep 17 00:00:00 2001 From: scwlkq <89067331+scwlkq@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:54:42 +0800 Subject: [PATCH 3/4] [ISSUE #45] Implement methods from storage-plugin.admin(rocketmq) (#66) * modify RocketmqTopicCore, using SDKManager * fix style * delete some variable in RocketmqProperties and TopicProperties & remote additional endPoint name * remove junit dependency back to console module * remove unnecessary brackets & revert em-dashboard-pom.xml & move RocketmqProperties to core.dto * add todo * move todo to common sdk dependencies & fix style * add test and junit dependencies in core pom.xml * revert the indentation in pom.xml & move test related dependencies to bottom in core-pom.xml * revert indentation in pom.xml * revert indentation in pom.xml * remove unnecessary params * remove params * remove empty line --- eventmesh-dashboard-common/pom.xml | 24 ++++ eventmesh-dashboard-console/pom.xml | 53 +++----- .../console/controller/TopicController.java | 4 +- eventmesh-dashboard-core/pom.xml | 13 ++ .../function/SDK/AbstractSDKOperation.java | 2 +- .../core}/function/SDK/SDKManager.java | 20 ++- .../core}/function/SDK/SDKOperation.java | 4 +- .../core}/function/SDK/SDKTypeEnum.java | 2 +- .../SDK/config/CreateNacosConfig.java | 2 +- .../SDK/config/CreateRedisConfig.java | 2 +- .../SDK/config/CreateRocketmqConfig.java | 2 +- .../function/SDK/config/CreateSDKConfig.java | 2 +- .../SDK/operation/EtcdSDKOperation.java | 6 +- .../operation/NacosConfigSDKOperation.java | 8 +- .../operation/NacosNamingSDKOperation.java | 8 +- .../SDK/operation/NacosSDKOperation.java | 8 +- .../SDK/operation/RedisSDKOperation.java | 8 +- .../RocketMQProduceSDKOperation.java | 8 +- .../RocketMQPushConsumerSDKOperation.java | 8 +- .../RocketMQRemotingSDKOperation.java | 6 +- .../SDK/operation/RuntimeSDKOperation.java | 6 +- .../function/SDK/wrapper/NacosSDKWrapper.java | 2 +- .../core/store/RocketmqTopicCore.java | 126 ++++++++++++++++-- .../core}/function/SDK/SDKManagerTest.java | 7 +- .../RedisSDKCreateOperationTest.java | 6 +- .../service/dto/RocketmqProperties.java | 34 +++++ .../service/dto}/TopicProperties.java | 19 +-- .../dashboard/service/store/TopicCore.java | 11 +- pom.xml | 1 + 29 files changed, 270 insertions(+), 132 deletions(-) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/AbstractSDKOperation.java (94%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/SDKManager.java (83%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/SDKOperation.java (88%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/SDKTypeEnum.java (94%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/config/CreateNacosConfig.java (93%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/config/CreateRedisConfig.java (93%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/config/CreateRocketmqConfig.java (95%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/config/CreateSDKConfig.java (93%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/EtcdSDKOperation.java (82%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/NacosConfigSDKOperation.java (86%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/NacosNamingSDKOperation.java (86%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/NacosSDKOperation.java (87%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RedisSDKOperation.java (82%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RocketMQProduceSDKOperation.java (85%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RocketMQPushConsumerSDKOperation.java (86%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RocketMQRemotingSDKOperation.java (87%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RuntimeSDKOperation.java (82%) rename {eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core}/function/SDK/wrapper/NacosSDKWrapper.java (94%) rename {eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core}/function/SDK/SDKManagerTest.java (90%) rename {eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console => eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core}/function/SDK/operation/RedisSDKCreateOperationTest.java (91%) create mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/RocketmqProperties.java rename {eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model => eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto}/TopicProperties.java (66%) diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 108b059b..d6c277c5 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -40,6 +40,30 @@ fastjson2 2.0.40 + + + + + io.lettuce + lettuce-core + + + + com.alibaba.nacos + nacos-client + ${nacos.version} + + + + org.apache.rocketmq + rocketmq-client + ${rocketmq.version} + + + org.apache.rocketmq + rocketmq-tools + ${rocketmq.version} + \ No newline at end of file diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index 231d865c..c68e5a8e 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -37,6 +37,19 @@ spring-aspects + + + org.springframework.boot + spring-boot-starter-test + test + + + junit + junit + 4.13.2 + test + + org.springdoc @@ -59,19 +72,13 @@ org.mybatis.spring.boot mybatis-spring-boot-starter + com.mysql mysql-connector-j runtime - - - com.alibaba.nacos - nacos-client - ${nacos.version} - - @@ -93,38 +100,8 @@ - - - io.lettuce - lettuce-core - - - - org.apache.rocketmq - rocketmq-client - 4.9.4 - - - org.apache.rocketmq - rocketmq-tools - 5.2.0 - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - junit - junit - 4.13.2 - test - + diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java index 1f6c601b..c8f92ff8 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java @@ -18,9 +18,9 @@ package org.apache.eventmesh.dashboard.console.controller; import org.apache.eventmesh.dashboard.common.dto.Result; -import org.apache.eventmesh.dashboard.common.model.TopicProperties; import org.apache.eventmesh.dashboard.console.dto.CreateTopicRequest; import org.apache.eventmesh.dashboard.console.dto.DeleteTopicRequest; +import org.apache.eventmesh.dashboard.service.dto.TopicProperties; import org.apache.eventmesh.dashboard.service.store.TopicCore; import java.util.List; @@ -61,7 +61,7 @@ public ResponseEntity preflight() { @CrossOrigin @GetMapping public Result> getList() { - List topicList = topicCore.getTopic(); + List topicList = topicCore.getTopics(); return Result.success(topicList); } diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml index 61d9a01d..22cdbd99 100644 --- a/eventmesh-dashboard-core/pom.xml +++ b/eventmesh-dashboard-core/pom.xml @@ -65,5 +65,18 @@ rocketmq-client 4.9.7 + + + + org.springframework.boot + spring-boot-starter-test + test + + + junit + junit + 4.13.2 + test + \ No newline at end of file diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/AbstractSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/AbstractSDKOperation.java similarity index 94% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/AbstractSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/AbstractSDKOperation.java index c2e5b964..d9ad2a70 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/AbstractSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/AbstractSDKOperation.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK; +package org.apache.eventmesh.dashboard.core.function.SDK; public abstract class AbstractSDKOperation implements SDKOperation { diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManager.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java similarity index 83% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManager.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java index 9ac4dbdc..43822e30 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManager.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManager.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK; +package org.apache.eventmesh.dashboard.core.function.SDK; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.NacosConfigSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.NacosNamingSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.NacosSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.RedisSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.RocketMQProduceSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.RocketMQPushConsumerSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.operation.RocketMQRemotingSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosConfigSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosNamingSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.NacosSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.RedisSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.RocketMQProduceSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.RocketMQPushConsumerSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.operation.RocketMQRemotingSDKOperation; import java.util.AbstractMap.SimpleEntry; import java.util.Map; @@ -32,10 +32,8 @@ import java.util.concurrent.ConcurrentHashMap; - /** * SDK manager is a singleton to manage all SDK clients, it is a facade to create, delete and get a client. - */ public class SDKManager { diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKOperation.java similarity index 88% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKOperation.java index 19d264c5..8e9e9ecd 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKOperation.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK; +package org.apache.eventmesh.dashboard.core.function.SDK; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKTypeEnum.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java similarity index 94% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKTypeEnum.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java index 9a44873d..d01efa1c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKTypeEnum.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKTypeEnum.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK; +package org.apache.eventmesh.dashboard.core.function.SDK; public enum SDKTypeEnum { diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateNacosConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateNacosConfig.java similarity index 93% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateNacosConfig.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateNacosConfig.java index 856d4de5..2fd8ef0f 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateNacosConfig.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateNacosConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.config; +package org.apache.eventmesh.dashboard.core.function.SDK.config; import lombok.Data; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRedisConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRedisConfig.java similarity index 93% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRedisConfig.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRedisConfig.java index 30c53b89..a4577491 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRedisConfig.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRedisConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.config; +package org.apache.eventmesh.dashboard.core.function.SDK.config; import lombok.Data; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRocketmqConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRocketmqConfig.java similarity index 95% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRocketmqConfig.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRocketmqConfig.java index 89424e70..19ea6d49 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateRocketmqConfig.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRocketmqConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.config; +package org.apache.eventmesh.dashboard.core.function.SDK.config; import org.apache.rocketmq.client.consumer.listener.MessageListener; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateSDKConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateSDKConfig.java similarity index 93% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateSDKConfig.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateSDKConfig.java index 9a404f2e..23b3c110 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/config/CreateSDKConfig.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateSDKConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.config; +package org.apache.eventmesh.dashboard.core.function.SDK.config; /** * Config to create an SDK client, usually contains an address url. diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/EtcdSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java similarity index 82% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/EtcdSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java index 75beaf69..3f483c1f 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/EtcdSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/EtcdSDKOperation.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosConfigSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosConfigSDKOperation.java similarity index 86% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosConfigSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosConfigSDKOperation.java index 0757f7bc..cea39d6a 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosConfigSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosConfigSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateNacosConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateNacosConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; import java.util.Properties; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosNamingSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosNamingSDKOperation.java similarity index 86% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosNamingSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosNamingSDKOperation.java index 54fcd05b..b6707b3f 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosNamingSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosNamingSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateNacosConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateNacosConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; import java.util.Properties; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosSDKOperation.java similarity index 87% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosSDKOperation.java index e0b326e7..c3651f6c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/NacosSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/NacosSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.wrapper.NacosSDKWrapper; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.wrapper.NacosSDKWrapper; import java.util.AbstractMap.SimpleEntry; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKOperation.java similarity index 82% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKOperation.java index ec50d422..5fd3d4f1 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateRedisConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRedisConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQProduceSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQProduceSDKOperation.java similarity index 85% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQProduceSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQProduceSDKOperation.java index 2dde6c30..c1f46a74 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQProduceSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQProduceSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateRocketmqConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRocketmqConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.producer.DefaultMQProducer; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQPushConsumerSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQPushConsumerSDKOperation.java similarity index 86% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQPushConsumerSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQPushConsumerSDKOperation.java index f25d4df0..b55a6632 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQPushConsumerSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQPushConsumerSDKOperation.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateRocketmqConfig; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRocketmqConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.exception.MQClientException; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQRemotingSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQRemotingSDKOperation.java similarity index 87% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQRemotingSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQRemotingSDKOperation.java index 3c88ff4e..f98dc724 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RocketMQRemotingSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RocketMQRemotingSDKOperation.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import org.apache.rocketmq.remoting.RemotingClient; import org.apache.rocketmq.remoting.netty.NettyClientConfig; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RuntimeSDKOperation.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RuntimeSDKOperation.java similarity index 82% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RuntimeSDKOperation.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RuntimeSDKOperation.java index 65d358c8..d630bc09 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RuntimeSDKOperation.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RuntimeSDKOperation.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; -import org.apache.eventmesh.dashboard.console.function.SDK.AbstractSDKOperation; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; import java.util.AbstractMap.SimpleEntry; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/wrapper/NacosSDKWrapper.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/wrapper/NacosSDKWrapper.java similarity index 94% rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/wrapper/NacosSDKWrapper.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/wrapper/NacosSDKWrapper.java index 7f9e3ffa..a0c0858a 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/SDK/wrapper/NacosSDKWrapper.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/function/SDK/wrapper/NacosSDKWrapper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.wrapper; +package org.apache.eventmesh.dashboard.core.function.SDK.wrapper; import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.exception.NacosException; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java index 5dba4c23..b3810f0c 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java @@ -17,42 +17,142 @@ package org.apache.eventmesh.dashboard.core.store; -import org.apache.eventmesh.dashboard.common.model.TopicProperties; -import org.apache.eventmesh.dashboard.core.config.AdminProperties; +import org.apache.eventmesh.dashboard.core.function.SDK.SDKManager; +import org.apache.eventmesh.dashboard.core.function.SDK.SDKTypeEnum; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; +import org.apache.eventmesh.dashboard.service.dto.RocketmqProperties; +import org.apache.eventmesh.dashboard.service.dto.TopicProperties; import org.apache.eventmesh.dashboard.service.store.TopicCore; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.common.TopicConfig; +import org.apache.rocketmq.common.TopicFilterType; +import org.apache.rocketmq.common.constant.PermName; +import org.apache.rocketmq.common.protocol.RequestCode; +import org.apache.rocketmq.common.protocol.body.TopicConfigSerializeWrapper; +import org.apache.rocketmq.common.protocol.header.CreateTopicRequestHeader; +import org.apache.rocketmq.common.protocol.header.DeleteTopicRequestHeader; +import org.apache.rocketmq.remoting.CommandCustomHeader; +import org.apache.rocketmq.remoting.RemotingClient; +import org.apache.rocketmq.remoting.protocol.RemotingCommand; + +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ConcurrentMap; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; -/** - * TODO implement methods from storage-plugin.admin - */ - @Slf4j @Service public class RocketmqTopicCore implements TopicCore { - AdminProperties adminProperties; + private final RocketmqProperties rocketmqProperties; + + private RemotingClient createRemotingClient(String brokerUrl) { + CreateSDKConfig createSDKConfig = () -> brokerUrl; + + SDKManager.getInstance().createClient(SDKTypeEnum.STORAGE_ROCKETMQ_REMOTING, createSDKConfig); + return (RemotingClient) SDKManager.getInstance().getClient(SDKTypeEnum.STORAGE_ROCKETMQ_REMOTING, brokerUrl); + } + - public RocketmqTopicCore(AdminProperties adminProperties) { - this.adminProperties = adminProperties; + public RocketmqTopicCore(RocketmqProperties rocketmqProperties) { + this.rocketmqProperties = rocketmqProperties; } @Override - public List getTopic() { - return null; + public Boolean createTopic(String topicName) { + String namesrvAddr = rocketmqProperties.getNamesrvAddr(); + long requestTimeoutMillis = rocketmqProperties.getRequestTimeoutMillis(); + if (StringUtils.isEmpty(namesrvAddr)) { + log.info("RocketmqTopicCore-createTopic failed, missing brokerUrl"); + return Boolean.FALSE; + } + + RemotingClient remotingClient = (RemotingClient) SDKManager.getInstance().getClient(SDKTypeEnum.STORAGE_ROCKETMQ_REMOTING, namesrvAddr); + if (remotingClient == null) { + remotingClient = createRemotingClient(namesrvAddr); + } + try { + CreateTopicRequestHeader requestHeader = new CreateTopicRequestHeader(); + requestHeader.setTopic(topicName); + requestHeader.setTopicFilterType(TopicFilterType.SINGLE_TAG.name()); + requestHeader.setPerm(PermName.PERM_READ | PermName.PERM_WRITE); + + RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.UPDATE_AND_CREATE_TOPIC, requestHeader); + RemotingCommand response = remotingClient.invokeSync(namesrvAddr, request, requestTimeoutMillis); + log.info("Rocketmq create topic result:" + response.toString()); + return response.getCode() == 0; + } catch (Exception e) { + log.error("RocketmqTopicCore-createTopic failed.", e); + } + return Boolean.FALSE; } @Override - public void createTopic(String topicName) { + public List getTopics() { + String namesrvAddr = rocketmqProperties.getNamesrvAddr(); + long requestTimeoutMillis = rocketmqProperties.getRequestTimeoutMillis(); + if (StringUtils.isEmpty(namesrvAddr)) { + log.info("RocketmqTopicCore-getTopics failed, missing brokerUrl"); + return new ArrayList<>(); + } + + RemotingClient remotingClient = (RemotingClient) SDKManager.getInstance().getClient(SDKTypeEnum.STORAGE_ROCKETMQ_REMOTING, namesrvAddr); + if (remotingClient == null) { + remotingClient = createRemotingClient(namesrvAddr); + } + List topicConfigList = new ArrayList<>(); + try { + RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_ALL_TOPIC_CONFIG, (CommandCustomHeader) null); + RemotingCommand response = remotingClient.invokeSync(namesrvAddr, request, requestTimeoutMillis); + TopicConfigSerializeWrapper allTopicConfig = TopicConfigSerializeWrapper.decode(response.getBody(), TopicConfigSerializeWrapper.class); + ConcurrentMap topicConfigTable = allTopicConfig.getTopicConfigTable(); + topicConfigList = new ArrayList<>(topicConfigTable.values()); + } catch (Exception e) { + log.error("RocketmqTopicCore-createTopic failed.", e); + } + return topicConfig2TopicProperties(topicConfigList); } @Override - public void deleteTopic(String topicName) { + public Boolean deleteTopic(String topicName) { + String namesrvAddr = rocketmqProperties.getNamesrvAddr(); + long requestTimeoutMillis = rocketmqProperties.getRequestTimeoutMillis(); + if (StringUtils.isEmpty(namesrvAddr)) { + log.info("RocketmqTopicCore-deleteTopic failed, missing brokerUrl"); + return Boolean.FALSE; + } + + RemotingClient remotingClient = (RemotingClient) SDKManager.getInstance().getClient(SDKTypeEnum.STORAGE_ROCKETMQ_REMOTING, namesrvAddr); + if (remotingClient == null) { + remotingClient = createRemotingClient(namesrvAddr); + } + try { + DeleteTopicRequestHeader deleteTopicRequestHeader = new DeleteTopicRequestHeader(); + deleteTopicRequestHeader.setTopic(topicName); + RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.DELETE_TOPIC_IN_BROKER, null); + RemotingCommand response = remotingClient.invokeSync(namesrvAddr, request, requestTimeoutMillis); + + log.info("Rocketmq delete topic result:" + response.toString()); + return response.getCode() == 0; + } catch (Exception e) { + log.error("RocketmqTopicCore-createTopic failed.", e); + } + return Boolean.FALSE; + } + public List topicConfig2TopicProperties(List topicConfigList) { + ArrayList topicPropertiesList = new ArrayList<>(); + for (TopicConfig topicConfig : topicConfigList) { + TopicProperties topicProperties = new TopicProperties(); + BeanUtils.copyProperties(topicConfig, topicProperties); + topicPropertiesList.add(topicProperties); + } + return topicPropertiesList; } } diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManagerTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java similarity index 90% rename from eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManagerTest.java rename to eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java index 4eccdb0f..d243fa78 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/SDKManagerTest.java +++ b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java @@ -15,17 +15,20 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK; +package org.apache.eventmesh.dashboard.core.function.SDK; import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateRedisConfig; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRedisConfig; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import lombok.extern.slf4j.Slf4j; + @Slf4j class SDKManagerTest { diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKCreateOperationTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKCreateOperationTest.java similarity index 91% rename from eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKCreateOperationTest.java rename to eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKCreateOperationTest.java index 33a06b8e..ec90f29c 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/function/SDK/operation/RedisSDKCreateOperationTest.java +++ b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/operation/RedisSDKCreateOperationTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.console.function.SDK.operation; +package org.apache.eventmesh.dashboard.core.function.SDK.operation; import static org.junit.jupiter.api.Assertions.assertEquals; -import org.apache.eventmesh.dashboard.console.function.SDK.config.CreateRedisConfig; +import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRedisConfig; import java.util.AbstractMap.SimpleEntry; @@ -29,8 +29,6 @@ import lombok.extern.slf4j.Slf4j; - - @Slf4j class RedisSDKCreateOperationTest { diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/RocketmqProperties.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/RocketmqProperties.java new file mode 100644 index 00000000..b17e9af5 --- /dev/null +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/RocketmqProperties.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.dashboard.service.dto; + +import lombok.Data; + +@Data +public class RocketmqProperties { + + private String namesrvAddr; + + private String clusterName; + + private String accessKey; + + private String secretKey; + + private long requestTimeoutMillis = 10000L; +} \ No newline at end of file diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/TopicProperties.java similarity index 66% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/TopicProperties.java index 49decb7c..4eedc694 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/dto/TopicProperties.java @@ -15,26 +15,19 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.model; +package org.apache.eventmesh.dashboard.service.dto; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; /** * One record displayed in 'Topic' page. */ +@Data public class TopicProperties { - public String name; - public long messageCount; + private String topicName; + + private int offset; - @JsonCreator - public TopicProperties( - @JsonProperty("name") String name, - @JsonProperty("messageCount") long messageCount) { - super(); - this.name = name; - this.messageCount = messageCount; - } } diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java index 2b37e53f..2e637725 100644 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.service.store; -import org.apache.eventmesh.dashboard.common.model.TopicProperties; +import org.apache.eventmesh.dashboard.service.dto.TopicProperties; import java.util.List; @@ -27,12 +27,9 @@ public interface TopicCore { - /** - * TODO rename to getTopics after being implemented - */ - List getTopic(); + List getTopics(); - void createTopic(String topicName); + Boolean createTopic(String topicName); - void deleteTopic(String topicName); + Boolean deleteTopic(String topicName); } diff --git a/pom.xml b/pom.xml index fd0ac3f0..e6dfb520 100644 --- a/pom.xml +++ b/pom.xml @@ -81,6 +81,7 @@ 2.7.6 2.3.2 2.1.2 + 4.9.8 From f66418c5873862ae25c99067a57fc9c28eee4bea Mon Sep 17 00:00:00 2001 From: "lambert@arch" Date: Fri, 29 Mar 2024 16:04:38 +0800 Subject: [PATCH 4/4] chore: fix typos --- .../dashboard/common/model/metadata/MetadataConfig.java | 4 ++-- .../common/model/remoting/config/GetConfigRequest.java | 6 +++--- .../common/model/remoting/offset/GetOffsetRequest.java | 2 +- .../dashboard/console/spring/support/FunctionManager.java | 2 +- .../dashboard/core/function/SDK/SDKManagerTest.java | 2 -- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java index 2a8ee201..880be5fd 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java @@ -27,8 +27,8 @@ @Data public class MetadataConfig { - //center url + //eventmesh registry url private String registryAddress; - + //cluster id in database private Long clusterId; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java index a3298565..b5be52c3 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/GetConfigRequest.java @@ -29,9 +29,9 @@ public class GetConfigRequest { - private List nameServerAddress; + private List registryAddressList; - private List runtimeAddress; + private List runtimeAddressList; - private List brokerAddress; + private List nameServerAddressList; } diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java index 54ba5870..0f938ffc 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java @@ -23,7 +23,7 @@ @Data public class GetOffsetRequest { - private String bootStrapServers; + private String bootstrapServers; private String groupName; } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/spring/support/FunctionManager.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/spring/support/FunctionManager.java index a0a61301..41eb197e 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/spring/support/FunctionManager.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/spring/support/FunctionManager.java @@ -43,6 +43,6 @@ public void initFunctionManager() { healthService = new HealthService(); CheckResultCache checkResultCache = new CheckResultCache(); healthService.createExecutor(healthDataService, checkResultCache); - healthService.startScheduledExecution(5, 5); + healthService.startScheduledExecution(120, 60); } } diff --git a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java index d243fa78..7d9008f8 100644 --- a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java +++ b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/function/SDK/SDKManagerTest.java @@ -19,8 +19,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNotNull; - import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRedisConfig; import org.junit.jupiter.api.BeforeEach;