You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by xi...@apache.org on 2025/05/12 13:03:04 UTC
(eventmesh-dashboard) branch main updated: Implemented all project APIs, the main workflow, and partial features (#199)
This is an automated email from the ASF dual-hosted git repository.
xiatian pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-dashboard.git
The following commit(s) were added to refs/heads/main by this push:
new b7fcca7 Implemented all project APIs, the main workflow, and partial features (#199)
b7fcca7 is described below
commit b7fcca7e9dad3bdab3e01146e8723b6a0b696c72
Author: githublaohu <23...@qq.com>
AuthorDate: Mon May 12 21:02:59 2025 +0800
Implemented all project APIs, the main workflow, and partial features (#199)
* fix(*): 1. 合并代码, 2. 处理格式问题
* fix(*):1. 提升插件版本 2. 添加协议头
---------
Co-authored-by: jie <ji...@apache.org>
---
README.zh-CN.md | 11 +-
eventmesh-dashboard-common/pom.xml | 16 +-
.../common/annotation/RemotingServiceMapper.java | 14 +-
.../annotation/RemotingServiceMethodMapper.java | 19 +-
.../dashboard/common/constant/ApiPrefix.java | 2 +
.../dashboard/common/constant/ConfigConst.java | 40 --
.../dashboard/common/constant/NacosConst.java | 2 +
.../common/constant/StoreTypeConstant.java | 2 +
.../constant/health/HealthCheckTypeConstant.java | 2 +
.../common/constant/health/HealthConstant.java | 1 +
.../eventmesh/dashboard/common/dto/Result.java | 140 -------
.../dashboard/common/enums/BusinessType.java | 2 +
.../{RemotingType.java => ClusterFramework.java} | 48 ++-
.../{RemotingType.java => ClusterOwnType.java} | 18 +-
.../common/enums/ClusterSyncMetadataEnum.java | 113 ++++++
.../common/enums/ClusterTrusteeshipType.java | 115 +++++-
.../dashboard/common/enums/ClusterType.java | 292 +++++++++++++-
.../dashboard/common/enums/DeployStatusType.java | 107 +++++
.../common/enums/KubernetesPodStatus.java | 1 +
.../dashboard/common/enums/MetadataType.java | 74 ++++
.../dashboard/common/enums/OperationRange.java | 100 +++++
.../dashboard/common/enums/RecordStatus.java | 1 +
.../dashboard/common/enums/RemotingType.java | 34 +-
...RemotingType.java => ReplicationDimension.java} | 22 +-
.../{RemotingType.java => ReplicationType.java} | 29 +-
.../dashboard/common/enums/ResetOffsetMode.java | 22 +
.../eventmesh/dashboard/common/enums/Status.java | 91 -----
.../dashboard/common/enums/StoreType.java | 2 +
...sterTrusteeshipType.java => SyncErrorType.java} | 12 +-
.../common/enums/health/HealthCheckStatus.java | 26 +-
...althCheckType.java => HealthCheckTypeEnum.java} | 18 +-
.../dashboard/common/exception/BaseException.java | 54 ---
.../common/exception/EventMeshAdminException.java | 40 --
.../dashboard/common/exception/MetaException.java | 44 --
.../common/model/ClusterSyncMetadata.java | 71 ++++
.../dashboard/common/model/ConnectionInfo.java | 1 +
.../{ConnectionInfo.java => ConvertMetaData.java} | 11 +-
...ionInfo.java => DatabaseAndMetadataMapper.java} | 19 +-
...onInfo.java => MetadataSyncResultMetadata.java} | 22 +-
.../dashboard/common/model/PortHandler.java | 12 +-
.../dashboard/common/model/SubscriptionInfo.java | 2 +
.../BaseClusterIdBase.java} | 39 +-
.../BaseOrganizationBase.java} | 58 +--
.../base/BaseRuntimeIdBase.java} | 19 +-
.../BaseSyncBase.java} | 49 ++-
.../common/model/metadata/AclMetadata.java | 17 +-
.../common/model/metadata/ClientMetadata.java | 10 +-
.../common/model/metadata/ClusterMetadata.java | 16 +-
.../metadata/ClusterRelationshipMetadata.java | 11 +-
.../common/model/metadata/ConfigMetadata.java | 15 +-
.../common/model/metadata/ConnectionMetadata.java | 10 +-
.../common/model/metadata/ConnectorMetadata.java | 9 +-
...oupMetadata.java => ConsumeOffsetMetadata.java} | 16 +-
.../common/model/metadata/GroupMetadata.java | 11 +-
.../model/metadata/InstanceUserMetadata.java | 7 +-
.../common/model/metadata/MetadataConfig.java | 48 ---
.../{GroupMetadata.java => QueueMetadata.java} | 22 +-
.../common/model/metadata/RegistryMetadata.java | 14 +-
.../common/model/metadata/RuntimeMetadata.java | 27 +-
.../common/model/metadata/TopicMetadata.java | 21 +-
...GroupMetadata.java => TopicOffsetMetadata.java} | 19 +-
...balRequest.java => AbstractGlobal2Request.java} | 9 +-
.../common/model/remoting/BaseGlobalResult.java | 1 +
.../{GlobalRequest.java => Global2Request.java} | 11 +-
.../common/model/remoting/GlobalResult.java | 1 +
.../common/model/remoting/RemotingAction.java | 1 +
...{GlobalRequest.java => RemotingActionType.java} | 15 +-
.../common/model/remoting/RemotingOperate.java | 1 +
.../model/remoting/acl/CreateAclRequest.java | 1 +
.../model/remoting/acl/CreateAclResponse.java | 1 +
.../common/model/remoting/acl/CreateAclResult.java | 1 +
.../model/remoting/acl/DeleteAclRequest.java | 1 +
.../model/remoting/acl/DeleteAclResponse.java | 1 +
.../common/model/remoting/acl/DeleteAclResult.java | 1 +
.../{GetAclsRequest.java => GetAcls2Request.java} | 5 +-
.../common/model/remoting/acl/GetAclsResponse.java | 1 +
.../common/model/remoting/acl/GetAclsResult.java | 1 +
.../model/remoting/client/GetClientRequest.java | 1 +
.../model/remoting/client/GetClientResponse.java | 1 +
.../model/remoting/client/GetClientResult.java | 1 +
.../model/remoting/config/AddConfigRequest.java | 1 +
.../model/remoting/config/AddConfigResponse.java | 1 +
.../model/remoting/config/AddConfigResult.java | 1 +
.../common/model/remoting/config/ConfigType.java | 4 +
.../model/remoting/config/DeleteConfigRequest.java | 1 +
.../remoting/config/DeleteConfigResponse.java | 1 +
.../model/remoting/config/DeleteConfigResult.java | 1 +
.../model/remoting/config/GetConfigRequest.java | 1 +
.../model/remoting/config/GetConfigResponse.java | 1 +
.../model/remoting/config/GetConfigResult.java | 1 +
.../model/remoting/config/UpdateConfigRequest.java | 1 +
.../remoting/config/UpdateConfigResponse.java | 1 +
.../model/remoting/config/UpdateConfigResult.java | 1 +
.../remoting/connector/CreateConnectorRequest.java | 1 +
.../connector/CreateConnectorResponse.java | 1 +
.../remoting/connector/CreateConnectorResult.java | 1 +
.../remoting/connector/GetConnectorRequest.java | 1 +
.../remoting/connector/GetConnectorResponse.java | 1 +
.../remoting/connector/GetConnectorResult.java | 1 +
.../model/remoting/group/GetGroupResult.java | 3 +
.../model/remoting/group/GetGroupsRequest.java | 1 +
.../model/remoting/group/GetGroupsResponse.java | 1 +
.../model/remoting/offset/GetOffsetRequest.java | 1 +
.../model/remoting/offset/GetOffsetResponse.java | 1 +
.../model/remoting/offset/GetOffsetResult.java | 1 +
.../model/remoting/offset/ResetOffsetRequest.java | 6 +-
.../model/remoting/offset/ResetOffsetResponse.java | 1 +
.../model/remoting/offset/ResetOffsetResult.java | 1 +
...RuntimeRequest.java => GetRuntime2Request.java} | 7 +-
.../model/remoting/runtime/GetRuntimeResponse.java | 1 +
.../model/remoting/runtime/GetRuntimeResult.java | 3 +
.../subscription/GetSubscriptionRequest.java | 1 +
.../subscription/GetSubscriptionResponse.java | 1 +
.../subscription/GetSubscriptionResult.java | 1 +
...eTopicRequest.java => CreateTopic2Request.java} | 14 +-
.../model/remoting/topic/CreateTopicResponse.java | 1 +
.../model/remoting/topic/CreateTopicResult.java | 1 +
.../model/remoting/topic/DeleteTopicRequest.java | 1 +
.../model/remoting/topic/DeleteTopicResponse.java | 1 +
.../model/remoting/topic/DeleteTopicResult.java | 1 +
...etTopicsRequest.java => GetTopics2Request.java} | 11 +-
.../model/remoting/topic/GetTopicsResponse.java | 1 +
.../model/remoting/topic/GetTopicsResult.java | 1 +
.../model/remoting/user/CreateUserRequest.java | 1 +
.../model/remoting/user/CreateUserResponse.java | 1 +
.../model/remoting/user/CreateUserResult.java | 1 +
.../model/remoting/user/DeleteUserResponse.java | 1 +
.../model/remoting/user/DeleteUserResult.java | 1 +
.../model/remoting/user/DeleterUserRequest.java | 1 +
.../common/model/remoting/user/GetUserRequest.java | 1 +
.../model/remoting/user/GetUserResponse.java | 1 +
.../common/model/remoting/user/GetUserResult.java | 1 +
.../common/port/AbstractPortValidate.java | 33 +-
.../dashboard/common/port/NotPortValidate.java | 34 +-
.../SubscriptionInfo.java => port/PortRule.java} | 19 +-
.../PortValidate.java} | 13 +-
.../dashboard/common/util/ClasspathScanner.java | 136 +++++++
.../dashboard/common/util/ExceptionUtil.java | 3 +
.../common/utils/ClusterTypeRelationship.java | 66 +++
eventmesh-dashboard-console/pom.xml | 49 ++-
.../console/EventMeshDashboardApplication.java | 3 +-
.../dashboard/console/annotation/EmLog.java | 1 +
.../console/config/FunctionManagerConfigs.java | 1 +
.../dashboard/console/config/SpringDocConfig.java | 1 +
.../console/controller/ClusterAbitityService.java | 68 ++++
.../console/controller/ConnectionController.java | 31 +-
.../console/controller/MetricsController.java | 3 +-
.../console/controller/SubscriptionController.java | 71 ----
.../console/controller/cluster/AclController.java | 1 +
.../controller/cluster/ClientDataController.java | 10 +-
.../controller/cluster/ClusterController.java | 95 +++--
.../cluster/ClusterRelationshipController.java | 6 +-
...ctionController.java => DetailsController.java} | 36 +-
.../console/controller/cluster/HomeController.java | 94 +++++
.../controller/cluster/InstanceUserController.java | 66 ---
.../cluster/NetConnectionController.java | 1 +
.../controller/cluster/RuntimeController.java | 51 +--
.../CaseController.java} | 42 +-
.../controller/deploy/ClusterCycleController.java | 192 +++++++++
.../controller/deploy/CreateCycleService.java | 272 +++++++++++++
.../ResourcesConfigController.java} | 28 +-
.../create/CreateClusterByDeployScriptHandler.java | 144 +++++++
.../create/CreateRuntimeByDeployScriptHandler.java | 97 +++++
.../dashboard/console/controller/deploy/design.md | 157 ++++++++
.../controller/deploy/handler/UpdateHandler.java | 12 +-
.../controller/deploy/pause/PauseCluster.java | 110 +++++
.../controller/deploy/pause/PauseRuntime.java | 53 +++
.../deploy/relationship/RelationshipHandler.java | 54 +++
.../deploy/relationship/UnRelationshipHandler.java | 45 +++
.../deploy/uninstall/UninstallClusterHandler.java} | 18 +-
.../deploy/uninstall/UninstallRuntimeHandler.java | 23 +-
.../controller/function/ConfigController.java | 21 +-
.../controller/function/HealthController.java | 11 +-
.../console/controller/function/LogController.java | 10 +-
.../controller/function/OverviewController.java | 6 +-
.../controller/message/GroupController.java | 7 +-
.../message/GroupRelationshipController.java | 1 +
.../message/OffsetOperateController.java | 18 +-
.../controller/message/TopicController.java | 117 +++++-
.../ClusterAndRuntimeDomain.java} | 20 +-
.../Impl/ClusterAndRuntimeDomainImpl.java} | 20 +-
.../console/domain/OperationRangeDomain.java | 146 +++++++
.../domain/metadata/ClusterMetadataDomain.java | 447 +++++++++++++++++++++
.../domain/metadata/ClusterOperationHandler.java | 17 +-
.../metadata/MetadataAllDO.java} | 28 +-
.../dashboard/console/entity/BaseEntity.java | 15 +-
.../console/entity/CreateConnectionEntity.java | 33 --
.../dashboard/console/entity/DefaultConfigKey.java | 6 +
.../dashboard/console/entity/StoreEntity.java | 6 +-
.../BaseClusterIdEntity.java} | 15 +-
.../console/entity/base/BaseIdEntity.java | 55 +++
.../base/BaseOrganizationEntity.java} | 13 +-
.../console/entity/base/BaseRuntimeIdEntity.java | 9 +-
.../console/entity/base/BaseSyncEntity.java | 81 ++++
.../dashboard/console/entity/cases/CaseEntity.java | 26 +-
.../cases/DeployScriptEntity.java} | 26 +-
.../cases/PortEntity.java} | 17 +-
.../cases/ResouceEntity.java} | 14 +-
.../cases/ResourcesConfigEntity.java} | 17 +-
.../console/entity/cluster/AclEntity.java | 1 +
.../console/entity/cluster/ClientEntity.java | 24 +-
.../cluster/ClusterAndRelationshipEntity.java | 5 +-
.../console/entity/cluster/ClusterEntity.java | 31 +-
.../entity/cluster/ClusterRelationshipEntity.java | 18 +-
.../console/entity/cluster/ConnectionEntity.java | 15 +-
.../console/entity/cluster/InstanceUserEntity.java | 9 +-
.../entity/cluster/NetConnectionEntity.java | 6 +-
.../console/entity/cluster/RuntimeEntity.java | 26 +-
.../console/entity/connector/ConnectorEntity.java | 19 +-
.../console/entity/function/ConfigEntity.java | 17 +-
.../function/ConfigGatherEntity.java} | 12 +-
.../entity/function/HealthCheckResultEntity.java | 34 +-
.../console/entity/function/LogEntity.java | 11 +-
.../MetadataSyncResultEntity.java} | 30 +-
...pMemberEntity.java => ConsumeOffsetEntity.java} | 19 +-
.../console/entity/message/GroupEntity.java | 15 +-
...upMemberEntity.java => SubscriptionEntity.java} | 14 +-
.../console/entity/message/TopicEntity.java | 41 +-
...oupMemberEntity.java => TopicOffsetEntity.java} | 16 +-
.../console/exception/GlobalExceptionHandler.java | 63 ---
.../console/function/health/CheckResultCache.java | 12 +-
.../console/function/health/Health2Service.java | 272 +++++++++++++
.../console/function/health/HealthExecutor.java | 144 -------
.../console/function/health/HealthService.java | 291 --------------
.../health/annotation/HealthCheckType.java | 18 +-
.../health/callback/HealthCheckCallback.java | 5 +-
.../health/check/AbstractHealthCheckService.java | 45 ++-
.../check/AbstractTopicHealthCheckService.java | 64 +++
...qConfig.java => ClusterHealthCheckService.java} | 26 +-
.../function/health/check/HealthCheckService.java | 14 +-
.../check/config/HealthCheckObjectConfig.java | 71 ----
.../HealthRegister.java} | 20 +-
.../jvm/JVMCapCheck.java} | 30 +-
.../jvm/JVMCapTopicCheck.java} | 30 +-
.../jvm/JVMCheck.java} | 33 +-
.../jvm/JVMTopicCheck.java} | 33 +-
.../health/check/impl/meta/NacosConfigCheck.java | 56 +--
.../check/impl/meta/NacosNamingServiceCheck.java | 49 +--
.../health/check/impl/storage/RedisCheck.java | 79 +---
.../RocketMQClusterHealthCheckService.java | 218 ++++++++++
.../storage/rocketmq4/Rocketmq4BrokerCheck.java | 76 +---
.../rocketmq4/Rocketmq4NameServerCheck.java | 79 +---
.../storage/rocketmq4/Rocketmq4TopicCheck.java | 16 +-
.../dashboard/console/function/health/design.md | 19 +
.../function/metadata/MetadataServiceWrapper.java | 57 ---
.../metadata/handler/MetadataHandlerWrapper.java | 56 ---
.../handler/db/ClusterMetadataHandlerToDbImpl.java | 62 ---
.../handler/db/ConfigMetadataHandlerToDbImpl.java | 68 ----
.../handler/db/GroupMetadataHandlerToDbImpl.java | 63 ---
.../handler/db/RuntimeMetadataHandlerToDbImpl.java | 103 -----
.../handler/db/TopicMetadataHandlerToDbImpl.java | 75 ----
.../syncservice/SyncDataServiceWrapper.java | 59 ---
.../eventmesh/dashboard/console/log/OprLog.java | 15 +-
.../SyncDataHandlerMapper.java} | 18 +-
.../console/mapper/cluster/AclMapper.java | 25 +-
.../console/mapper/cluster/ClientMapper.java | 78 ++--
.../console/mapper/cluster/ClusterMapper.java | 120 ++++--
.../mapper/cluster/ClusterRelationshipMapper.java | 79 +++-
.../console/mapper/cluster/ConnectionMapper.java | 30 +-
.../console/mapper/cluster/InstanceUserMapper.java | 56 ---
.../mapper/cluster/NetConnectionMapper.java | 4 +-
.../console/mapper/cluster/RuntimeMapper.java | 175 ++++++--
.../console/mapper/connector/ConnectorMapper.java | 50 +--
.../console/mapper/deploy/DeployScriptMapper.java | 62 +++
.../PortMapper.java} | 27 +-
.../console/mapper/function/ConfigMapper.java | 73 ++--
.../mapper/function/HealthCheckResultMapper.java | 63 ++-
.../console/mapper/function/OprLogMapper.java | 22 +-
.../message/ConsumerOffsetMapper.java} | 24 +-
.../{OprGroupMapper.java => GroupMapper.java} | 45 ++-
.../mapper/message/OprGroupMemberMapper.java | 101 ++---
.../console/mapper/message/TopicMapper.java | 70 +++-
.../TopicOffsetMapper.java} | 18 +-
.../console/mapper/storage/StoreMapper.java | 76 ----
.../cluster/ClientDataControllerMapper.java | 5 +-
.../mapstruct/cluster/ClusterControllerMapper.java | 14 +-
.../mapstruct/cluster/GroupControllerMapper.java | 5 +-
.../mapstruct/cluster/RuntimeControllerMapper.java | 5 +-
.../connection/ConnectionControllerMapper.java | 37 --
.../CaseControllerMapper.java} | 14 +-
.../deploy/ClusterCycleControllerMapper.java | 50 +++
.../ResourceConfigControllerMapper.java} | 14 +-
.../mapstruct/message/TopicControllerMapper.java | 4 +-
.../dashboard/console/modle/ClusterIdDTO.java | 7 +-
.../QueryRuntimeByClusterIdAndClusterTypeDO.java} | 15 +-
.../QueryListByClusterIdAndTypeDO.java | 22 +-
.../runtime/QueryRuntimeByBigExpandClusterDO.java} | 19 +-
.../eventmesh/dashboard/console/modle/IdDTO.java | 1 +
.../dashboard/console/modle/OperateDTO.java | 23 +-
.../modle/{IdDTO.java => OrganizationIdDTO.java} | 5 +-
.../console/modle/cluster/ClusterHomeListVO.java | 1 +
.../cluster/CreateClusterByCompleteDataDTO.java | 23 +-
...rDTO.java => CreateClusterBySimpleDataDTO.java} | 24 +-
.../{ClusterHomeListVO.java => VerifyNameDTO.java} | 13 +-
...terIdDTO.java => QueryClientByUserFormDTO.java} | 8 +-
.../modle/cluster/cluster/ClusterDetailsVO.java | 7 +-
.../QueryClusterByOrganizationIdAndTypeDTO.java | 23 +-
...QueryRelationClusterByClusterIdAndTypeDTO.java} | 15 +-
...{CrateRuntimeDTO.java => CreateRuntimeDTO.java} | 11 +-
.../runtime/QueryRuntimeListByClusterIdDTO.java | 4 +
.../CreateRuntimeDTO.java} | 9 +-
.../console/modle/config/ChangeConfigEntity.java | 30 --
.../deploy/BaseConifgDO.java} | 11 +-
.../console/modle/deploy/BaseDeployDO.java | 21 +-
.../ClusterAllMetadataDO.java} | 17 +-
.../DeployClusterDO.java} | 16 +-
.../deploy/DeployFullDO.java} | 13 +-
.../DeployGroupDO.java} | 11 +-
.../DeployMetadataDO.java} | 17 +-
.../console/modle/deploy/DeployRuntimeDO.java | 14 +-
.../DeployTopicDO.java} | 16 +-
.../GetPortsDO.java} | 12 +-
.../cases/QueryCaseByObjectTypeDTO.java} | 10 +-
.../create/CreateClusterByDeployScriptDO.java} | 19 +-
.../deploy/create/CreateClusterByEventMesh.java | 20 +-
.../create/CreateEventMeshClusterByOnlyScript.java | 24 +-
.../create/CreateRuntimeByDeployScriptDO.java | 22 +-
.../create/CreateRuntimeByDeployScriptDTO.java | 21 +-
.../create/CreateRuntimeByOnlyDataDO.java} | 31 +-
.../resouce/QueryResourceByObjectTypeDTO.java | 20 +-
.../domain/ClusterEntityDO.java} | 14 +-
.../domain/RuntimeEntityDO.java} | 15 +-
.../{DetailConfigsVO.java => ChangeConfigDTO.java} | 12 +-
.../console/modle/dto/config/DetailConfigsVO.java | 5 +
.../modle/dto/config/GetConfigsListDTO.java | 5 +
.../console/modle/dto/config/UpdateConfigDTO.java | 19 +-
.../modle/{ => dto}/config/UpdateConfigsLog.java | 7 +-
.../dto/connection/AddConnectionDTO.java} | 9 +-
.../dto/connection/AddConnectorConfigDTO.java} | 9 +-
.../modle/dto/connection/CreateConnectionDTO.java | 12 +-
.../modle/dto/connection/GetConnectionListDTO.java | 5 +
.../console/modle/dto/log/GetLogListDTO.java | 5 +
.../console/modle/dto/meta/NewMetaDTO.java | 5 +
.../modle/dto/operation/OperationBaseDTO.java | 36 +-
.../console/modle/dto/topic/CreateTopicDTO.java | 9 +-
.../console/modle/dto/topic/GetTopicListDTO.java | 7 +-
.../console/modle/function/OverviewDTO.java | 3 +
.../console/modle/function/OverviewType.java | 1 +
.../offset/QueryOffsetByMessageMetadataDTO.java | 3 +
.../modle/message/offset/ResetOffsetDTO.java | 19 +-
.../RuntimeIdDTO.java} | 11 +-
.../modle/vo/cluster/GetClusterBaseMessageVO.java | 5 +
.../console/modle/vo/cluster/ResourceNumVO.java | 5 +
.../modle/vo/connection/ConnectionListVO.java | 5 +
.../modle/vo/health/InstanceLiveProportionVo.java | 5 +
.../console/modle/vo/topic/TopicDetailGroupVO.java | 5 +
.../console/service/DataServiceWrapper.java | 77 ----
.../dashboard/console/service/OverviewService.java | 5 +-
.../console/service/cluster/AclService.java | 1 +
.../console/service/cluster/ClientDataService.java | 12 +-
.../cluster/ClusterRelationshipService.java | 8 +-
.../console/service/cluster/ClusterService.java | 32 +-
.../service/cluster/ConnectionDataService.java | 17 +-
.../console/service/cluster/RuntimeService.java | 23 +-
.../service/cluster/impl/AclServiceImpl.java | 1 +
.../cluster/impl/ClientDataServiceImpl.java | 23 +-
.../impl/ClusterRelationshipServiceImpl.java | 19 +-
.../service/cluster/impl/ClusterServiceImpl.java | 115 +++++-
.../impl/ConnectionDataServiceDatabaseImpl.java | 231 -----------
.../cluster/impl/InstanceUserServiceImpl.java | 68 ----
.../service/cluster/impl/RuntimeServiceImpl.java | 102 ++++-
.../service/connector/ConnectorDataService.java | 3 +-
.../connector/Impl/ConnectorDataServiceImpl.java | 5 +-
.../connector/Impl/ResourcesConfigServiceImpl.java | 34 +-
...ataService.java => ResourcesConfigService.java} | 19 +-
.../DeployScriptService.java} | 25 +-
.../console/service/deploy/PortService.java | 13 +-
.../deploy/impl/DeployScriptServiceImpl.java | 61 +++
.../service/deploy/impl/PortServiceImpl.java | 56 +++
.../console/service/function/ConfigService.java | 19 +-
.../service/function/HealthDataService.java | 11 +-
.../function/HealthDataServiceMemoryStorage.java | 2 +
.../service/function/Impl/ConfigServiceImpl.java | 107 +++--
.../Impl/HealthDataServiceDatabaseImpl.java | 45 +--
.../service/function/Impl/LogServiceImpl.java | 16 +-
...mpl.java => MetadataSyncResultServiceImpl.java} | 31 +-
.../console/service/function/LogService.java | 7 +-
...Service.java => MetadataSyncResultService.java} | 19 +-
.../service/message/GroupMemberService.java | 21 +-
.../console/service/message/GroupService.java | 18 +-
.../console/service/message/TopicService.java | 17 +-
.../message/impl/GroupMemberServiceImp.java | 43 +-
.../service/message/impl/GroupServiceImpl.java | 55 +--
.../service/message/impl/TopicServiceImpl.java | 71 ++--
.../metadata/AbstractDBDataMetadataHandler.java | 124 ++++++
.../ClientDataMetadataHandler.java} | 25 +-
.../metadata/ConfigDataMetadataHandler.java | 22 +-
.../ConsumeOffsetDataMetadataHandler.java} | 24 +-
.../service/metadata/GroupDataMetadataHandler.java | 23 +-
.../NetConnectionDataMetadataHandler.java} | 24 +-
.../RuntimeDataMetadataHandler.java} | 36 +-
.../TopicDataMetadataHandler.java} | 30 +-
.../TopicOffsetDataMetadataHandler.java} | 24 +-
.../service/store/Impl/StoreServiceImpl.java | 89 ----
.../console/service/store/StoreService.java | 46 ---
.../console/spring/support/DefaultDataHandler.java | 81 ++++
.../console/spring/support/FunctionManage.java | 178 ++++++++
.../console/spring/support/FunctionManager.java | 54 ---
.../spring/support/FunctionManagerLoader.java | 72 ----
.../spring/support/FunctionManagerProperties.java | 38 --
.../spring/support/RuntimeDeployService.java | 422 +++++++++++++++++++
.../support/metadata/DatabaseAndMetadataType.java | 80 ++++
.../metadata/DefaultMetadataSyncResultHandler.java | 205 ++++++++++
.../metadata/convert/ClientConvertMetaData.java} | 18 +-
.../metadata/convert/ClusterConvertMetaData.java} | 16 +-
.../metadata/convert/ConfigConvertMetaData.java} | 16 +-
.../convert/ConsumeOffsetConvertMetaData.java} | 17 +-
.../metadata/convert/GroupConvertMetaData.java} | 22 +-
.../metadata/convert/RuntimeConvertMetaData.java} | 25 +-
.../metadata/convert/TopicConvertMetaData.java} | 18 +-
.../convert/TopicOffsetConvertMetaData.java} | 19 +-
.../support/register/AbstractBuildMetadata.java | 74 ++++
.../support/register/BuildMetadata.java} | 31 +-
.../support/register/BuildMetadataManage.java | 81 ++++
.../spring/support/register/ScriptBuildData.java | 58 +++
.../register/meta/AbstractMetaBuildMetadata.java | 19 +-
.../meta/RocketNameServiceBuildMetadata.java | 64 +++
.../register/meta/ZookeeperBuildMetadata.java | 30 +-
.../runtime/AbstractRuntimeBuildMetadata.java | 20 +-
.../runtime/EventMethRuntimeBuildMetadata.java | 78 ++++
.../register/runtime/RocketMQBuildMetadata.java | 73 ++++
.../dashboard/console/utils/RuntimeUtils.java | 23 +-
.../src/main/resources/RENAME.md | 38 ++
.../src/main/resources/application-dev.yml | 19 +-
.../src/main/resources/eventmesh-dashboard.jmx | 271 +++++++++++++
.../src/main/resources/eventmesh-dashboard.sql | 336 +++++++++-------
.../src/main/resources/logback.xml | 4 +-
.../console/EventMeshDashboardApplicationTest.java | 1 +
.../console/databuild/BuildFullMetadata.java} | 29 +-
.../console/databuild/BuildFullSceneData.java | 395 ++++++++++++++++++
.../function/health/Health2ServiceTest.java | 80 ++++
.../function/health/HealthExecutorTest.java | 186 ---------
.../console/function/health/HealthServiceTest.java | 133 ------
.../check/impl/meta/NacosConfigCheckTest.java | 14 +-
.../impl/meta/NacosNamingServiceCheckTest.java | 18 +-
.../health/check/impl/storage/RedisCheckTest.java | 83 ----
.../rocketmq4/Rocketmq4BrokerCheckTest.java | 9 +-
.../rocketmq4/Rocketmq4NameserverCheckTest.java | 9 +-
.../storage/rocketmq4/Rocketmq4TopicCheckTest.java | 8 +-
.../db/ConfigMetadataHandlerToDbImplTest.java | 54 ---
.../db/ConnectionMetadataHandlerToDbImplTest.java | 121 ------
.../db/GroupMetadataHandlerToDbImplTest.java | 62 ---
.../db/RuntimeMetadataHandlerToDbImplTest.java | 122 ------
.../db/TopicMetadataHandlerToDbImplTest.java | 71 ----
.../health/HealthServiceIntegrateTest.java | 75 ----
.../dashboard/console/linkage/log/TestOprLog.java | 9 +-
.../mapper/cluster/ClusterDataMapperTest.java} | 16 +-
.../mapper/cluster/ClusterEntityMapperTest.java | 133 ++++++
.../cluster/ClusterRelationshipMapperTest.java | 152 +++++++
.../mapper/cluster/RuntimeEntityMapperTest.java | 194 +++++++++
.../mapper/message/TopicEntityMapperTest.java | 106 +++++
.../model/domain/ClusterMetadataDomainTest.java | 218 ++++++++++
.../cluster/impl/ClusterEntityServiceImplTest.java | 102 +++++
.../ConnectionDataServiceDatabaseImplTest.java | 19 +-
.../spring/support/DefaultDataHandlerTest.java} | 17 +-
.../spring/support/FunctionManagerTest.java | 80 ----
.../spring/support/RuntimeDeployServiceTest.java | 171 ++++++++
.../convert/RuntimeConvertMetaDataTest.java | 27 +-
.../src/test/resources/acl-test.sql | 1 +
.../src/test/resources/application-test.yml | 25 +-
.../src/test/resources/client-test.sql | 1 +
.../src/test/resources/connection-test.sql | 1 +
.../src/test/resources/connector-test.sql | 1 +
.../src/test/resources/health-test.sql | 1 +
.../src/test/resources/instance-user-test.sql | 1 +
.../kubernetes/EventMesh-runtime-refer.yaml | 80 ++++
.../resources/kubernetes/EventMesh-runtime.yaml | 77 ++++
.../kubernetes/RocketMQ-broker-refer.yaml | 57 +++
.../test/resources/kubernetes/RocketMQ-broker.yaml | 56 +++
.../RocketMQ-nameservice-refer.yaml} | 53 +--
.../RocketMQ-nameservice.yaml} | 53 +--
.../src/test/resources/meta-test.sql | 1 +
.../src/test/resources/runtime-test.sql | 1 +
.../src/test/resources/store-test.sql | 1 +
.../src/test/resources/topic-test.sql | 1 +
.../src/test/resources/use-test-schema.sql | 1 +
eventmesh-dashboard-core/pom.xml | 14 +-
.../dashboard/core/cluster/BaseDataDO.java | 22 +-
.../cluster/{ClusterDO.java => ClusterBaseDO.java} | 17 +-
.../dashboard/core/cluster/ClusterDO.java | 13 +-
.../dashboard/core/cluster/ClusterDoCache.java | 1 +
.../eventmesh/dashboard/core/cluster/ColonyDO.java | 161 +++++++-
.../dashboard/core/cluster/MetadataBaseDO.java | 15 +-
.../dashboard/core/cluster/RuntimeBaseDO.java | 21 +-
.../cluster/{ClusterDO.java => RuntimeDO.java} | 13 +-
.../dashboard/core/config/AdminProperties.java | 92 -----
.../{SDKOperation.java => AbstractClientInfo.java} | 38 +-
.../core/function/SDK/AbstractSDKOperation.java | 17 +-
.../SDK/ClientWrapper.java} | 14 +-
.../dashboard/core/function/SDK/ConfigManage.java | 56 +++
.../dashboard/core/function/SDK/ProtocolType.java | 12 +-
.../dashboard/core/function/SDK/SDKManage.java | 224 +++++++++++
.../dashboard/core/function/SDK/SDKManager.java | 164 --------
.../dashboard/core/function/SDK/SDKMetadata.java | 37 +-
.../dashboard/core/function/SDK/SDKOperation.java | 9 +-
.../dashboard/core/function/SDK/SDKTypeEnum.java | 43 +-
...disConfig.java => AbstractCreateSDKConfig.java} | 43 +-
.../SDK/config/AbstractMultiCreateSDKConfig.java | 100 +++++
.../SDK/config/AbstractSimpleCreateSDKConfig.java | 21 +-
.../core/function/SDK/config/CreateEtcdConfig.java | 18 +-
...reateSDKConfig.java => CreateJvmCapConfig.java} | 7 +-
.../core/function/SDK/config/CreateJvmConfig.java | 8 +-
...eateSDKConfig.java => CreateKafkaZkConfig.java} | 7 +-
...CreateSDKConfig.java => CreateKakfaConfig.java} | 11 +-
...eSDKConfig.java => CreateKubernetesConfig.java} | 7 +-
.../function/SDK/config/CreateNacosConfig.java | 25 +-
.../function/SDK/config/CreateRedisConfig.java | 20 +-
...ateSDKConfig.java => CreateRemotingConfig.java} | 7 +-
.../SDK/config/CreateRocketmqAdminSDKConfig.java | 14 +-
.../function/SDK/config/CreateRocketmqConfig.java | 1 +
.../config/CreateRocketmqConsumerSDKConfig.java | 23 +-
...ig.java => CreateRocketmqProduceSDKConfig.java} | 13 +-
.../function/SDK/config/CreateRuntimeConfig.java | 3 +-
.../core/function/SDK/config/CreateSDKConfig.java | 1 +
...teSDKConfig.java => CreateZookeeperConfig.java} | 7 +-
...RocketmqAdminSDKConfig.java => NetAddress.java} | 23 +-
...eateSDKConfig.java => NullCreateSDKConfig.java} | 16 +-
.../function/SDK/operation/EtcdSDKOperation.java | 41 +-
.../SDK/operation/NacosConfigSDKOperation.java | 64 ---
.../SDK/operation/NacosNamingSDKOperation.java | 65 ---
.../function/SDK/operation/NacosSDKOperation.java | 75 +++-
.../function/SDK/operation/RedisSDKOperation.java | 32 +-
.../JvmAdmin.java} | 30 +-
.../JvmCapAdmin.java} | 30 +-
.../KafkaAdminOperation.java} | 33 +-
.../operation/kafka/KafkaZkAdminOperation.java} | 28 +-
.../kubernetes/KubernetesClientOperation.java | 47 +++
.../operation/rocketmq/RocketMQAdminOperation.java | 31 +-
.../rocketmq/RocketMQProduceSDKOperation.java | 36 +-
.../rocketmq/RocketMQPushConsumerSDKOperation.java | 38 +-
.../rocketmq/RocketMQRemotingSDKOperation.java | 136 ++++++-
.../runtime/RuntimeGrpcConsumerSDKOperation.java | 27 +-
.../runtime/RuntimeGrpcProducerSDKOperation.java | 26 +-
.../runtime/RuntimeHttpConsumerSDKOperation.java | 22 +-
.../runtime/RuntimeHttpProducerSDKOperation.java | 24 +-
.../SDK/operation/runtime/RuntimeSDKOperation.java | 65 ++-
.../runtime/RuntimeTcpCloudEventSDKOperation.java | 36 +-
.../runtime/RuntimeTcpEventMeshSDKOperation.java | 35 +-
.../runtime/RuntimeTcpOpenMessageSDKOperation.java | 30 +-
.../ZookeeperAdmin.java} | 32 +-
.../SDK/util/RuntimeSDKOperationUtils.java | 1 +
.../core/function/SDK/wrapper/NacosSDKWrapper.java | 1 +
.../function/SDK/wrapper/RuntimeSDKWrapper.java | 38 +-
.../dashboard/core/gather/jmx/JmxConnector.java | 52 +++
.../dashboard/core/message/MessageManage.java | 112 ++++++
.../core/message/model/AbstractMessageDTO.java | 22 +-
.../dashboard/core/message/model/ConsumerDTO.java | 9 +-
.../dashboard/core/message/model/ProducerDTO.java | 7 +-
.../dashboard/core/message/model/SendTDO.java | 7 +-
.../operate/AbstractConsumerOperate.java} | 27 +-
.../operate/AbstractMessageOperate.java} | 25 +-
.../operate/AbstractProducerOperate.java} | 20 +-
.../core/message/operate/ConsumerOperate.java | 16 +-
.../core/message/operate/ProducerOperate.java | 10 +-
.../core/meta/connection/EtcdConnectionCore.java | 1 +
.../core/meta/connection/NacosConnectionCore.java | 1 +
.../core/meta/runtime/NacosRuntimeCore.java | 87 ----
.../meta/subscription/NacosSubscriptionCore.java | 191 ---------
.../core/metadata/DataMetadataHandler.java | 8 +-
.../core/metadata/FullMetadataHandler.java | 15 +-
.../core/metadata/GetMetadataHandler.java | 15 +-
.../dashboard/core/metadata/MetadataHandler.java | 84 +---
.../core/metadata/MetadataSyncManage.java | 279 +++++++++++++
.../core/metadata/MetadataSyncManager.java | 245 -----------
.../core/metadata/MetadataSyncWrapper.java | 176 ++++++++
.../core/metadata/SyncMetadataCreateFactory.java | 140 +++++++
...dataHandler.java => UpdateMetadataHandler.java} | 42 +-
.../metadata/cluster/AbstractMetadataHandler.java | 57 ---
.../cluster/AclSyncFromClusterService.java | 61 ---
.../cluster/ConfigSyncFromClusterService.java | 70 ----
.../cluster/GroupSyncFromClusterService.java | 65 ---
.../cluster/RuntimeSyncFromClusterService.java | 58 ---
.../difference/AbstractBothDifference.java | 64 +++
.../difference/AbstractBufferDifference.java | 51 +++
.../metadata/difference/AbstractDifference.java | 75 ++++
.../metadata/difference/BodyDataDifference.java | 50 +++
.../core/metadata/difference/BothDifference.java | 50 +++
.../core/metadata/difference/BufferDifference.java | 20 +-
.../core/metadata/difference/Difference.java | 9 +-
.../core/metadata/difference/NotDifference.java | 19 +-
.../core/metadata/request/RuntimeDataRequest.java | 7 +-
.../core/metadata/result/MetadataSyncResult.java | 32 +-
.../metadata/result/MetadataSyncResultHandler.java | 20 +-
.../core/remoting/AbstractRemotingService.java | 78 +---
.../dashboard/core/remoting/Remoting2Manage.java | 228 +++++++++++
.../dashboard/core/remoting/RemotingManager.java | 391 ------------------
.../core/remoting/RemotingProxyBatchException.java | 10 +-
.../core/remoting/RemotingResultType.java | 13 +-
.../remoting/jvm/AbstractJvmRemotingService.java | 23 +-
.../JvmAclRemotingService.java} | 10 +-
.../JvmClientRemotingService.java} | 8 +-
.../JvmConfigRemotingService.java} | 11 +-
.../JvmGroupRemotingService.java} | 14 +-
.../JvmOffsetRemotingService.java} | 8 +-
.../JvmSubscriptionRemotingService.java} | 7 +-
.../core/remoting/jvm/JvmTopicRemotingService.java | 35 +-
.../JvmUserRemotingService.java} | 6 +-
.../rocketmq/AbstractRocketMQRemotingService.java | 85 +---
.../rocketmq/RocketMQAclRemotingService.java | 5 +-
.../rocketmq/RocketMQClientRemotingService.java | 1 +
.../rocketmq/RocketMQConfigRemotingService.java | 5 +-
.../rocketmq/RocketMQGroupRemotingService.java | 8 +
.../rocketmq/RocketMQOffsetRemotingService.java | 1 +
.../RocketMQSubscriptionRemotingService.java | 1 +
.../rocketmq/RocketMQTopicRemotingService.java | 42 +-
.../rocketmq/RocketMQUserRemotingService.java | 1 +
.../dashboard/core/store/RocketmqTopicCore.java | 157 --------
.../dashboard/core/function/SDK/SDKManageTest.java | 65 +++
.../core/function/SDK/SDKManagerTest.java | 80 ----
.../dashboard/core/function/SDK/Test1.java} | 43 +-
.../SDK/operation/EtcdSDKCreateOperationTest.java | 57 ---
.../SDK/operation/NacosNamingSDKOperationTest.java | 55 ---
.../SDK/operation/RedisSDKOperationTest.java | 60 ---
.../RuntimeGrpcConsumerSDKOperationTest.java | 59 ---
.../RuntimeGrpcProducerSDKOperationTest.java | 59 ---
.../RuntimeHttpConsumerSDKOperationTest.java | 65 ---
.../RuntimeHttpProducerSDKOperationTest.java | 65 ---
.../SDK/operation/RuntimeSDKOperationTest.java | 76 ----
.../RuntimeTcpCloudEventSDKOperationTest.java | 74 ----
.../RuntimeTcpEventMeshSDKOperationTest.java | 74 ----
.../core/meta/runtime/NacosRuntimeCoreTest.java | 49 ---
.../core/metadata/MetadataSyncManagerTest.java | 140 +++----
.../core/metadata/MetadataSyncWrapperTest.java | 95 +++++
.../core/remoting/Remoting2ManageTest.java | 48 +++
.../core/remoting/RemotingManagerTest.java | 166 --------
eventmesh-dashboard-observe/pom.xml | 1 +
eventmesh-dashboard-service/pom.xml | 2 +-
.../dashboard/service/dto/RocketmqProperties.java | 2 +
.../dashboard/service/dto/TopicProperties.java | 2 +
.../dashboard/service/meta/ConnectionCore.java | 3 +-
.../dashboard/service/meta/SubscriptionCore.java | 35 --
.../operation/connector/ConnectorOptService.java | 2 +
.../operation/connector/RuntimeOptService.java | 2 +
.../service/remoting/AclRemotingService.java | 10 +-
.../service/remoting/ClientRemotingService.java | 5 +-
.../service/remoting/ConfigRemotingService.java | 10 +-
.../service/remoting/ConnectorRemotingService.java | 1 +
...vice.java => ConsumeOffsetRemotingService.java} | 11 +-
.../service/remoting/GroupRemotingService.java | 9 +
.../service/remoting/MetaRemotingService.java | 8 +-
.../service/remoting/OffsetRemotingService.java | 2 +
.../remoting/RemotingIntegrationService.java | 2 +
.../remoting/SubscriptionRemotingService.java | 4 +
.../remoting/TopicOffsetRemotingService.java | 17 +-
.../service/remoting/TopicRemotingService.java | 15 +-
.../service/remoting/UserRemotingService.java | 6 +
pom.xml | 15 +-
647 files changed, 14743 insertions(+), 10542 deletions(-)
diff --git a/README.zh-CN.md b/README.zh-CN.md
index cb9f70c..ccb82a8 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -94,4 +94,13 @@ docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboa
2. 配置协议头工具 license-eye。
1. 检查命令:license-eye header check
2. 使用命令:license-eye header fix
- 3. 下载地址: https://skywalking.apache.org/downloads/
\ No newline at end of file
+ 3. 下载地址: https://skywalking.apache.org/downloads/
+
+
+### 提交代码前
+在项目根目录执行下面命令
+```
+license-eye -v info -c .licenserc.yaml header check
+./mvnw -B package -DskipTests --file pom.xml
+./mvnw -B test --file pom.xml
+```
\ No newline at end of file
diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml
index 50890fe..806a289 100644
--- a/eventmesh-dashboard-common/pom.xml
+++ b/eventmesh-dashboard-common/pom.xml
@@ -30,20 +30,17 @@
<artifactId>eventmesh-dashboard-common</artifactId>
<properties>
- <java.version>1.8</java.version>
+ <java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
- <!-- TODO: common module should not contains spring framework, considering remove this dependency -->
- <!-- Spring Boot Starter -->
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- <scope>provided</scope>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>5.1.19.RELEASE</version>
</dependency>
-
<!-- Utility -->
<dependency>
<groupId>org.projectlombok</groupId>
@@ -54,6 +51,11 @@
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>4.4</version>
+ </dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
similarity index 78%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
index efae3a5..20a278b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
@@ -15,19 +15,23 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.annotation;
+package org.apache.eventmesh.dashboard.common.annotation;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+
+import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface EmLog {
+@Documented
+public @interface RemotingServiceMapper {
- String OprType() default "";
- String OprTarget() default "";
+ ClusterType clusterType();
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
similarity index 78%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
index efae3a5..fb619f6 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
@@ -15,19 +15,24 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.annotation;
+package org.apache.eventmesh.dashboard.common.annotation;
+
+import org.apache.eventmesh.dashboard.common.model.remoting.RemotingActionType;
+
+import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-@Retention(RetentionPolicy.RUNTIME)
+/**
+ *
+ */
@Target(ElementType.METHOD)
-public @interface EmLog {
-
- String OprType() default "";
-
- String OprTarget() default "";
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RemotingServiceMethodMapper {
+ RemotingActionType[] value();
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java
index df5f071..a25ee55 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java
@@ -15,8 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.constant;
+@Deprecated
public class ApiPrefix {
public static final String API_PREFIX = "/eventmesh-dashboard/";
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java
deleted file mode 100644
index f13a40e..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.constant;
-
-public class ConfigConst {
-
- // yml config
- public static final String ADMIN_PROPS_PREFIX = "eventmesh";
- public static final String META_TYPE_NACOS = "nacos";
- public static final String META_TYPE_ETCD = "etcd";
- public static final String STORE_TYPE_STANDALONE = "standalone";
- public static final String STORE_TYPE_ROCKETMQ = "rocketmq";
- public static final String STORE_TYPE_KAFKA = "kafka";
-
- // Open-API
- public static final String HTTP_PREFIX = "http://";
- public static final String HTTPS_PREFIX = "https://";
-
- // common
- /**
- * colon with space
- */
- public static final String COLON = ": ";
-
-}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java
index b23a8d3..592a7e9 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java
@@ -15,8 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.constant;
+@Deprecated
public class NacosConst {
public static final String LOGIN_API = "/nacos/v1/auth/login";
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java
index 665024a..455f121 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java
@@ -15,8 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.constant;
+@Deprecated
public class StoreTypeConstant {
public static final String STORE_TYPE_TYPE_UNKNOWN = "unknown";
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java
index 5252899..31f095a 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java
@@ -15,10 +15,12 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.constant.health;
import org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant;
+@Deprecated
public class HealthCheckTypeConstant {
public static final String HEALTH_CHECK_TYPE_UNKNOWN = "unknown";
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
index dd72488..b00ea3d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.constant.health;
public class HealthConstant {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java
deleted file mode 100644
index e34fd92..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.dto;
-
-import org.apache.eventmesh.dashboard.common.enums.Status;
-import org.apache.eventmesh.dashboard.common.exception.BaseException;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * A RESTful response DTO.
- */
-
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class Result<T> {
-
- private T data;
-
- private Integer pages;
-
- private StatusMessage message;
-
- public Result(StatusMessage statusMessage) {
- this.message = statusMessage;
- }
-
- public Result(T data, Integer pages) {
- this.data = data;
- this.pages = pages;
- }
-
- /**
- * The request is valid and the result is wrapped in {@link Result}.
- */
- public static <T> Result<T> success() {
- return new Result<>(new StatusMessage(Status.SUCCESS));
- }
-
- public static <T> Result<T> success(Result<T> result) {
- result.setMessage(new StatusMessage(Status.SUCCESS));
- return result;
- }
-
- public static <T> Result<T> success(T data) {
- return new Result<>(data, null, new StatusMessage(Status.SUCCESS));
- }
-
- /**
- * The request is valid and the result is returned in {@link ResponseEntity}. Logic issues should use 422 Unprocessable Entity instead of 200 OK.
- */
- public static <T> ResponseEntity<Result<T>> ok() {
- return ResponseEntity.ok(new Result<>(new StatusMessage(Status.SUCCESS)));
- }
-
- public static <T> ResponseEntity<Result<T>> ok(Result<T> result) {
- result.setMessage(new StatusMessage(Status.SUCCESS));
- return ResponseEntity.ok(result);
- }
-
- /**
- * The request is invalid.
- */
- public static <T> ResponseEntity<Result<T>> badRequest(String message) {
- return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new Result<>(new StatusMessage(message)));
- }
-
- /**
- * The request is valid but cannot be processed due to business logic issues.
- */
- public static <T> ResponseEntity<Result<T>> unprocessable(String message) {
- return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(new Result<>(new StatusMessage(message)));
- }
-
- /**
- * Uncaught exception happened in EventMeshAdmin application.
- */
- public static <T> ResponseEntity<Result<T>> internalError(String message) {
- return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new Result<>(new StatusMessage(message)));
- }
-
- /**
- * Upstream service unavailable such as Meta.
- */
- public static <T> ResponseEntity<Result<T>> badGateway(String message) {
- return ResponseEntity.status(HttpStatus.BAD_GATEWAY).body(new Result<>(new StatusMessage(message)));
- }
-
- @Data
- public static class StatusMessage {
-
- private String status;
-
- private String category;
-
- private String desc;
-
- public StatusMessage(BaseException e) {
- this.status = e.getStatus().name();
- this.category = e.getStatus().getCategory().name();
- this.desc = e.getMessage();
- }
-
- /**
- * Only recommended for returning successful results, the stack trace cannot be displayed when returning unsuccessful results.
- */
- public StatusMessage(Status status) {
- this.status = status.name();
- this.category = status.getCategory().name();
- this.desc = status.getDesc(); // no stack trace
- }
-
- public StatusMessage(String desc) {
- this.desc = desc;
- }
- }
-}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
index 41ca551..2b6bfaf 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
/**
@@ -23,6 +24,7 @@ package org.apache.eventmesh.dashboard.common.enums;
* sinkConnector:可选值(rocketmq,spring,pravega,wechat,openfunction,file,knative,pulsar,lark,slack,rabbitmq,redis,mongodb,dingtalk)
* sourceConnector:可选值(rocketmq,spring,pravega,openfunction,jdbc,file,http,wecom,knative,pulsar,prometheus,rabbitmq,redis,mongodb)',
*/
+@Deprecated
public enum BusinessType {
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
similarity index 55%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
index aa0ad0e..0de7ccb 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
@@ -15,22 +15,52 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
-public enum RemotingType {
+import java.util.Objects;
+
+public enum ClusterFramework {
NOT,
- META,
+ INDEPENDENCE,
+
+ /**
+ * AP 架构,的 meta 有控制行为,需要逐一通知
+ */
+ AP,
+
+ CP,
+
+ CAP,
+
+ MAIN_SLAVE,
+
+ PAXOS,
+
+ RAFT,
+
+ ZK,
+ ;
- STORAGE,
+ public boolean isAP() {
+ return Objects.equals(this, AP);
+ }
- EVENT_MESH_RUNTIME,
+ public boolean isCP() {
+ return Objects.equals(this, CP);
+ }
- EVENT_MESH_NACOS,
+ public boolean isMainSlave() {
+ return Objects.equals(this, MAIN_SLAVE);
+ }
- EVENT_MESH_ETCD,
+ public boolean isCAP() {
+ return Objects.equals(this, ZK) || Objects.equals(this, RAFT) || Objects.equals(this, PAXOS) || Objects.equals(this, CAP);
+ }
- ROCKETMQ,
- ROCKETMQ_NAMESERVER;
-}
+ public boolean isNot() {
+ return this == NOT;
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
similarity index 82%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
index aa0ad0e..b5deee5 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
@@ -15,22 +15,24 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
-public enum RemotingType {
+public enum ClusterOwnType {
NOT,
- META,
+ INDEPENDENCE,
- STORAGE,
+ SHARE,
- EVENT_MESH_RUNTIME,
+ OVERALL_SHARE,
- EVENT_MESH_NACOS,
+ ORGANIZATION_SHARE,
- EVENT_MESH_ETCD,
+ ;
- ROCKETMQ,
- ROCKETMQ_NAMESERVER;
+ public boolean isIndependence() {
+ return this == INDEPENDENCE;
+ }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java
new file mode 100644
index 0000000..7560b19
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java
@@ -0,0 +1,113 @@
+/*
+ * 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 org.apache.eventmesh.dashboard.common.model.ClusterSyncMetadata;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+
+import lombok.Getter;
+
+/**
+ * 集群的特性
+ */
+public enum ClusterSyncMetadataEnum {
+
+
+ EVENTMESH_RUNTIME(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.INDEPENDENCE).metadataTypeList(ClusterSyncMetadata.STORAGE).build()),
+
+ EVENTMESH_META_ETCD(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.RAFT).metadataTypeList(ClusterSyncMetadata.META).build()),
+
+ EVENTMESH_META_NACOS(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.AP).metadataTypeList(ClusterSyncMetadata.META).build()),
+
+ STORAGE_ROCKETMQ_NAMESERVER(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.AP).metadataTypeList(ClusterSyncMetadata.META).build()),
+
+ STORAGE_ROCKETMQ_BROKER_MAIN_SLAVE(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.MAIN_SLAVE).metadataTypeList(ClusterSyncMetadata.STORAGE).build()),
+
+ STORAGE_ROCKETMQ_BROKER_RFT(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.RAFT).metadataTypeList(ClusterSyncMetadata.STORAGE).build()),
+
+ STORAGE_KAFKA_ZK(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.ZK).metadataTypeList(ClusterSyncMetadata.META).build()),
+
+ STORAGE_KAFKA_RAFT(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.RAFT).metadataTypeList(ClusterSyncMetadata.META).build()),
+
+ STORAGE_KAFKA_BROKER(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.CAP)
+ .metadataTypeList(ListWrapper.build().add(ClusterSyncMetadata.STORAGE).add(ClusterSyncMetadata.AUTH).list)
+ .replicationDimension(ReplicationDimension.TOPIC).build()),
+
+ STORAGE_JVM_BROKER(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.MAIN_SLAVE).metadataTypeList(ClusterSyncMetadata.TEST_ONE).build()),
+
+ STORAGE_JVM_CAP_BROKER(
+ ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.CAP).metadataTypeList(ClusterSyncMetadata.STORAGE)
+ .replicationDimension(ReplicationDimension.TOPIC).build()),
+ ;
+
+ private static final Map<ClusterType, ClusterSyncMetadata> SYNC_METADATA_CONCURRENT_HASH_MAP = new ConcurrentHashMap<>();
+
+ public static ClusterSyncMetadata getClusterSyncMetadata(ClusterType clusterType) {
+ ClusterSyncMetadata clusterSyncMetadata = SYNC_METADATA_CONCURRENT_HASH_MAP.get(clusterType);
+ try {
+ if (Objects.isNull(clusterSyncMetadata)) {
+ ClusterSyncMetadataEnum clusterSyncMetadataEnum = ClusterSyncMetadataEnum.valueOf(clusterType.toString());
+ SYNC_METADATA_CONCURRENT_HASH_MAP.put(clusterType, clusterSyncMetadataEnum.getClusterSyncMetadata());
+ clusterSyncMetadata = clusterSyncMetadataEnum.getClusterSyncMetadata();
+ }
+ } catch (Exception e) {
+ clusterSyncMetadata = ClusterSyncMetadata.EMPTY_OBJECT;
+ SYNC_METADATA_CONCURRENT_HASH_MAP.put(clusterType, clusterSyncMetadata);
+ }
+ return clusterSyncMetadata;
+ }
+
+ public static ClusterFramework getClusterFramework(ClusterType clusterType) {
+ return getClusterSyncMetadata(clusterType).getClusterFramework();
+ }
+
+ static class ListWrapper {
+
+ static ListWrapper build() {
+ return new ListWrapper();
+ }
+
+ private List<MetadataType> list = new ArrayList<>();
+
+ ListWrapper add(List<MetadataType> list) {
+ list.addAll(list);
+ return this;
+ }
+ }
+
+ @Getter
+ private ClusterSyncMetadata clusterSyncMetadata;
+
+ ClusterSyncMetadataEnum(ClusterSyncMetadata clusterSyncMetadata) {
+ this.clusterSyncMetadata = clusterSyncMetadata;
+ }
+
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
index 44b852d..66daa53 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
@@ -15,16 +15,123 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
+import java.util.List;
+
+import lombok.Getter;
+
+/**
+ *
+ */
+@Getter
public enum ClusterTrusteeshipType {
- FIRE_AND_FORGET_TRUSTEESHIP,
- TRUSTEESHIP,
+ NOT("", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME)),
+
+ /**
+ * 全托管 存储不好做全托管 RocketMQ, kafhka,都适合
+ **/
+ SELF("自维护", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME)),
+
+ /**
+ *
+ */
+ TRUSTEESHIP("托管", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME)),
+
+ /**
+ * 托管,从 meta 获得 runtime 提供了 meta地址,从 meta 获得 runtime 主要用于已经存在的集群 支持: eventmesh cluster RocketMQ cluster
+ **/
+ TRUSTEESHIP_FIND("托管且从 meta 获得 runtime,同时同步配置", List.of(ClusterType.META, ClusterType.META_AND_RUNTIME)),
+
+ /**
+ * 继承 TRUSTEESHIP_FIND 能力 同时以 集群为主
+ **/
+ TRUSTEESHIP_FIND_REVERSE("以集群为主", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME)),
+
+ // 不托管
+ NO_TRUSTEESHIP("不托管", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME));
+
+ private List<ClusterType> clusterTypeList;
+
+ private final String type;
+
+ private String name;
+
+ private FirstToWhom firstToWhom;
+
+ public enum FirstToWhom {
+
+ NOT,
+
+ DASHBOARD,
+
+ RUNTIME,
+
+ /**
+ * 等待开始
+ */
+ WAIT_START,
+
+ /**
+ * 同步完成
+ */
+ COMPLETE,
+
+ /**
+ * 同步中
+ */
+ UNDER_WAY,
+
+ FAIL,
+
+ ;
+ }
+
+ /**
+ * 注册 meta, 表示需要从 meta 读取 runtime。 如果 FirstToWhom.DASHBOARD , 那么读取的 runtime 都标记为 DASHBOARD 如果 不托管 , 那么读取的 runtime 标记如 托管状态
+ * <p>
+ * 读取 runtime 的会后, 如何是 DASHBOARD , 使用 database 同步 如果是 RUNTIME , 使用 runtime 同步 执行完之后,判断 同步状态, 如果是 以 runtime 为主,使用 runtime 同步, 以 runtime 的不允许修改
+ * 如果是 以 database 为主,使用 database 同步 分为第一次同步,与永久同步
+ */
+ @Deprecated
+ public enum TrusteeshipArrangeType {
+
+ /**
+ * 同时注册了 meta 与 runtime
+ */
+ META_AND_RUNTIME,
+
+ /**
+ * 只注册 meta
+ */
+ META,
+
+ /**
+ * 只注册 runtime
+ */
+ RUNTIME,
+
+ /**
+ * 自维护
+ */
+ SELF,
+
+
+ }
+
+ ClusterTrusteeshipType(String type, List<ClusterType> clusterTypeList) {
+ this.type = type;
+ }
- REVERSE,
- NO_TRUSTEESHIP;
+ public boolean isSelf() {
+ return this == ClusterTrusteeshipType.SELF || this == ClusterTrusteeshipType.TRUSTEESHIP;
+ }
+ public boolean isReverse() {
+ return this == ClusterTrusteeshipType.TRUSTEESHIP_FIND || this == ClusterTrusteeshipType.TRUSTEESHIP_FIND_REVERSE;
+ }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
index 41d918f..f8b2451 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
@@ -15,8 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
+import org.apache.commons.lang3.reflect.FieldUtils;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -25,19 +28,54 @@ import lombok.Getter;
public enum ClusterType {
+ DEFINITION(0),
+
DEFAULT(1),
+
EVENTMESH(20),
+ CLUSTER(1),
+
+ META(2),
+
+ RUNTIME(3),
+
+ META_AND_RUNTIME(4),
+
+ BROKER(4),
+
+ COPY_BROKER(5),
+
+ ZK_BROKER(6),
+
+ RFT_BROKER(6),
+
STORAGE(21),
+ RUNTIME_CLUSTER(21),
+
+ META_CLUSTER(22),
+
+ STORAGE_CLUSTER(22),
+
DEFAULT_TYPE_NAME(1),
- CLUSTER(1),
- META(2),
+ CLUSTER_TYPE_META(1),
- RUNTIME(3),
+ CLUSTER_TYPE_RUNTIME(1),
+
+ CLUSTER_TYPE_STORAGE(1),
+
+
+ NODE_BY_COPY_IN_TYPE(2),
+
+ NODE_BY_COPY_IN_TYPE_NOT_HAVE(2),
+
+ NODE_BY_COPY_IN_TYPE_MAIN(2),
+
+ NODE_BY_COPY_IN_TYPE_SLAVE(3),
RUNTIME_EVENT_RUNTIME(ClusterType.META.code + 1),
@@ -48,10 +86,13 @@ public enum ClusterType {
META_TYPE_NACOS(ClusterType.META.code + 2),
+ META_TYPE_ZK(ClusterType.META.code + 3),
+
META_TYPE_ROCKETMQ_NAMESERVER(ClusterType.META.code + 31),
+ KUBERNETES_RUNTIME(DEFAULT, DEFAULT, CLUSTER, RUNTIME, RemotingType.KUBERNETES),
- EVENTMESH_CLUSTER(EVENTMESH, EVENTMESH, CLUSTER, DEFAULT, RemotingType.EVENT_MESH_RUNTIME),
+ EVENTMESH_CLUSTER(EVENTMESH, EVENTMESH, CLUSTER, DEFINITION, RemotingType.EVENT_MESH_RUNTIME),
EVENTMESH_RUNTIME(EVENTMESH, EVENTMESH, RUNTIME, DEFAULT, RemotingType.EVENT_MESH_RUNTIME),
@@ -61,27 +102,130 @@ public enum ClusterType {
STORAGE_ROCKETMQ(ClusterType.STORAGE.code + 1),
- STORAGE_ROCKETMQ_CLUSTER(STORAGE, STORAGE_ROCKETMQ, CLUSTER, DEFAULT, RemotingType.ROCKETMQ),
+ STORAGE_ROCKETMQ_CLUSTER(STORAGE, STORAGE_ROCKETMQ, CLUSTER, DEFINITION, RemotingType.ROCKETMQ),
STORAGE_ROCKETMQ_NAMESERVER(STORAGE, STORAGE_ROCKETMQ, META, DEFAULT, RemotingType.ROCKETMQ_NAMESERVER),
- STORAGE_ROCKETMQ_BROKER(STORAGE, STORAGE_ROCKETMQ, RUNTIME, DEFAULT, RemotingType.ROCKETMQ);
+ STORAGE_ROCKETMQ_BROKER(STORAGE, STORAGE_ROCKETMQ, RUNTIME, DEFINITION, RemotingType.ROCKETMQ),
+
+ STORAGE_ROCKETMQ_BROKER_MAIN_SLAVE(STORAGE, STORAGE_ROCKETMQ_BROKER, RUNTIME, DEFAULT, RemotingType.ROCKETMQ),
+
+ STORAGE_ROCKETMQ_BROKER_RAFT(STORAGE, STORAGE_ROCKETMQ_BROKER, RUNTIME, DEFAULT, RemotingType.ROCKETMQ),
+
+
+ STORAGE_KAFKA(STORAGE_ROCKETMQ.code + 1),
+ STORAGE_KAFKA_CLUSTER(STORAGE, STORAGE_KAFKA, CLUSTER, DEFINITION, RemotingType.KAFKA),
- public static final List<ClusterType> STORAGE_TYPES = getStorage();
+ STORAGE_KAFKA_ZK(STORAGE, STORAGE_KAFKA, META, META_TYPE_ZK, RemotingType.ZK),
+
+ STORAGE_KAFKA_RAFT(STORAGE, STORAGE_KAFKA, META_AND_RUNTIME, STORAGE_KAFKA, RemotingType.KAFKA),
+
+ STORAGE_KAFKA_BROKER(STORAGE, STORAGE_KAFKA, RUNTIME, DEFAULT, RemotingType.KAFKA),
+
+
+ STORAGE_REDIS(STORAGE_KAFKA.code + 1),
+
+ STORAGE_REDIS_CLUSTER(STORAGE, STORAGE_REDIS, CLUSTER, DEFINITION, RemotingType.REDIS),
+
+ STORAGE_REDIS_BROKER(STORAGE, STORAGE_REDIS, RUNTIME, DEFAULT, RemotingType.REDIS),
+
+ STORAGE_JVM(STORAGE_REDIS.code + 1),
+
+ STORAGE_JVM_CLUSTER(STORAGE, STORAGE_JVM, CLUSTER, DEFINITION, RemotingType.JVM),
+
+ STORAGE_JVM_META(STORAGE, STORAGE_JVM, META, DEFAULT, RemotingType.JVM),
+
+ STORAGE_JVM_BROKER(STORAGE, STORAGE_JVM, RUNTIME, DEFAULT, RemotingType.JVM),
+
+ STORAGE_JVM_CAP(STORAGE_REDIS.code + 1),
+
+ STORAGE_JVM_CAP_CLUSTER(STORAGE, STORAGE_JVM_CAP, CLUSTER, DEFINITION, RemotingType.JVM),
+
+ STORAGE_JVM_CAP_BROKER(STORAGE, STORAGE_JVM_CAP, META_AND_RUNTIME, DEFAULT, RemotingType.JVM),
+ ;
+
+
+ private static final List<ClusterType> STORAGE_MAIN_CLUSTER_TYPE_LIST = new ArrayList<>();
+
+ private static final List<ClusterType> STORAGE_META_CLUSTER_TYPE_LIST = new ArrayList<>();
+
+ private static final List<ClusterType> STORAGE_RUNTIME_CLUSTER_TYPE_LIST = new ArrayList<>();
+
+ private static final List<ClusterType> STORAGE_META_RUNTIME_TYPE_LIST = new ArrayList<>();
+
+ static {
+ for (ClusterType clusterType : ClusterType.values()) {
+ if (clusterType.isStorageCluster()) {
+ STORAGE_MAIN_CLUSTER_TYPE_LIST.add(clusterType);
+ }
+ if (clusterType.isStorageMeta()) {
+ STORAGE_META_CLUSTER_TYPE_LIST.add(clusterType);
+ }
+ if (clusterType.isStorageRuntime()) {
+ STORAGE_RUNTIME_CLUSTER_TYPE_LIST.add(clusterType);
+ }
+ if (clusterType.isMetaAndRuntime()) {
+ STORAGE_META_RUNTIME_TYPE_LIST.add(clusterType);
+ }
+ }
+ }
+
+ public static List<ClusterType> getStorageCluster() {
+ return STORAGE_MAIN_CLUSTER_TYPE_LIST;
+ }
+
+ public static List<ClusterType> getStorageMetaCluster() {
+ return STORAGE_META_CLUSTER_TYPE_LIST;
+ }
+
+ public static List<ClusterType> getStorageRuntimeCluster() {
+ return STORAGE_RUNTIME_CLUSTER_TYPE_LIST;
+ }
+
+ public static List<ClusterType> getStorageMetaRuntimeCluster() {
+ return STORAGE_META_RUNTIME_TYPE_LIST;
+ }
+
+ /**
+ * 集群在 eventmesh 集群内的 节点(集群)类型。meta集群,存储集群,runtime集群
+ */
@Getter
private ClusterType eventmeshNodeType;
+ /**
+ * 具体类型集群
+ */
@Getter
private ClusterType assemblyName;
+
+ /**
+ * 这个节点在 具体集群内是什么节点
+ */
@Getter
private ClusterType assemblyNodeType;
+
+ /**
+ * 厂商是什么类型。比如注册中心。注册中心有 etc,nacos
+ */
@Getter
private ClusterType assemblyBusiness;
+
+ /**
+ * 远程协议类型
+ */
@Getter
private RemotingType remotingType;
+
@Getter
private int code;
+
+ private List<ClusterType> mainClusterType;
+
+ private List<ClusterType> metaClusterType;
+
+ private List<ClusterType> runtimeClusterType;
+
ClusterType(int code) {
this.code = code;
}
@@ -96,29 +240,137 @@ public enum ClusterType {
this.remotingType = remotingType;
}
- private static List<ClusterType> getStorage() {
+
+ /**
+ * 半托管状态需要 如要从
+ */
+ public boolean isEventMethMeta() {
+ return this.eventmeshNodeType.equals(EVENTMESH) && this.assemblyNodeType.equals(META);
+ }
+
+
+ public boolean isEventMethRuntime() {
+ return this == EVENTMESH_RUNTIME;
+ }
+
+ public boolean isMeta() {
+ if (Objects.isNull(this.assemblyNodeType)) {
+ return false;
+ }
+ return this.assemblyNodeType.equals(META);
+ }
+
+ public boolean isMetaAndRuntime() {
+ if (Objects.isNull(this.eventmeshNodeType)) {
+ return false;
+ }
+ return this.eventmeshNodeType.equals(META_AND_RUNTIME);
+ }
+
+ public boolean isRuntime() {
+ if (Objects.isNull(this.assemblyNodeType)) {
+ return false;
+ }
+ return this.assemblyNodeType.equals(RUNTIME) || this.eventmeshNodeType.equals(META_AND_RUNTIME);
+ }
+
+ public boolean isStorage() {
+ if (Objects.isNull(this.eventmeshNodeType)) {
+ return false;
+ }
+ return this.eventmeshNodeType.equals(STORAGE);
+ }
+
+ public boolean isMainCluster() {
+ return Objects.equals(this, ClusterType.EVENTMESH_CLUSTER) || Objects.equals(this.assemblyNodeType, ClusterType.CLUSTER);
+ }
+
+
+ public boolean isHealthTopic() {
+ return Objects.equals(this, EVENTMESH_RUNTIME) || this.isStorageRuntime();
+ }
+
+ public boolean isStorageCluster() {
+ return Objects.equals(this.eventmeshNodeType, STORAGE) && Objects.equals(this.assemblyNodeType, CLUSTER);
+ }
+
+ public boolean isStorageRuntime() {
+ return Objects.equals(this.eventmeshNodeType, STORAGE) && Objects.equals(this.assemblyNodeType, RUNTIME);
+ }
+
+ public boolean isStorageMeta() {
+ return Objects.equals(this.eventmeshNodeType, STORAGE) && Objects.equals(this.assemblyNodeType, META);
+ }
+
+ public boolean isMain() {
+ return Objects.equals(this, NODE_BY_COPY_IN_TYPE_MAIN);
+ }
+
+ public boolean isSlave() {
+ return Objects.equals(this, NODE_BY_COPY_IN_TYPE_SLAVE);
+ }
+
+ public boolean isDefinition() {
+ return Objects.equals(this.assemblyBusiness, DEFINITION);
+ }
+
+ public List<ClusterType> getMetaClusterInStorage() {
List<ClusterType> list = new ArrayList<>();
- for (ClusterType clusterType : ClusterType.values()) {
- if (Objects.equals(clusterType.eventmeshNodeType, ClusterType.STORAGE) && Objects.equals(clusterType.assemblyNodeType,
- ClusterType.CLUSTER)) {
- list.add(clusterType);
+ for (ClusterType allClusterType : ClusterType.values()) {
+ if (Objects.equals(allClusterType.eventmeshNodeType, STORAGE) && Objects.equals(allClusterType.assemblyNodeType, META)) {
+ list.add(allClusterType);
}
}
return list;
}
- public boolean isMainCluster() {
- return Objects.equals(this, ClusterType.EVENTMESH_CLUSTER) || Objects.equals(this.assemblyNodeType, ClusterType.CLUSTER);
+ public List<ClusterType> getMainClusterType() {
+ return this.getThisClusterType(CLUSTER, this.mainClusterType, "mainClusterType");
+
}
- public boolean isFirstLayer() {
- return Objects.equals(this, ClusterType.EVENTMESH_META_NACOS) || Objects.equals(this, ClusterType.EVENTMESH_META_ETCD) || Objects.equals(this,
- ClusterType.EVENTMESH_RUNTIME) || Objects.equals(this.getAssemblyNodeType(), ClusterType.CLUSTER);
+ public List<ClusterType> getMetaClusterType() {
+ return this.getThisClusterType(META, this.metaClusterType, "metaClusterType");
}
- public boolean isSecondFloor() {
- return Objects.equals(eventmeshNodeType, ClusterType.STORAGE) ? (Objects.equals(assemblyNodeType, ClusterType.RUNTIME) || Objects.equals(
- assemblyNodeType, ClusterType.META)) : false;
+ public List<ClusterType> getRuntimeClusterType() {
+ return this.getThisClusterType(RUNTIME, this.runtimeClusterType, "runtimeClusterType");
}
+
+ private List<ClusterType> getThisClusterType(ClusterType assemblyNodeType, List<ClusterType> clusterTypeList, String fieldName) {
+ if (Objects.equals(assemblyNodeType, this.assemblyNodeType) && !this.isDefinition()) {
+ return null;
+ }
+ if (Objects.nonNull(clusterTypeList)) {
+ return clusterTypeList;
+ }
+ clusterTypeList = new ArrayList<>();
+ synchronized (this) {
+ for (ClusterType allClusterType : ClusterType.values()) {
+ if (this == allClusterType) {
+ continue;
+ }
+ if (Objects.equals(this.eventmeshNodeType, allClusterType.eventmeshNodeType)
+ && (Objects.equals(this.assemblyName, allClusterType.assemblyName) || Objects.equals(this, allClusterType.assemblyName))
+ && Objects.equals(assemblyNodeType, allClusterType.assemblyNodeType)) {
+ clusterTypeList.add(allClusterType);
+ }
+ }
+ }
+ if (clusterTypeList.isEmpty()) {
+ // TODO
+ // String message = String.format("cluster %s assemblyNodeType is %s fieldName is %s ", this, assemblyNodeType, fieldName);
+ // throw new RuntimeException(message);
+ }
+
+ try {
+ FieldUtils.writeField(this, fieldName, clusterTypeList, true);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ return clusterTypeList;
+ }
+
+
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java
new file mode 100644
index 0000000..2e8556b
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java
@@ -0,0 +1,107 @@
+/*
+ * 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;
+
+public enum DeployStatusType {
+
+
+ RESOURCE_APPLY,
+
+ RESOURCE_APPLY_FAILED,
+
+ CREATE_WAIT,
+
+ CREATE_FULL_WAIT,
+
+ CREATE_WAIT_TIMEOUT,
+
+ CREATE_CAP_UPDATE_WAIT,
+
+ CREATE_CAP_UPDATE_WAIT_TIMEOUT,
+
+ CREATE_ING,
+
+ CREATE_FULL_ING,
+
+ CREATE_FAIL,
+
+ CREATE_FULL_SUCCESS,
+
+ CREATE_FULL_FAIL,
+
+ CREATE_CAP_UPDATE_FAIL,
+
+ CREATE_CAP_UPDATE_ING,
+
+ CREATE_SUCCESS,
+
+ CREATE_CAP_UPDATE_SUCCESS,
+
+ UPDATE_WAIT,
+
+ UPDATE_ING,
+
+ UPDATE_SUCCESS,
+
+ UPDATE_FAIL,
+
+ UPDATE_FULL_WAIT,
+
+ UPDATE_FULL_ING,
+
+ UPDATE_FULL_SUCCESS,
+
+ UPDATE_FULL_FAIL,
+
+
+ PAUSE_WAIT,
+
+ PAUSE_ING,
+
+ PAUSE_FULL_ING,
+
+ PAUSE_FULL_WAIT,
+
+ PAUSE_SUCCESS,
+
+ PAUSE_FAIL,
+
+ PAUSE_FULL_SUCCESS,
+
+ PAUSE_FULL_FAIL,
+
+ RESET_WAIT,
+
+ RESET_ING,
+
+ RESET_FAIL,
+
+ RESET_SUCCESS,
+
+ UNINSTALL,
+
+ UNINSTALL_FAIL,
+
+ UNINSTALL_FAILED,
+
+ UNINSTALL_ING,
+
+ UNINSTALL_SUCCESS,
+ ;
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java
index 1e6d8a0..1a08cec 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/KubernetesPodStatus.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
import lombok.AllArgsConstructor;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java
new file mode 100644
index 0000000..42ca89d
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.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.enums;
+
+import org.apache.eventmesh.dashboard.common.model.metadata.AclMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClientMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.ConfigMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.ConnectionMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.ConsumeOffsetMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.TopicOffsetMetadata;
+
+import lombok.Getter;
+
+
+@Getter
+public enum MetadataType {
+
+ CLUSTER(ClusterMetadata.class),
+
+ CONFIG(ConfigMetadata.class),
+
+ RUNTIME(RuntimeMetadata.class),
+
+ TOPIC(TopicMetadata.class),
+
+ GROUP(GroupMetadata.class),
+
+ TOPIC_OFFSET(TopicOffsetMetadata.class, true),
+
+ CONSUME_OFFSET(ConsumeOffsetMetadata.class, true),
+
+ SUBSCRIBER(GroupMetadata.class),
+
+ CLIENT(ClientMetadata.class, true),
+
+ NET_CONNECT(ConnectionMetadata.class, true),
+
+ USER(ConnectionMetadata.class),
+
+ ACL(AclMetadata.class);
+
+ private Class<?> metadataClass;
+
+ private boolean readOnly = false;
+
+ MetadataType(Class<?> metadataClass) {
+ this.metadataClass = metadataClass;
+ }
+
+ MetadataType(Class<?> metadataClass, boolean readOnly) {
+ this.metadataClass = metadataClass;
+ this.readOnly = readOnly;
+ }
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java
new file mode 100644
index 0000000..bfe248d
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java
@@ -0,0 +1,100 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * 比如: 通过 topic id 修改配置。 Kafka 只需要 操作 cluster 就可以了。 RocketMQ 需要操作 broker集群,复制集群,
+ */
+public class OperationRange {
+
+ private static final OperationRange operationRange = new OperationRange();
+
+ private static Map<ClusterType, List<OperationRangeType>> operationRangeListHashMap = new HashMap<>();
+
+ public static OperationRange getInstance() {
+ return operationRange;
+ }
+
+ private OperationRange() {
+
+ }
+
+
+ private void setOperationRange(ClusterType clusterType, OperationRangeType operationRangeType) {
+ operationRangeListHashMap.computeIfAbsent(clusterType, k -> new ArrayList<>()).add(operationRangeType);
+ }
+
+ public List<OperationRangeType> getOperationRangeTypeList(ClusterType clusterType) {
+ return operationRangeListHashMap.get(clusterType);
+ }
+
+ /**
+ * 依据范围查询数据
+ * 集群, runtime , topic ,SUBSCRIBER , SUBSCRIBER_QUEUE
+ */
+ public enum OperationRangeType {
+
+ ALL(null),
+
+ CLUSTER(null),
+
+ ALL_RUNTIME(null),
+
+ ONCE_CLUSTER(null),
+
+ RANGE_CLUSTER_CAP(CLUSTER),
+
+ MAIN_SLAVE(CLUSTER),
+
+ RANGE_RUNTIME(MAIN_SLAVE),
+
+
+ GROUP(RANGE_RUNTIME),
+
+ TOPIC(RANGE_RUNTIME),
+
+ SUBSCRIBER(RANGE_RUNTIME),
+
+ SUBSCRIBER_QUEUE(RANGE_RUNTIME),
+
+ QUEUE(TOPIC),
+
+ ;
+
+ private Map<ClusterType, List<OperationRangeType>> operationRangeListHashMap;
+
+ private int index;
+
+ OperationRangeType() {
+
+ }
+
+ OperationRangeType(OperationRangeType operationRangeType) {
+ this.index = Objects.isNull(operationRangeType) ? 0 : operationRangeType.index + 1;
+ }
+ }
+
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java
index 5ed81c7..07d026e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RecordStatus.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
import lombok.AllArgsConstructor;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
index aa0ad0e..226e14d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
@@ -15,16 +15,24 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
+import java.util.HashSet;
+import java.util.Set;
+
public enum RemotingType {
NOT,
+ JVM,
+
META,
STORAGE,
+ REDIS,
+
EVENT_MESH_RUNTIME,
EVENT_MESH_NACOS,
@@ -32,5 +40,29 @@ public enum RemotingType {
EVENT_MESH_ETCD,
ROCKETMQ,
- ROCKETMQ_NAMESERVER;
+
+ ROCKETMQ_NAMESERVER,
+
+ KAFKA,
+
+
+ ZK,
+
+ KUBERNETES,
+
+ ;
+
+ private Set<ClusterType> supportClusterType = new HashSet<>();
+
+ RemotingType() {
+ }
+
+ RemotingType(ClusterType... clusterType) {
+ for (ClusterType c : clusterType) {
+ this.supportClusterType.add(c);
+ }
+
+ }
+
+
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
similarity index 82%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
index aa0ad0e..67d11af 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
@@ -15,22 +15,24 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
-public enum RemotingType {
+public enum ReplicationDimension {
NOT,
- META,
-
- STORAGE,
-
- EVENT_MESH_RUNTIME,
- EVENT_MESH_NACOS,
+ /**
+ * 节点复制 复制,
+ */
+ FULL_REPLICATION,
- EVENT_MESH_ETCD,
+ TOPIC,
- ROCKETMQ,
- ROCKETMQ_NAMESERVER;
+ /**
+ * 部分复制
+ */
+ SECTION_REPLICATION,
+ ;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
similarity index 71%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
index aa0ad0e..8b29f9e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/RemotingType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
@@ -15,22 +15,35 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
-public enum RemotingType {
+public enum ReplicationType {
NOT,
- META,
+ MAIN,
+
+ SLAVE,
+
+ MAIN_SLAVE,
+ ;
+
- STORAGE,
+ public boolean isNot() {
+ return this == NOT;
+ }
- EVENT_MESH_RUNTIME,
+ public boolean isMain() {
+ return this == MAIN;
+ }
- EVENT_MESH_NACOS,
+ public boolean isSlave() {
+ return this == SLAVE;
+ }
- EVENT_MESH_ETCD,
- ROCKETMQ,
- ROCKETMQ_NAMESERVER;
+ public boolean isMainSlave() {
+ return this == MAIN_SLAVE;
+ }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
index 519767a..822e260 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
@@ -15,15 +15,37 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
public enum ResetOffsetMode {
+ /**
+ * 支持维度如下:
+ * <p>
+ * event mesh cluster 。
+ * RockerMQ 查出 所有的 存储集群,然后存储存储集群里面,所有子集群,以及子集群里面所有的 broker ,对每个broker 进行一次请求奥做。
+ * Kkakfa 查出 所有的 存储集群,然后存储存储集群里面。 只需要对 cluster 进行一次请求操作
+ * <p>
+ * storage cluster
+ * <p>
+ * storage definition cluster
+ * <p>
+ * storage runtime cluster
+ *
+ *
+ */
CONSUME_FROM_LAST_OFFSET,
CONSUME_FROM_FIRST_OFFSET,
+
CONSUME_FROM_TIMESTAMP,
+ /**
+ * 只有此模式支持 Queue 维度
+ * <p>
+ * 只有这个模式,传递Queue id
+ */
CONSUME_FROM_DESIGNATED_OFFSET
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java
deleted file mode 100644
index 4a6036f..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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 static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON;
-
-import org.springframework.http.HttpStatus;
-
-import lombok.Getter;
-
-/**
- * An error enumeration class that conforms to the RESTful specifications and custom error reporting requirements.
- * <ul>
- * <li>The 'code' field is used to return the HTTP status code using {@link HttpStatus}.</li>
- * <li>The 'category' field represents the major category of the error.</li>
- * <li>the 'desc' field represents the detailed subcategory and information of the error.</li>
- * </ul>
- */
-
-@Getter
-public enum Status {
-
- SUCCESS(HttpStatus.OK, Category.SUCCESS, "Operation success."),
-
- NACOS_SDK_CONFIG_ERR(HttpStatus.INTERNAL_SERVER_ERROR, Category.SDK_CONFIG_ERR,
- "Failed to create Nacos ConfigService. Please check EventMeshAdmin application configuration."),
-
- NACOS_GET_CONFIGS_ERR(HttpStatus.BAD_GATEWAY, Category.META_COM_ERR, "Failed to retrieve Nacos config(s)."),
-
- NACOS_EMPTY_RESP_ERR(HttpStatus.BAD_GATEWAY, Category.META_COM_ERR, "No result returned by Nacos. Please check Nacos."),
-
- NACOS_LOGIN_ERR(HttpStatus.UNAUTHORIZED, Category.META_COM_ERR, "Nacos login failed."),
-
- NACOS_LOGIN_EMPTY_RESP_ERR(HttpStatus.BAD_GATEWAY, Category.META_COM_ERR, "Nacos didn't return accessToken. Please check Nacos status."),
- ;
-
- // error code
- private final HttpStatus code;
-
- // error type
- private final Category category;
-
- // error message
- private final String desc;
-
- Status(HttpStatus code, Category category, String desc) {
- this.code = code;
- this.category = category;
- this.desc = desc;
- }
-
- @Override
- public String toString() {
- return name() + " of " + category + COLON + desc;
- }
-
- @Getter
- public enum Category {
-
- SUCCESS("Successfully received and processed"),
-
- SDK_CONFIG_ERR("Meta SDK config error"),
-
- META_COM_ERR("Network communication to Meta error"),
- ;
-
- /**
- * Helpful for understanding and not used for now
- */
- private final String desc;
-
- Category(String desc) {
- this.desc = desc;
- }
- }
-}
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
index ed15a86..50ea191 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums;
import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_TYPE_KAFKA;
@@ -27,6 +28,7 @@ import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.S
import lombok.AllArgsConstructor;
import lombok.Getter;
+@Deprecated
@AllArgsConstructor
public enum StoreType {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncErrorType.java
similarity index 87%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncErrorType.java
index 44b852d..c66626b 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncErrorType.java
@@ -15,16 +15,16 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.enums;
-public enum ClusterTrusteeshipType {
+package org.apache.eventmesh.dashboard.common.enums;
- FIRE_AND_FORGET_TRUSTEESHIP,
+public enum SyncErrorType {
- TRUSTEESHIP,
+ NOT,
- REVERSE,
+ METADATA_SYNC_ERROR,
- NO_TRUSTEESHIP;
+ CHECK_SYNC_ERROR,
+ ;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
index 7542376..34a5891 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums.health;
import lombok.AllArgsConstructor;
@@ -23,12 +24,25 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum HealthCheckStatus {
- FAILED(0, "failed"),
- PASSED(1, "passed"),
- CHECKING(2, "checking"),
- TIMEOUT(3, "timeout"),
- NOT_CONNECTED(4, "not connected");
- private final Integer number;
+ SUCCESS(1L, "success"),
+
+ FAILED(0L, "failed"),
+
+ PASSED(1L, "passed"),
+
+ CHECKING(2L, "checking"),
+
+ TIMEOUT(3L, "timeout"),
+
+ NOT_CONNECTED(4L, "not connected"),
+
+ USER_AUTHENTICATION_FAIL(5L, "user authentication fail"),
+
+ REQUEST_AUTHENTICATION_FAIL(6L, "request authentication fail"),
+ ;
+
+ private final Long number;
+
private final String name;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
similarity index 86%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
index 54c061e..457e65b 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.enums.health;
import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant;
@@ -23,14 +24,23 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
-public enum HealthCheckType {
+public enum HealthCheckTypeEnum {
UNKNOWN(0, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN),
+ PROCESS(0, "检查进场"),
+
+ PORT(1, "端口"),
+
+ PING(2, "ping"),
+
+
+ TOPIC(3, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC),
+
+
CLUSTER(1, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER),
RUNTIME(2, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME),
- TOPIC(3, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC),
STORAGE(4, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE);
@@ -40,7 +50,7 @@ public enum HealthCheckType {
private final String name;
public static Integer toNumber(String name) {
- for (HealthCheckType healthCheckTypeEnum : HealthCheckType.values()) {
+ for (HealthCheckTypeEnum healthCheckTypeEnum : HealthCheckTypeEnum.values()) {
if (healthCheckTypeEnum.name.equals(name)) {
return healthCheckTypeEnum.number;
}
@@ -49,7 +59,7 @@ public enum HealthCheckType {
}
public static String toName(Integer number) {
- for (HealthCheckType healthCheckTypeEnum : HealthCheckType.values()) {
+ for (HealthCheckTypeEnum healthCheckTypeEnum : HealthCheckTypeEnum.values()) {
if (healthCheckTypeEnum.number.equals(number)) {
return healthCheckTypeEnum.name;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java
deleted file mode 100644
index c336401..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.exception;
-
-import static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON;
-
-import org.apache.eventmesh.dashboard.common.enums.Status;
-import org.apache.eventmesh.dashboard.common.util.ExceptionUtil;
-
-import lombok.Getter;
-
-/**
- * Exceptions in EventMeshAdmin application
- */
-
-@Getter
-public class BaseException extends RuntimeException {
-
- private static final long serialVersionUID = 3509261993355721168L;
-
- private Status status;
-
- public BaseException(String message) {
- super(message);
- }
-
- /**
- * Customized error reporting using enums and exceptions
- */
- public BaseException(Status status, Throwable cause) {
- super(ExceptionUtil.trimDesc(status.getDesc()) + COLON + cause.getMessage(), cause);
- this.status = status;
- }
-
- public BaseException(Status status) {
- super(status.getDesc());
- this.status = status;
- }
-}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java
deleted file mode 100644
index f0ce811..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.exception;
-
-import org.apache.eventmesh.dashboard.common.enums.Status;
-
-/**
- * EventMeshAdmin Application side exception
- */
-
-public class EventMeshAdminException extends BaseException {
-
- private static final long serialVersionUID = 2002022502005456586L;
-
- public EventMeshAdminException(String message) {
- super(message);
- }
-
- /**
- * Customized error reporting using enums and exceptions
- */
- public EventMeshAdminException(Status status, Throwable cause) {
- super(status, cause);
- }
-}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java
deleted file mode 100644
index b479fc6..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.exception;
-
-import org.apache.eventmesh.dashboard.common.enums.Status;
-
-/**
- * Meta side exception with EventMeshAdmin Application
- */
-
-public class MetaException extends BaseException {
-
- private static final long serialVersionUID = 6246145526338359773L;
-
- public MetaException(String message) {
- super(message);
- }
-
- /**
- * Customized error reporting using enums and exceptions
- */
- public MetaException(Status status, Throwable cause) {
- super(status, cause);
- }
-
- public MetaException(Status status) {
- super(status);
- }
-}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java
new file mode 100644
index 0000000..c58890d
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java
@@ -0,0 +1,71 @@
+/*
+ * 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;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationDimension;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class ClusterSyncMetadata {
+
+ public static final ClusterSyncMetadata EMPTY_OBJECT = new ClusterSyncMetadata(new ArrayList<>(), ReplicationDimension.NOT, ClusterFramework.NOT);
+
+ public static List<MetadataType> TEST_ONE = new ArrayList<>();
+
+ public static List<MetadataType> META = new ArrayList<>();
+
+ public static List<MetadataType> STORAGE = new ArrayList<>();
+
+ public static List<MetadataType> LANTERN = new ArrayList<>();
+
+ public static List<MetadataType> AUTH = new ArrayList<>();
+
+ static {
+
+ TEST_ONE.add(MetadataType.TOPIC);
+
+ META.add(MetadataType.RUNTIME);
+
+ STORAGE.add(MetadataType.CONFIG);
+ STORAGE.add(MetadataType.TOPIC);
+ STORAGE.add(MetadataType.GROUP);
+ STORAGE.add(MetadataType.NET_CONNECT);
+ STORAGE.add(MetadataType.SUBSCRIBER);
+
+ AUTH.add(MetadataType.USER);
+ AUTH.add(MetadataType.ACL);
+
+ }
+
+ private List<MetadataType> metadataTypeList;
+
+ private ReplicationDimension replicationDimension;
+
+ private ClusterFramework clusterFramework;
+
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java
index 3934e8f..b6d79e0 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model;
public class ConnectionInfo {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConvertMetaData.java
similarity index 88%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConvertMetaData.java
index 3934e8f..c8417c9 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConvertMetaData.java
@@ -15,8 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model;
-public class ConnectionInfo {
+/**
+ *
+ */
+public interface ConvertMetaData<E, M> {
+
+
+ E toEntity(M meta);
+
+ M toMetaData(E entity);
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/DatabaseAndMetadataMapper.java
similarity index 76%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/DatabaseAndMetadataMapper.java
index 6052d6c..1f89aab 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/DatabaseAndMetadataMapper.java
@@ -15,21 +15,26 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+
import lombok.Builder;
import lombok.Data;
@Data
@Builder
-public class SubscriptionInfo {
+public class DatabaseAndMetadataMapper {
+
+
+ private MetadataType metaType;
+
+ private Class<?> databaseHandlerClass;
+
+ private Class<?> metadataHandlerClass;
- // client name
- private String clientName;
+ private ConvertMetaData<?, ?> convertMetaData;
- // 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/SubscriptionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/MetadataSyncResultMetadata.java
similarity index 70%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/MetadataSyncResultMetadata.java
index 6052d6c..df371e7 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/MetadataSyncResultMetadata.java
@@ -15,21 +15,21 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model;
-import lombok.Builder;
-import lombok.Data;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+
+@Deprecated
+public class MetadataSyncResultMetadata {
+
-@Data
-@Builder
-public class SubscriptionInfo {
+ private MetadataType metadataType;
- // client name
- private String clientName;
+ private ClusterTrusteeshipType clusterTrusteeshipType;
- // group name
- private String group;
+ private boolean isFast = false;
- // config content
- private String subscription;
+ private String resultData;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/SyncRelationshipConfig.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/PortHandler.java
similarity index 81%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/SyncRelationshipConfig.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/PortHandler.java
index 018584a..e404672 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/SyncRelationshipConfig.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/PortHandler.java
@@ -15,13 +15,17 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.function.metadata;
+package org.apache.eventmesh.dashboard.common.model;
-public class SyncRelationshipConfig {
+@Deprecated
+public class PortHandler {
- private Class<?> metadataClass;
- private Class<?> entityClass;
+ private Integer port;
+
+ private Integer jmsPort;
+
+ private Integer mainPort;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
index 6052d6c..482c8e2 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model;
import lombok.Builder;
@@ -22,6 +23,7 @@ import lombok.Data;
@Data
@Builder
+@Deprecated
public class SubscriptionInfo {
// client name
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
similarity index 56%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
index 1b5d564..b45c9e0 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
@@ -15,26 +15,43 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+package org.apache.eventmesh.dashboard.common.model.base;
-import lombok.Data;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+public abstract class BaseClusterIdBase extends BaseOrganizationBase {
-@Data
-public class ClusterRelationshipMetadata extends MetadataConfig {
+ private Long clusterId;
private ClusterType clusterType;
- private Long relationshipId;
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public ClusterType getClusterType() {
+ return clusterType;
+ }
+
+ public void setClusterType(ClusterType clusterType) {
+ this.clusterType = clusterType;
+ }
- private ClusterType relationshipType;
+ public boolean isDelete() {
+ return this.getStatus() == 0;
+ }
- private Integer status;
+ public boolean isUpdate() {
+ return !this.isDelete() && !this.isInsert();
+ }
- @Override
- public String getUnique() {
- return null;
+ public boolean isInsert() {
+ return true;
}
+
}
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/base/BaseOrganizationBase.java
similarity index 50%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RegistryMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseOrganizationBase.java
index 890ce75..a4c2356 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/base/BaseOrganizationBase.java
@@ -15,49 +15,49 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
-import org.apache.eventmesh.dashboard.common.enums.RecordStatus;
+package org.apache.eventmesh.dashboard.common.model.base;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
-@Data
-@SuperBuilder
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class RegistryMetadata extends MetadataConfig {
+public abstract class BaseOrganizationBase {
+ private Long id;
- private String clusterName;
+ private Long status;
- private String name;
+ private Long organizationId;
- private String type;
+ public Long getId() {
+ return id;
+ }
- private String version;
+ public void setId(Long id) {
+ this.id = id;
+ }
- private String host;
+ public Long getOrganizationId() {
+ return organizationId;
+ }
- private Integer port;
+ public void setOrganizationId(Long organizationId) {
+ this.organizationId = organizationId;
+ }
- private String role;
+ public Long getStatus() {
+ return status;
+ }
- private String username;
+ public void setStatus(Long status) {
+ this.status = status;
+ }
- private String params;
+ public String getUnique() {
+ return this.getClass().getSimpleName() + "-" + this.id.toString();
+ }
/**
- * 0: not active, 1: active
- *
- * @see RecordStatus
+ * 主要用于 database 数据 与 节点数据 对比用。这个数据在node的唯一
+ * @return
*/
- private Integer status;
-
- @Override
- public String getUnique() {
- return host + ":" + port;
- }
+ public abstract String nodeUnique();
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseRuntimeIdBase.java
similarity index 72%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseRuntimeIdBase.java
index 444e530..7ceeb0b 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseRuntimeIdBase.java
@@ -15,17 +15,20 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.exception;
-/**
- * EventMesh Runtime side exception
- */
+package org.apache.eventmesh.dashboard.common.model.base;
+
+public abstract class BaseRuntimeIdBase extends BaseClusterIdBase {
-public class EventMeshException extends BaseException {
+ private Long runtimeId;
- private static final long serialVersionUID = 5648256502005456586L;
- public EventMeshException(String message) {
- super(message);
+ public Long getRuntimeId() {
+ return runtimeId;
}
+
+ public void setRuntimeId(Long runtimeId) {
+ this.runtimeId = runtimeId;
+ }
+
}
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/base/BaseSyncBase.java
similarity index 57%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseSyncBase.java
index 57f37b2..a027241 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/base/BaseSyncBase.java
@@ -15,52 +15,51 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
+
+package org.apache.eventmesh.dashboard.common.model.base;
import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.common.enums.StoreType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.common.enums.SyncErrorType;
+
+import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class ClusterMetadata extends MetadataConfig {
+public abstract class BaseSyncBase extends BaseClusterIdBase {
- private String clusterName;
private ClusterTrusteeshipType trusteeshipType;
- private ClusterType clusterType;
-
- private String registryAddress;
-
- private String bootstrapServers;
-
- private String eventmeshVersion;
+ private FirstToWhom firstToWhom;
- private String clientProperties;
+ private FirstToWhom firstSyncState;
- private String jmxProperties;
+ private ReplicationType replicationType;
- private String regProperties;
+ private SyncErrorType syncErrorType;
- private Integer authType;
+ private String config;
- private Integer runState;
-
- private Integer status;
+ /**
+ * 上线时间
+ */
+ private LocalDateTime onlineTimestamp;
/**
- * @see StoreType
+ * 下线时间
*/
- private StoreType storeType;
+ private LocalDateTime offlineTimestamp;
- private String description;
- @Override
- public String getUnique() {
- return clusterName + "/" + registryAddress;
+ private LocalDateTime startTimestamp;
+
+ public boolean isCluster() {
+ return true;
}
+
}
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 982fa5a..729849d 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
@@ -15,26 +15,37 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class AclMetadata extends MetadataConfig {
+public class AclMetadata extends BaseRuntimeIdBase {
private Long clusterId;
+
private String principal;
+
private Integer operation;
+
private String permissionType;
+
private String host;
+
private String resourceType;
+
private String resourceName;
+
private Integer patternType;
+
@Override
- public String getUnique() {
- return null;
+ public String nodeUnique() {
+ return this.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 8dd240a..ca2491b 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
@@ -15,14 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class ClientMetadata extends MetadataConfig {
+public class ClientMetadata extends BaseRuntimeIdBase {
private String name;
@@ -47,8 +50,9 @@ public class ClientMetadata extends MetadataConfig {
*/
private String protocol;
+
@Override
- public String getUnique() {
- return host + ":" + port;
+ public String nodeUnique() {
+ return this.host + "-" + this.port;
}
}
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 57f37b2..a45d68c 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
@@ -15,18 +15,19 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.common.enums.StoreType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseSyncBase;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class ClusterMetadata extends MetadataConfig {
+public class ClusterMetadata extends BaseSyncBase {
private String clusterName;
@@ -50,17 +51,12 @@ public class ClusterMetadata extends MetadataConfig {
private Integer runState;
- private Integer status;
-
- /**
- * @see StoreType
- */
- private StoreType storeType;
private String description;
+
@Override
- public String getUnique() {
- return clusterName + "/" + registryAddress;
+ public String nodeUnique() {
+ return this.getClusterId().toString();
}
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
index 1b5d564..d2b9759 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
@@ -15,15 +15,19 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class ClusterRelationshipMetadata extends MetadataConfig {
+@EqualsAndHashCode(callSuper = true)
+public class ClusterRelationshipMetadata extends BaseRuntimeIdBase {
private ClusterType clusterType;
@@ -31,10 +35,9 @@ public class ClusterRelationshipMetadata extends MetadataConfig {
private ClusterType relationshipType;
- private Integer status;
@Override
- public String getUnique() {
- return null;
+ public String nodeUnique() {
+ return this.relationshipId + "-" + this.getClusterId();
}
}
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
index 3592010..6a5f26d 100644
--- 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
@@ -15,8 +15,12 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseClusterIdBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -25,21 +29,22 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = true)
-public class ConfigMetadata extends MetadataConfig {
+public class ConfigMetadata extends BaseClusterIdBase {
/**
* property key
*/
- private String configKey;
+ private String configName;
private String configValue;
- private Integer instanceType;
+ private MetadataType instanceType;
private Long instanceId;
+
@Override
- public String getUnique() {
- return configKey;
+ public String nodeUnique() {
+ return this.configName;
}
}
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 49856ea..39f1adf 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
@@ -15,16 +15,21 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
import lombok.Data;
+import lombok.EqualsAndHashCode;
/**
* 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 {
+@EqualsAndHashCode(callSuper = true)
+public class ConnectionMetadata extends BaseRuntimeIdBase {
/**
@@ -67,8 +72,9 @@ public class ConnectionMetadata extends MetadataConfig {
private String description;
+
@Override
- public String getUnique() {
+ public String nodeUnique() {
return getClusterId() + "/" + sourceId + "/" + sinkId + "/" + topic;
}
}
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
index 57e2e95..2f12a47 100644
--- 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
@@ -15,12 +15,14 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
import org.apache.eventmesh.dashboard.common.enums.KubernetesPodStatus;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
-public class ConnectorMetadata extends MetadataConfig {
+public class ConnectorMetadata extends BaseRuntimeIdBase {
private String name;
@@ -37,8 +39,9 @@ public class ConnectorMetadata extends MetadataConfig {
*/
private Integer podState;
+
@Override
- public String getUnique() {
- return host + ":" + port;
+ public String nodeUnique() {
+ return "";
}
}
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/ConsumeOffsetMetadata.java
similarity index 78%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ConsumeOffsetMetadata.java
index 3827f93..a714618 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/ConsumeOffsetMetadata.java
@@ -22,20 +22,14 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GroupMetadata extends MetadataConfig {
+public class ConsumeOffsetMetadata extends TopicOffsetMetadata {
- private String name;
+ private String groupName;
- private Integer memberCount;
+ private Long consumeOffset;
- private String members;
+ private Integer consumeRate;
- private Integer type;
+ private Long delayNum;
- private String state;
-
- @Override
- public String getUnique() {
- return name;
- }
}
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 3827f93..e08bf8a 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
@@ -15,14 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GroupMetadata extends MetadataConfig {
+public class GroupMetadata extends BaseRuntimeIdBase {
private String name;
@@ -32,10 +35,10 @@ public class GroupMetadata extends MetadataConfig {
private Integer type;
- private String state;
+
@Override
- public String getUnique() {
- return name;
+ public String nodeUnique() {
+ return this.name;
}
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/InstanceUserMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/InstanceUserMetadata.java
index aaf81ba..d25661d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/InstanceUserMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/InstanceUserMetadata.java
@@ -15,9 +15,8 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
-import org.apache.eventmesh.dashboard.common.enums.StoreType;
+package org.apache.eventmesh.dashboard.common.model.metadata;
import lombok.Data;
@@ -28,7 +27,7 @@ import lombok.Data;
public class InstanceUserMetadata {
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/MetadataConfig.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java
deleted file mode 100644
index 09483cf..0000000
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/MetadataConfig.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
-
-/**
- * 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)<p> follow method should be called in init block which is used to indicate the type of metadata:
- * {@code this.setServiceTypeEnums(MetadataServiceTypeEnums.RUNTIME);}
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@SuperBuilder
-public abstract class MetadataConfig {
-
- //eventmesh registry url
- private String registryAddress;
- //cluster id in database
- private Long clusterId;
-
-
- private Long id;
-
- /**
- * @return A string that is unique to the source, usually a url
- */
- public abstract String getUnique();
-}
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/QueueMetadata.java
similarity index 72%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/QueueMetadata.java
index 3827f93..70e869c 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/QueueMetadata.java
@@ -15,27 +15,21 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class GroupMetadata extends MetadataConfig {
+package org.apache.eventmesh.dashboard.common.model.metadata;
- private String name;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
- private Integer memberCount;
+public class QueueMetadata extends BaseRuntimeIdBase {
- private String members;
+ private String topicName;
- private Integer type;
+ private String queueName;
- private String state;
@Override
- public String getUnique() {
- return name;
+ public String nodeUnique() {
+ return this.topicName + "-" + this.queueName;
}
+
}
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 890ce75..882f421 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
@@ -15,20 +15,15 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
import org.apache.eventmesh.dashboard.common.enums.RecordStatus;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
@Data
-@SuperBuilder
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class RegistryMetadata extends MetadataConfig {
+public class RegistryMetadata {
private String clusterName;
@@ -55,9 +50,4 @@ public class RegistryMetadata extends MetadataConfig {
* @see RecordStatus
*/
private Integer status;
-
- @Override
- public String getUnique() {
- return host + ":" + port;
- }
}
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 eb88e38..9d51ad8 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
@@ -15,20 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.metadata;
-import lombok.AllArgsConstructor;
+import org.apache.eventmesh.dashboard.common.model.base.BaseSyncBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@SuperBuilder
@EqualsAndHashCode(callSuper = true)
-public class RuntimeMetadata extends MetadataConfig {
+public class RuntimeMetadata extends BaseSyncBase {
private String host;
@@ -36,20 +33,26 @@ public class RuntimeMetadata extends MetadataConfig {
private Integer jmxPort;
+ private Integer runtimeIndex;
+
private String rack;
private String endpointMap;
private Long storageClusterId;
- private Long startTimestamp;
- private String clusterName;
+ public String clusterUnique() {
+ return ClusterMetadata.class.getSimpleName() + "-" + this.getClusterId();
+ }
- private Integer status;
+ @Override
+ public boolean isCluster() {
+ return false;
+ }
@Override
- public String getUnique() {
- return host + ":" + port;
+ public String nodeUnique() {
+ return this.host + "-" + this.port;
}
}
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 b85c346..d5173ce 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
@@ -15,25 +15,19 @@
* 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.model.base.BaseRuntimeIdBase;
import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
+import lombok.EqualsAndHashCode;
@Data
-@SuperBuilder
-@NoArgsConstructor
-public class TopicMetadata extends MetadataConfig {
-
- private StoreType storeType;
+@EqualsAndHashCode(callSuper = true)
+public class TopicMetadata extends BaseRuntimeIdBase {
- private String storeAddress;
- //rocketmq -> broker url
- private String connectionUrl;
private String topicName;
@@ -49,8 +43,9 @@ public class TopicMetadata extends MetadataConfig {
private String topicConfig;
+
@Override
- public String getUnique() {
- return topicName;
+ public String nodeUnique() {
+ return this.topicName;
}
}
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/TopicOffsetMetadata.java
similarity index 74%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicOffsetMetadata.java
index 3827f93..5c69506 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/TopicOffsetMetadata.java
@@ -17,25 +17,28 @@
package org.apache.eventmesh.dashboard.common.model.metadata;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GroupMetadata extends MetadataConfig {
+public class TopicOffsetMetadata extends BaseRuntimeIdBase {
+
- private String name;
+ private String offsetRecordType;
- private Integer memberCount;
+ private Long topicId;
- private String members;
+ private String topicName;
- private Integer type;
+ private Long topicOffset;
- private String state;
+ private Integer increaseRate;
@Override
- public String getUnique() {
- return name;
+ public String nodeUnique() {
+ return "";
}
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/AbstractGlobal2Request.java
similarity index 84%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/AbstractGlobal2Request.java
index 82e6c7f..4991274 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/AbstractGlobal2Request.java
@@ -15,12 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
+
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class GlobalRequest {
+@EqualsAndHashCode(callSuper = true)
+public abstract class AbstractGlobal2Request<T> extends Global2Request {
+
+ private T metaData;
- private Long clusterId;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/BaseGlobalResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/BaseGlobalResult.java
index 28d413a..d7dbf05 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/BaseGlobalResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/BaseGlobalResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
public class BaseGlobalResult extends GlobalResult<String> {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/Global2Request.java
similarity index 82%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/Global2Request.java
index 82e6c7f..14a5634 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/Global2Request.java
@@ -15,12 +15,21 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+
import lombok.Data;
@Data
-public class GlobalRequest {
+public class Global2Request {
private Long clusterId;
+
+ private ClusterType clusterType;
+
+ private Long runtimeId;
+
+ private ClusterType runtimeType;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
index d6866a3..2870a57 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
import lombok.AllArgsConstructor;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingAction.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingAction.java
index ce62564..fffc11c 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingAction.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingAction.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
import org.apache.eventmesh.dashboard.common.enums.RemotingType;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingActionType.java
similarity index 90%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingActionType.java
index 82e6c7f..76668dd 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingActionType.java
@@ -15,12 +15,19 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
-import lombok.Data;
+public enum RemotingActionType {
+
+ ADD,
+
+ UPDATE,
+
+ DELETE,
+
+ QUEUE_ALL,
-@Data
-public class GlobalRequest {
+ ;
- private Long clusterId;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingOperate.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingOperate.java
index 39bda20..c6c1052 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingOperate.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingOperate.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting;
public enum RemotingOperate {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java
index e1844ce..6e37bbd 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/CreateAclRequest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.acl;
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
index 8e2b3a4..f60993d 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.acl;
public class CreateAclResponse {
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
index 4e3d6c2..4bc9527 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index 97211b1..382573a 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index f79d7f3..2bf276f 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index db1dbfd..6d76eee 100644
--- 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
@@ -15,6 +15,7 @@
* 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/GetAcls2Request.java
similarity index 84%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAclsRequest.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/acl/GetAcls2Request.java
index 37d78ec..6c8099f 100644
--- 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/GetAcls2Request.java
@@ -15,11 +15,12 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.acl;
-import org.apache.eventmesh.dashboard.common.model.remoting.GlobalRequest;
+import org.apache.eventmesh.dashboard.common.model.remoting.AbstractGlobal2Request;
-public class GetAclsRequest extends GlobalRequest {
+public class GetAcls2Request extends AbstractGlobal2Request<Object> {
}
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
index 95688e2..97d4065 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index 036dcd6..8389741 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.acl;
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
index 2369a24..f856b44 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.client;
public class GetClientRequest {
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
index f19f9e5..17fb22a 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.client;
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
index 340d33a..173a5ab 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.client;
import java.util.concurrent.CompletableFuture;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigRequest.java
index 0f8d3de..5519f6d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigRequest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
import org.apache.eventmesh.dashboard.common.model.remoting.RemotingOperate;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResponse.java
index d951a91..e61b525 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResponse.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResponse.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class AddConfigResponse {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResult.java
index 2af482a..af31a02 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/AddConfigResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class AddConfigResult {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/ConfigType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/ConfigType.java
index 585e932..ec46516 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/ConfigType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/ConfigType.java
@@ -15,8 +15,12 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
+/**
+ *
+ */
public enum ConfigType {
NODE,
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigRequest.java
index c656612..0c9844b 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigRequest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
import org.apache.eventmesh.dashboard.common.model.remoting.RemotingOperate;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResponse.java
index b580d43..138c66d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResponse.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResponse.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class DeleteConfigResponse {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResult.java
index 935fb4d..b3ee9bf 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/DeleteConfigResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class DeleteConfigResult extends AddConfigResult {
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 b24ab36..acb2ac3 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
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 c96809a..d7b4fa7 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
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
index 3fb1053..0086884 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
import java.util.concurrent.CompletableFuture;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigRequest.java
index baae002..17af516 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigRequest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
import org.apache.eventmesh.dashboard.common.model.remoting.RemotingOperate;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResponse.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResponse.java
index 2686df1..7981d30 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResponse.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResponse.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class UpdateConfigResponse {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResult.java
index a3128da..7b24a75 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/config/UpdateConfigResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.config;
public class UpdateConfigResult extends AddConfigResult {
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
index 7117dd9..4ed6b17 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
import org.apache.eventmesh.dashboard.common.model.metadata.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
index 4e149df..1f12f4d 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
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
index e674650..198adf3 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
import java.util.concurrent.CompletableFuture;
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
index a386d7c..81a442c 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
public class GetConnectorRequest {
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
index 4de89a6..d8beee7 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
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
index e21d239..5ba13dd 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.connector;
import java.util.concurrent.CompletableFuture;
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 b41acc3..d2c653a 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.group;
import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
@@ -22,8 +23,10 @@ import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
import java.util.concurrent.CompletableFuture;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
+@EqualsAndHashCode(callSuper = true)
public class GetGroupResult extends GlobalResult<GetGroupsResponse> {
private CompletableFuture<GetGroupsResponse> 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
index 6586fe7..eb4c589 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.group;
public class GetGroupsRequest {
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
index fbe9023..cecc430 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.group;
import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata;
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 96f4b69..3d62e25 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
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
index 3358b89..6d76f40 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
public class GetOffsetResponse {
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
index 2b0a449..4516db6 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
import java.util.concurrent.CompletableFuture;
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 3fa223e..8fc0407 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
@@ -15,15 +15,19 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
import org.apache.eventmesh.dashboard.common.enums.ResetOffsetMode;
+import org.apache.eventmesh.dashboard.common.model.remoting.Global2Request;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class ResetOffsetRequest {
+@EqualsAndHashCode(callSuper = true)
+public class ResetOffsetRequest extends Global2Request {
private Long timestamp;
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 ed1417b..3f8be3f 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
import lombok.Data;
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 3f0773e..cd64d55 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.offset;
import java.util.concurrent.CompletableFuture;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
similarity index 87%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
index de8ac0a..f5a6f34 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
@@ -15,14 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.runtime;
-import org.apache.eventmesh.dashboard.common.model.remoting.GlobalRequest;
+import org.apache.eventmesh.dashboard.common.model.remoting.Global2Request;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class GetRuntimeRequest extends GlobalRequest {
+@EqualsAndHashCode(callSuper = true)
+public class GetRuntime2Request extends Global2Request {
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
index 483a609..6e74132 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.runtime;
import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java
index d0ec3e1..09b74eb 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntimeResult.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.runtime;
import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
@@ -22,8 +23,10 @@ import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
import java.util.concurrent.CompletableFuture;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
+@EqualsAndHashCode(callSuper = true)
public class GetRuntimeResult extends GlobalResult<GetRuntimeResponse> {
private CompletableFuture<GetRuntimeResponse> future;
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
index c5271ff..15149df 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.subscription;
public class GetSubscriptionRequest {
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
index 853675f..3c2e28e 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.subscription;
public class GetSubscriptionResponse {
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
index f5a2215..b5e89f8 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.subscription;
import java.util.concurrent.CompletableFuture;
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/CreateTopic2Request.java
similarity index 74%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopicRequest.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/CreateTopic2Request.java
index a9eb328..5a0e74d 100644
--- 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/CreateTopic2Request.java
@@ -15,27 +15,19 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
-import org.apache.eventmesh.dashboard.common.model.remoting.GlobalRequest;
-
-import com.alibaba.fastjson2.JSONObject;
+import org.apache.eventmesh.dashboard.common.model.remoting.AbstractGlobal2Request;
-import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
@Data
-@NoArgsConstructor
-@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
-public class CreateTopicRequest extends GlobalRequest {
-
- private TopicMetadata topicMetadata;
+public class CreateTopic2Request extends AbstractGlobal2Request<TopicMetadata> {
- private JSONObject topicConfig;
}
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
index d4e4a78..244ead5 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import lombok.AllArgsConstructor;
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
index 9fb6327..0c19d45 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
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
index b2bd216..deecfb4 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
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
index df81875..383c618 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import lombok.AllArgsConstructor;
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
index a340735..a55698b 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
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/GetTopics2Request.java
similarity index 85%
rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopicsRequest.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopics2Request.java
index d9920d8..2178d09 100644
--- 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/GetTopics2Request.java
@@ -15,18 +15,17 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
-import org.apache.eventmesh.dashboard.common.model.remoting.GlobalRequest;
+import org.apache.eventmesh.dashboard.common.model.remoting.Global2Request;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class GetTopicsRequest extends GlobalRequest {
+@EqualsAndHashCode(callSuper = true)
+public class GetTopics2Request extends Global2Request {
private String runtimeHost;
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
index dfe3408..154dd7a 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
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
index debdbdb..1e6c47e 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
import org.apache.eventmesh.dashboard.common.model.remoting.GlobalResult;
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
index 2031153..0a1a1a4 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
import org.apache.eventmesh.dashboard.common.model.metadata.InstanceUserMetadata;
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
index 7d9a79b..403af2c 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
public class CreateUserResponse {
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
index 3e187f2..24356d8 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index a8c1027..02f553f 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
public class DeleteUserResponse {
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
index d6241c2..b9de0e9 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index 30541d7..4771567 100644
--- 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
@@ -15,6 +15,7 @@
* 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
index faccba5..e302289 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
import org.apache.eventmesh.dashboard.common.enums.StoreType;
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
index 8fdf0bc..805f6c1 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
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
index 8014118..2b68396 100644
--- 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
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.model.remoting.user;
import java.util.concurrent.CompletableFuture;
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/AbstractPortValidate.java
similarity index 53%
copy from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/AbstractPortValidate.java
index 4fd39c8..2035eb1 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/AbstractPortValidate.java
@@ -15,26 +15,33 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.core.meta.subscription;
-
-import org.apache.eventmesh.dashboard.common.dto.Result;
-import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo;
-import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore;
+package org.apache.eventmesh.dashboard.common.port;
+import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
-import lombok.extern.slf4j.Slf4j;
+public abstract class AbstractPortValidate implements PortValidate {
-@Slf4j
-public class EtcdSubscriptionCore implements SubscriptionCore {
+ protected List<PortRule> portRules = new ArrayList<>();
- @Override
- public String retrieveConfig(String dataId, String group) {
- return null;
+
+ protected void createNotValid(List<String> portNameList) {
+ AtomicInteger index = new AtomicInteger(0);
+ portNameList.forEach(portName -> {
+ PortRule portRule = PortRule.builder().valid(false).index(index.incrementAndGet()).name(portName).build();
+ this.setPortRules(portRule);
+ });
}
+ protected void setPortRules(PortRule portRule) {
+ this.portRules.add(portRule);
+ }
+
+
@Override
- public Result<List<SubscriptionInfo>> retrieveConfigs(Integer page, Integer size, String dataId, String group) {
- return null;
+ public List<PortRule> portRules() {
+ return portRules;
}
+
}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/NotPortValidate.java
similarity index 53%
copy from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/NotPortValidate.java
index 4fd39c8..d2a7cef 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/NotPortValidate.java
@@ -15,26 +15,34 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.core.meta.subscription;
-
-import org.apache.eventmesh.dashboard.common.dto.Result;
-import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo;
-import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore;
+package org.apache.eventmesh.dashboard.common.port;
import java.util.List;
-import lombok.extern.slf4j.Slf4j;
+public class NotPortValidate extends AbstractPortValidate {
-@Slf4j
-public class EtcdSubscriptionCore implements SubscriptionCore {
- @Override
- public String retrieveConfig(String dataId, String group) {
- return null;
+ public static NotPortValidate builder() {
+ return builder(1);
+ }
+
+ public static NotPortValidate builder(Integer num) {
+ NotPortValidate notPortValidate = new NotPortValidate();
+ notPortValidate.build(num);
+ return notPortValidate;
}
+
+ protected void build(Integer num) {
+ for (int i = 0; i < num; i++) {
+ PortRule rule = PortRule.builder().valid(false).build();
+ this.setPortRules(rule);
+ }
+ }
+
+
@Override
- public Result<List<SubscriptionInfo>> retrieveConfigs(Integer page, Integer size, String dataId, String group) {
- return null;
+ public boolean validate(PortRule lastPortRule, Integer lastPort, PortRule current, Integer port, List<PortRule> portRules) {
+ return false;
}
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/PortRule.java
similarity index 78%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/PortRule.java
index 6052d6c..9c14995 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/PortRule.java
@@ -15,21 +15,24 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model;
+package org.apache.eventmesh.dashboard.common.port;
import lombok.Builder;
import lombok.Data;
+/**
+ * 目前只支持范围获得 port
+ */
@Data
@Builder
-public class SubscriptionInfo {
+public class PortRule {
+
+ private boolean valid;
+
+ private String name;
- // client name
- private String clientName;
+ private Integer index;
- // group name
- private String group;
+ private Integer spanValue;
- // config content
- private String subscription;
}
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/port/PortValidate.java
similarity index 77%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/connector/GetConnectorResponse.java
copy to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/port/PortValidate.java
index 4de89a6..4936477 100644
--- 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/port/PortValidate.java
@@ -15,14 +15,17 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.remoting.connector;
+package org.apache.eventmesh.dashboard.common.port;
+import java.util.List;
-import org.apache.eventmesh.dashboard.common.model.metadata.ConnectorMetadata;
+/**
+ *
+ */
+public interface PortValidate {
-import java.util.List;
-public class GetConnectorResponse {
+ List<PortRule> portRules();
- private List<ConnectorMetadata> connectorList;
+ boolean validate(PortRule lastPortRule, Integer lastPort, PortRule current, Integer port, List<PortRule> portRules);
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java
new file mode 100644
index 0000000..1ab9fc7
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java
@@ -0,0 +1,136 @@
+/*
+ * 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.util;
+
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.util.ClassUtils;
+
+import lombok.Builder;
+import lombok.Data;
+
+
+@Data
+@Builder
+public class ClasspathScanner {
+
+ private Class<?> base;
+
+ private String baseString;
+
+ private String subPath;
+
+
+ private boolean allSubDirectory = true;
+
+ private Set<Class<?>> interfaceSet;
+
+ private String designation;
+
+
+ private Resource[] getResource() throws IOException {
+ PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
+ return resourcePatternResolver.getResources(this.createLocationPattern());
+ }
+
+ public List<Class<?>> getClazz() throws Exception {
+ Resource[] resources = this.getResource();
+ List<Class<?>> resourcesList = new ArrayList<>();
+ for (Resource resource : resources) {
+ if (this.excludeTest(resource)) {
+ continue;
+ }
+ Class<?> clazz = this.createClass(resource);
+ if (Modifier.isAbstract(clazz.getModifiers())) {
+ continue;
+ }
+ if (this.includeInterface(clazz)) {
+ resourcesList.add(clazz);
+ }
+ Class<?>[] innerClass = clazz.getDeclaredClasses();
+ if (ArrayUtils.isEmpty(innerClass)) {
+ continue;
+ }
+ for (Class<?> c : innerClass) {
+ if (this.includeInterface(c)) {
+ resourcesList.add(c);
+ }
+ }
+ }
+ return resourcesList;
+ }
+
+ private boolean excludeTest(Resource resource) throws IOException {
+ return resource.getFile().getPath().indexOf("/target/test-classes/") != -1;
+ }
+
+ private Class<?> createClass(Resource resource) throws IOException, ClassNotFoundException {
+ String path = resource.getURL().getPath();
+ String classPath = path.substring(path.indexOf(this.baseString)).replace("/", ".").replace(".class", "");
+ return Class.forName(classPath);
+ }
+
+ private boolean includeInterface(Class<?> clazz) throws Exception {
+ if (CollectionUtils.isEmpty(this.interfaceSet)) {
+ return true;
+ }
+ Set<Class<?>> classInterfaceSet = ClassUtils.getAllInterfacesForClassAsSet(clazz);
+ for (Class<?> c : this.interfaceSet) {
+ if (classInterfaceSet.contains(c)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private String createLocationPattern() {
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("classpath*:./");
+ this.baseString = base.getPackage().getName().replace('.', '/');
+ stringBuffer.append(this.baseString);
+ stringBuffer.append("/");
+ stringBuffer.append(subPath);
+ if (this.allSubDirectory) {
+ stringBuffer.append("/**");
+ }
+ /**
+ * SDK*.class
+ */
+ if (Objects.isNull(this.designation)) {
+ stringBuffer.append("/*");
+ } else {
+ stringBuffer.append("/");
+ stringBuffer.append(this.designation);
+ }
+ stringBuffer.append(".class");
+ return stringBuffer.toString();
+ }
+}
+
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java
index a9bd0e0..1b37a0d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java
@@ -15,8 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.common.util;
+
+@Deprecated
public class ExceptionUtil {
/**
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/utils/ClusterTypeRelationship.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/utils/ClusterTypeRelationship.java
new file mode 100644
index 0000000..3159cf3
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/utils/ClusterTypeRelationship.java
@@ -0,0 +1,66 @@
+/*
+ * 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.utils;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+public class ClusterTypeRelationship {
+
+ private static final ClusterTypeRelationship INSTANCE = new ClusterTypeRelationship();
+
+ public static ClusterTypeRelationship getInstance() {
+ return INSTANCE;
+ }
+
+
+ private final List<ClusterType> storageClusterTypeList = new ArrayList<>();
+
+ {
+ ClusterType[] clusterTypes = ClusterType.values();
+ for (ClusterType clusterType : clusterTypes) {
+ if (Objects.isNull(clusterType.getEventmeshNodeType())) {
+ break;
+ }
+ for (ClusterType relationshipType : clusterTypes) {
+ if (Objects.isNull(clusterType.getEventmeshNodeType())) {
+ break;
+ }
+ }
+ if (Objects.equals(clusterType.getEventmeshNodeType(), ClusterType.STORAGE)
+ && Objects.equals(clusterType.getAssemblyNodeType(), ClusterType.CLUSTER)) {
+ storageClusterTypeList.add(clusterType);
+ }
+ if (Objects.equals(clusterType.getEventmeshNodeType(), ClusterType.STORAGE)
+ && Objects.equals(clusterType.getAssemblyNodeType(), ClusterType.CLUSTER)) {
+ storageClusterTypeList.add(clusterType);
+ }
+ }
+ }
+
+ public ClusterTypeRelationship() {
+
+ }
+
+ public List<ClusterType> getStorageClusterTypeList() {
+ return storageClusterTypeList;
+ }
+}
diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml
index cdac182..bfe4dc2 100644
--- a/eventmesh-dashboard-console/pom.xml
+++ b/eventmesh-dashboard-console/pom.xml
@@ -16,6 +16,7 @@
~ limitations under the License.
-->
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -30,7 +31,7 @@
<artifactId>eventmesh-dashboard-console</artifactId>
<properties>
- <java.version>1.8</java.version>
+ <java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
@@ -65,11 +66,22 @@
<artifactId>mybatis-dependent</artifactId>
<version>0.1.4</version>
</dependency>
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>druid-spring-boot-starter</artifactId>
+ <version>1.2.21</version>
+ </dependency>
+
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-validation</artifactId>
+ <version>2.6.7</version>
+ </dependency>
<!-- Swagger -->
<dependency>
@@ -85,12 +97,12 @@
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
- <version>1.5.2.Final</version>
+ <version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
- <version>1.5.2.Final</version>
+ <version>1.6.1</version>
</dependency>
<!-- GitHub laohu springmvc(contain spring boot starter)-->
@@ -110,7 +122,7 @@
<dependency>
<groupId>cn.lampup</groupId>
<artifactId>decoration-core</artifactId>
- <version>0.1.7</version>
+ <version>0.1.20</version>
</dependency>
<!-- Unit Test -->
@@ -125,6 +137,24 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-inline</artifactId>
+ <version>5.2.0</version> <!-- 根据项目要求选择版本 -->
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>2.3.232</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mybatis.spring.boot</groupId>
+ <artifactId>mybatis-spring-boot-starter-test</artifactId>
+ <version>2.3.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -134,8 +164,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <source>15</source>
+ <target>15</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
@@ -169,5 +199,12 @@
</plugin>
</plugins>
</build>
+ <repositories>
+ <repository>
+ <id>maven_central</id>
+ <name>Maven Central</name>
+ <url>https://repo.maven.apache.org/maven2/</url>
+ </repository>
+ </repositories>
</project>
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
index 7103aad..d0d6a4f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import lombok.extern.slf4j.Slf4j;
@@ -27,7 +27,6 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@SpringBootApplication
@EnableTransactionManagement
-@EnableAspectJAutoProxy(exposeProxy = true)
public class EventMeshDashboardApplication {
public static void main(String[] args) {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
index efae3a5..46538d1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/annotation/EmLog.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.annotation;
import java.lang.annotation.ElementType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java
index 3b2eb77..fed7d4f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
index 12d33c8..3101405 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.config;
import org.springframework.context.annotation.Bean;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java
new file mode 100644
index 0000000..112a889
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java
@@ -0,0 +1,68 @@
+/*
+ * 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.console.controller;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import lombok.Getter;
+
+
+@Component
+public class ClusterAbitityService {
+
+
+ @Autowired
+ private ClusterService clusterService;
+
+
+ @Value("${console.controller.data.merge:false}")
+ @Getter
+ private boolean merge = false;
+
+
+ /**
+ *
+ * 可以对 topic, group, config ,sub 等做到强制性.offset 无法做到强制一致性
+ *
+ *
+ */
+ @Value("${console.data.forceConsistent:false}")
+ private boolean forceConsistent = false;
+
+
+ public boolean isCAP(ClusterIdDTO clusterIdDTO) {
+ ClusterEntity clusterEntity = this.clusterService.queryClusterById(ClusterControllerMapper.INSTANCE.toClusterEntity(clusterIdDTO));
+ return this.isCAP(clusterEntity);
+ }
+
+ public boolean isCAP(BaseClusterIdEntity baseClusterIdEntity) {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(baseClusterIdEntity.getClusterType());
+ return clusterFramework.isCAP();
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
index 6a4eee1..7fe42b4 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
@@ -15,13 +15,12 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.controller;
+package org.apache.eventmesh.dashboard.console.controller;
-import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.mapstruct.connection.ConnectionControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.dto.connection.AddConnectionDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.CreateConnectionDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.GetConnectionListDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
@@ -29,19 +28,16 @@ import org.apache.eventmesh.dashboard.console.service.cluster.ConnectionDataServ
import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("/cluster/connection")
public class ConnectionController {
- @Autowired
+
private ConnectionDataService connectionDataService;
/**
@@ -50,27 +46,28 @@ public class ConnectionController {
* @param type
* @return
*/
- @GetMapping("/getConnectorBusinessType")
+ @GetMapping("/cluster/connection/getConnectorBusinessType")
public List<String> getConnectorBusinessType(String type) {
return connectionDataService.getConnectorBusinessType(type);
}
- @GetMapping("/getConnectorConfigs")
+ @GetMapping("/cluster/connection/getConnectorConfigs")
public List<ConfigEntity> getConnectorConfigsByClassAndVersion(String version, String classType) {
return connectionDataService.getConnectorConfigsByClassAndVersion(classType, version);
}
- @GetMapping("/showCreateConnectionMessage")
- public AddConnectionEntity showCreateConnectionMessage() {
- return new AddConnectionEntity();
+ @GetMapping("/cluster/connection/showCreateConnectionMessage")
+ public AddConnectionDTO showCreateConnectionMessage() {
+ return new AddConnectionDTO();
}
- @PostMapping("/createConnection")
+ @PostMapping("/cluster/connection/createConnection")
public String createConnection(@Validated @RequestBody CreateConnectionDTO createConnectionDTO) {
try {
- connectionDataService.createConnection(ConnectionControllerMapper.INSTANCE.queryCreateEntityByConnection(createConnectionDTO));
+ connectionDataService.createConnection(createConnectionDTO);
+
} catch (Exception e) {
return e.getMessage();
}
@@ -78,12 +75,12 @@ public class ConnectionController {
}
- @PostMapping("/getConnectionList")
+ @PostMapping("/cluster/connection/getConnectionList")
public List<ConnectionListVO> getConnectionList(@Validated @RequestBody GetConnectionListDTO getConnectionListDTO) {
- return connectionDataService.getConnectionToFrontByCluster(ConnectionControllerMapper.INSTANCE.queryEntityByConnection(getConnectionListDTO));
+ return connectionDataService.getConnectionToFrontByCluster(getConnectionListDTO.getClusterId(), getConnectionListDTO);
}
- @GetMapping("/getConnectorDetail")
+ @GetMapping("/cluster/connection/getConnectorDetail")
public ConnectorEntity getConnectorDetail(Long connectorId) {
return connectionDataService.getConnectorById(connectorId);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java
index bedbbdd..2bdc6fe 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java
@@ -15,14 +15,15 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller;
-import org.apache.eventmesh.dashboard.common.dto.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.druid.stat.DruidStatManagerFacade;
+import com.alibaba.nacos.api.model.v2.Result;
@RestController
public class MetricsController {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java
deleted file mode 100644
index 871e0c5..0000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.console.controller;
-
-import org.apache.eventmesh.dashboard.common.dto.Result;
-import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo;
-import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore;
-
-import java.util.List;
-
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/api/v1")
-public class SubscriptionController {
-
- // the subscription dataId naming pattern of EventMesh clients: ip-protocol
- private static final String CLIENT_DATA_ID_PATTERN = "*.*.*.*-*";
- /**
- * TODO expose implement by FunctionManager
- */
- SubscriptionCore subscriptionCore;
-
- /**
- * Retrieve the config content of a specified config.
- *
- * @param dataId nacos config data id (Exact Matching)
- * @param group config group (Exact Matching)
- * @return config content
- */
- @GetMapping("/subscription")
- public Result<String> retrieveSubscription(@RequestParam("dataId") String dataId, @RequestParam("group") String group) {
- return Result.success(subscriptionCore.retrieveConfig(dataId, group));
- }
-
- /**
- * Retrieve a list of configs.
- *
- * @param page page number
- * @param size page size
- * @param dataId nacos config data id (Fuzzy Matching)
- * @param group config group (Fuzzy Matching)
- * @return config properties and base64 encoded config content
- */
- @GetMapping("/subscriptions")
- public Result<List<SubscriptionInfo>> listSubscriptions(
- @RequestParam(name = "page", defaultValue = "1") Integer page,
- @RequestParam(name = "size", defaultValue = "10") Integer size,
- @RequestParam(name = "dataId", defaultValue = CLIENT_DATA_ID_PATTERN) String dataId,
- @RequestParam(name = "group", defaultValue = "") String group) {
- return Result.success(subscriptionCore.retrieveConfigs(page, size, dataId, group));
- }
-}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/AclController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/AclController.java
index e4947c3..a336969 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/AclController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/AclController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.AclEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
index 258496c..dbfe803 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
@@ -15,12 +15,12 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClientEntity;
-import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClientDataControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.cluster.client.SelectByClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.client.QueryClientByUserFormDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClientDataService;
import java.util.List;
@@ -41,8 +41,8 @@ public class ClientDataController {
private ClientDataService clientDataService;
- @PostMapping("selectByClusterId")
- public List<ClientEntity> selectByClusterId(@RequestBody @Validated SelectByClusterIdDTO selectByClusterIdDTO) {
- return clientDataService.selectByClusterId(ClientDataControllerMapper.INSTANCE.selectByClusterIdDTO(selectByClusterIdDTO));
+ @PostMapping("queryClientByUserForm")
+ public List<ClientEntity> queryClientByUserForm(@RequestBody @Validated QueryClientByUserFormDTO queryClientByUserFormDTO) {
+ return clientDataService.queryClientByUserForm(queryClientByUserFormDTO);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
index 863655b..416d613 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
@@ -15,14 +15,26 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClientEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterDTO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.client.QueryClientByUserFormDTO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.ClusterDetailsVO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryClusterByOrganizationIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryRelationClusterByClusterIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
import org.apache.eventmesh.dashboard.console.modle.vo.cluster.GetClusterBaseMessageVO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@@ -32,72 +44,75 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-/**
- * 1. 用户首页列表
- * 2. 集群首页概要
- */
+
@RestController
-@RequestMapping("cluster")
+@RequestMapping("user/cluster")
public class ClusterController {
@Autowired
- ClusterService clusterService;
+ private ClusterService clusterService;
+
+ @Autowired
+ public RuntimeService runtimeService;
+
@GetMapping("queryHomeClusterData")
public GetClusterBaseMessageVO queryHomeClusterData(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
- return clusterService.selectClusterBaseMessage(clusterIdDTO.getClusterId());
+ return clusterService.getClusterBaseMessage(clusterIdDTO);
}
-
- @PostMapping("createCluster")
- public void createCluster(@RequestBody CreateClusterDTO createClusterDTO) {
- this.clusterService.createCluster(ClusterControllerMapper.INSTANCE.createCluster(createClusterDTO));
+ @PostMapping("queryClusterDetails")
+ public ClusterDetailsVO queryClusterDetails(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
+ ClusterEntity clusterEntity = new ClusterEntity();
+ // eventmesh 集群详情
+ // 基本统计信息
+ // 部署信息,巡查信息
+ // meta 列表, runtime 列表 存储列表
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterIdDTO.getClusterId());
+ CompletableFuture<ClusterAllMetadataDO> completableFuture =
+ CompletableFuture.supplyAsync(() -> this.runtimeService.queryAllByClusterId(runtimeEntity, true, false));
+
+ // 存储集群详情
+ // meta 集群详情
+ // runtime集群详情
+ ClusterDetailsVO clusterDetailsVO = new ClusterDetailsVO();
+ return clusterDetailsVO;
}
- /**
- * 那些集群可以暂停。被依赖的集群不允许暂停。暂停的含义是什么 暂停是否释放资源
- *
- * @return
- */
- public Integer pauseCluster() {
- // 查询集群
-
- // 判断集群类型
- // 查询依赖
+ @PostMapping("queryClusterByUserForm")
+ public List<ClientEntity> queryClusterByUserForm(QueryClientByUserFormDTO queryClientByUserFormDTO) {
return null;
}
/**
- * 重新开始集群
+ * 这个接口用户 cluster 对应业务的 首页,方便查询
*
+ * @param dto
* @return
*/
- public Integer resumeCluster() {
- // 查询集群
-
- // 判断集群类型
+ @PostMapping("queryVisualizationClusterByOrganizationIdAndType")
+ public List<ClusterEntity> queryVisualizationClusterByOrganizationIdAndType(@RequestBody @Validated QueryClusterByOrganizationIdAndTypeDTO dto) {
+ return this.clusterService.queryClusterByOrganizationIdAndType(ClusterControllerMapper.INSTANCE.queryClusterByOrganizationIdAndType(dto));
+ }
- // 查询依赖
- return null;
+ @PostMapping("queryClusterByOrganizationIdAndType")
+ public List<ClusterEntity> queryClusterByOrganizationIdAndType(@RequestBody @Validated QueryClusterByOrganizationIdAndTypeDTO dto) {
+ return this.clusterService.queryClusterByOrganizationIdAndType(ClusterControllerMapper.INSTANCE.queryClusterByOrganizationIdAndType(dto));
}
/**
- * 注销集群
+ * 查询 cluster 的关联集群列表
*
+ * @param dto
* @return
*/
- public Integer cancelCluster() {
- // 查询集群
-
- // 判断集群类型
-
- // 查询依赖
-
- // 如果是全程托管,释放k8s 集群
- return null;
+ @PostMapping("queryRelationClusterByClusterIdAndType")
+ public List<ClusterEntity> queryRelationClusterByClusterIdAndType(@RequestBody @Validated QueryRelationClusterByClusterIdAndTypeDTO dto) {
+ return this.clusterService.queryRelationClusterByClusterIdAndType(
+ ClusterControllerMapper.INSTANCE.queryRelationClusterByClusterIdAndType(dto));
}
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
index 9dba50f..20734eb 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterAndRelationshipEntity;
@@ -37,13 +38,14 @@ public class ClusterRelationshipController {
@Autowired
private ClusterRelationshipService clusterRelationshipService;
-
+ @Deprecated
@PostMapping("addClusterRelationshipEntry")
public void addClusterRelationshipEntry(@RequestBody ClusterRelationshipEntity clusterRelationshipEntity) {
- this.clusterRelationshipService.insertClusterRelationshipEntry(clusterRelationshipEntity);
+ this.clusterRelationshipService.addClusterRelationshipEntry(clusterRelationshipEntity);
}
+ @Deprecated
@PostMapping("relieveRelationship")
public Integer relieveRelationship(@RequestBody ClusterRelationshipEntity clusterRelationshipEntity) {
return this.clusterRelationshipService.relieveRelationship(clusterRelationshipEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
similarity index 57%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
index 38d3fe5..ca84a3d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
@@ -17,23 +17,41 @@
package org.apache.eventmesh.dashboard.console.controller.cluster;
-
-import org.apache.eventmesh.dashboard.console.entity.cluster.NetConnectionEntity;
-
-import java.util.List;
+import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("netConnection")
-public class NetConnectionController {
+@RequestMapping("/organization/")
+public class DetailsController {
+
+
+ @PostMapping("/details/eventMesh")
+ public void eventMeshDetails(ClusterIdDTO clusterIdDTO) {
+ // eventmesh 集群详情
+ // 基本统计信息
+ // 部署信息,巡查信息
+ // meta 列表, runtime 列表 存储列表
+ // 存储集群详情
+ // meta 集群详情
+ // runtime集群详情
+ }
+
+ @PostMapping("/details/meta")
+ public void metaDetails(ClusterIdDTO clusterIdDTO) {
+
+ }
+
+ @PostMapping("/details/storage")
+ public void storageDetails(ClusterIdDTO clusterIdDTO) {
+
+ }
+ @PostMapping("/details/storage/runtime")
+ public void storageRuntimeDetails(ClusterIdDTO clusterIdDTO) {
- @PostMapping("")
- public List<NetConnectionEntity> queryNetConnectionEntityListByFrom(NetConnectionEntity netConnectionEntity) {
- return null;
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java
new file mode 100644
index 0000000..11861dc
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java
@@ -0,0 +1,94 @@
+/*
+ * 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.console.controller.cluster;
+
+
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+
+public class HomeController {
+
+
+ private ClusterService clusterService;
+
+
+
+ public void clusterHome(){
+ // 运维事件
+
+ // runtime 集群 以及
+
+ // meta 集群 以及
+
+ // 存储集群
+
+ // kubernetes 列表。 本集群 没有或则资源不够,找上级集群。如果有多个上级
+
+ // 下面的是否需要展示
+ // client
+
+ // group 列表 topic 列表。是否需要在 home 展示
+
+ // 连接
+ }
+
+ public void runtimeHome(){
+ // 在哪个 cluster
+
+ // 在哪一个 kubernetes
+
+ // message 统计
+
+ // in out 统计
+
+ // topic 统计数据
+
+ // group 统计数据
+
+ // client 统计数据
+
+ // 连接 统计数据
+
+ // 实例资源统计数据
+ }
+
+
+ public void groupHome(){
+ // cluster
+
+ // topic
+
+ // client
+
+ //
+ }
+
+ public void topicHome(){
+
+ }
+
+ public void clientHome(){
+
+ }
+
+
+ public void userHome(){
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/InstanceUserController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/InstanceUserController.java
deleted file mode 100644
index e95208e..0000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/InstanceUserController.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.console.controller.cluster;
-
-import org.apache.eventmesh.dashboard.console.entity.cluster.InstanceUserEntity;
-import org.apache.eventmesh.dashboard.console.service.cluster.InstanceUserService;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/instanceUser")
-public class InstanceUserController {
-
- @Autowired
- private InstanceUserService instanceUserService;
-
- @PostMapping("/insertInstanceUser")
- public void insertInstanceUser(@RequestBody InstanceUserEntity instanceUserEntity) {
- this.instanceUserService.insert(instanceUserEntity);
- }
-
- @PostMapping("/deleteInstanceUserByCluster")
- public void deleteInstanceUserByCluster(@RequestBody InstanceUserEntity instanceUserEntity) {
- this.instanceUserService.deleteInstanceUserByCluster(instanceUserEntity);
- }
-
- @PostMapping("/updateNameById")
- public void updateNameById(@RequestBody InstanceUserEntity instanceUserEntity) {
- this.instanceUserService.updatePasswordById(instanceUserEntity);
- }
-
- @PostMapping("/selectAll")
- public void selectAll() {
-
- }
-
- @PostMapping("/selectById")
- public void selectById(@RequestBody InstanceUserEntity instanceUserEntity) {
- this.instanceUserService.selectById(instanceUserEntity);
- }
-
- @PostMapping("/selectByName")
- public void selectByName(@RequestBody InstanceUserEntity instanceUserEntity) {
- this.instanceUserService.selectByName(instanceUserEntity);
- }
-
-}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java
index 38d3fe5..552d39c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/NetConnectionController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
index fe6647d..6f7ba10 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
@@ -44,7 +45,7 @@ public class RuntimeController {
@PostMapping("/queryRuntimeListByClusterId")
public List<RuntimeEntity> queryRuntimeListByClusterId(@Validated @RequestBody ClusterIdDTO clusterIdDTO) {
List<RuntimeEntity> runtimeEntityList =
- runtimeService.selectRuntimeToFrontByClusterId(RuntimeControllerMapper.INSTANCE.queryRuntimeListByClusterId(clusterIdDTO));
+ runtimeService.queryRuntimeToFrontByClusterId(RuntimeControllerMapper.INSTANCE.queryRuntimeListByClusterId(clusterIdDTO));
runtimeEntityList.forEach(n -> {
n.setStatus(CheckResultCache.getINSTANCE().getLastHealthyCheckResult("runtime", n.getId()));
});
@@ -57,53 +58,5 @@ public class RuntimeController {
return this.runtimeService.queryRuntimeEntityById(RuntimeControllerMapper.INSTANCE.queryRuntimeListById(idDTO));
}
- @PostMapping("/createRuntime")
- public void crateRuntime(@Validated @RequestBody RuntimeEntity runtimeEntity) {
- runtimeService.insertRuntime(runtimeEntity);
- }
-
- /**
- * 那些集群可以暂停。被依赖的集群不允许暂停。暂停的含义是什么
- * 暂停是否释放资源
- * @return
- */
- public Integer pauseCluster() {
- // 查询集群
-
- // 判断集群类型
-
- // 查询依赖
- return null;
- }
-
- /**
- * 重新开始集群
- * @return
- */
- public Integer resumeCluster() {
- // 查询集群
-
- // 判断集群类型
-
- // 查询依赖
- return null;
- }
-
- /**
- * 注销集群
- * @return
- */
- public Integer cancelCluster() {
- // 查询集群
-
- // 判断集群类型
-
- // 查询依赖
-
- // 如果是全程托管,释放k8s 集群
- return null;
- }
-
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
similarity index 52%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
index f8f1944..14b2818 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
@@ -15,33 +15,57 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.controller.message;
+package org.apache.eventmesh.dashboard.console.controller.deploy;
-import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
-import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
+
+import org.apache.eventmesh.dashboard.console.entity.cases.CaseEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.CaseControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.IdDTO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.cases.QueryCaseByObjectTypeDTO;
import java.util.List;
-import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("groupRelationship")
-public class GroupRelationshipController {
+@RequestMapping("case")
+public class CaseController {
+ public List<CaseEntity> queryCaseByObjectType(@RequestBody QueryCaseByObjectTypeDTO queryCaseByObjectTypeDTO) {
+ CaseControllerMapper.INSTANCE.queryCaseByObjectType(queryCaseByObjectTypeDTO);
+ return null;
+ }
- public List<TopicEntity> queryTopicByGroupId(@RequestBody @Validated IdDTO idDTO) {
+ public Integer deleteCase(@RequestBody IdDTO idDTO) {
+ return 0;
+ }
+ public List<CaseEntity> queryCaseByOrganization() {
return null;
}
- public List<GroupEntity> queryGroupByTopicId(@RequestBody @Validated IdDTO idDTO) {
- return null;
+
+ public void backups(){
+
+ }
+
+ public void createCase(@RequestBody CaseEntity caseEntity) {
+ // 新增,状态进行中信
+
+ try {
+ // clone object 数据
+
+ // 标记成功
+ } catch (Exception e) {
+ // 回滚 标记失败
+ throw new RuntimeException(e);
+ }
+
+
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java
new file mode 100644
index 0000000..c805861
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java
@@ -0,0 +1,192 @@
+/*
+ * 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.console.controller.deploy;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterOwnType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateClusterByDeployScriptHandler;
+import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateRuntimeByDeployScriptHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.cluster.VerifyNameDTO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByDeployScriptDO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByEventMesh;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByDeployScriptDTO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByOnlyDataDO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 1. 用户首页列表
+ * <p>
+ * 2. 集群首页概要 kubernetes 集群在 eventmesh 集群里面创建的 只属于这个集群 kubernetes在创建的时候可以设为独立集群 如果创建集群
+ * <p>
+ * 1. 全托管创建 因为全托管创建,不需要用户管理任何东西。
+ * <p>
+ * 2. 全托管共享集群 创建时绑定集群流程
+ * <p>
+ * 1.创建 kubernetes 集群
+ * <p>
+ * 2. 创建 storage 集群
+ * <p>
+ * 3. 创建 meta 集群
+ * <p>
+ * 4. 创建 runtime 集群
+ * <p>
+ * 5. 创建时 进行绑定 3. 已经 deploy config 创建,比较麻烦。这种 kubernetes 资源不会共享
+ * <p>
+ * 1. 提供 kubernetes集群配置,多个
+ * <p>
+ * 2. 选择 storage deploy config or storage id or name
+ * <p>
+ * 3. 选择 meta deploy config or meta id or name
+ * <p>
+ * 4. 选择 runtime deploy config or runtime idor name
+ * <p>
+ * 5. 点击 创建,提供部署流程 4. 先创建,后绑定
+ * <p>
+ * 1. 直接创建
+ * <p>
+ * 2. 在内部进行绑定 5. 配置一个kubernetes集群,可以定时校验 deploy config 的效果。校验的目的是什么 创建节点的时候,先看自己生是否有 kubernetes。 然后检查上级cluster 是否有 可用的 kubernetes
+ */
+@RestController
+@RequestMapping("organization/clusterCycleDeploy")
+public class ClusterCycleController {
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private CreateRuntimeByDeployScriptHandler createRuntimeByDeployScriptHandler;
+
+
+ @Autowired
+ private CreateClusterByDeployScriptHandler createClusterByDeployScriptHandler;
+
+
+ /**
+ * @param verifyNameDTO
+ * @return
+ */
+ public String verifyName(VerifyNameDTO verifyNameDTO) {
+
+ return "";
+ }
+
+ @PostMapping("createRuntimeByOnlyDataHandler")
+ public void createRuntimeByOnlyDataHandler(@RequestBody @Validated CreateRuntimeByOnlyDataDO createRuntimeByOnlyDataDO) {
+ RuntimeEntity runtimeEntity = ClusterCycleControllerMapper.INSTANCE.createRuntimeByOnlyDataHandler(createRuntimeByOnlyDataDO);
+ runtimeService.insertRuntime(runtimeEntity);
+ }
+
+ @PostMapping("createRuntimeByDeployScript")
+ public void createRuntimeByDeployScript(@RequestBody @Validated CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDTO) {
+ this.createRuntimeByDeployScriptHandler.handler(createRuntimeByDeployScriptDTO);
+ }
+
+ @PostMapping("createClusterByDeployScript")
+ public void createClusterByDeployScript(@RequestBody @Validated CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
+ this.createClusterByDeployScriptHandler.handler(createClusterByDeployScriptDO);
+ }
+
+ /**
+ * 分 eventmesh 集群创建
+ *
+ * @param createClusterByEventMesh
+ */
+ @PostMapping("createEventMeshClusterByOnlyData")
+ public Long createEventMeshClusterByOnlyData(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ ClusterEntity clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByEventMesh(createClusterByEventMesh);
+ clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
+ clusterEntity.setClusterOwnType(ClusterOwnType.NOT);
+ clusterEntity.setAuthType("");
+ clusterEntity.setVersion("");
+ clusterEntity.setRuntimeIndex(0);
+ clusterEntity.setTrusteeshipType(ClusterTrusteeshipType.NOT);
+ clusterEntity.setFirstToWhom(FirstToWhom.NOT);
+ clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
+ clusterEntity.setResourcesConfigId(0L);
+ clusterEntity.setDeployScriptId(0L);
+ clusterEntity.setDeployScriptName("");
+ clusterEntity.setDeployScriptVersion("");
+ clusterService.insertCluster(clusterEntity);
+ return clusterEntity.getId();
+ }
+
+ @PostMapping("createClusterByEventMesh")
+ public Long createClusterByEventMesh(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ ClusterEntity clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByEventMesh(createClusterByEventMesh);
+ clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
+ clusterEntity.setClusterOwnType(ClusterOwnType.INDEPENDENCE);
+ clusterEntity.setAuthType("");
+ clusterEntity.setVersion("");
+ clusterEntity.setRuntimeIndex(0);
+ clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
+ clusterEntity.setResourcesConfigId(0L);
+ clusterEntity.setDeployScriptId(0L);
+ clusterEntity.setDeployScriptName("");
+ clusterEntity.setDeployScriptVersion("");
+ ClusterRelationshipEntity relationshipEntity = new ClusterRelationshipEntity();
+ clusterService.insertClusterAndRelationship(clusterEntity, relationshipEntity);
+ return clusterEntity.getId();
+
+ }
+
+
+ @PostMapping("pauseCluster")
+ public void pauseCluster(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+ @PostMapping("pauseRuntime")
+ public void pauseRuntime(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+ @PostMapping("relationship")
+ public void relationship(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+ @PostMapping("unrelationship")
+ public void unrelationship(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+ @PostMapping("uninstallCluster")
+ public void uninstallCluster(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+ @PostMapping("uninstallRuntime")
+ public void uninstallRuntime(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java
new file mode 100644
index 0000000..6345dc8
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java
@@ -0,0 +1,272 @@
+/*
+ * 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.console.controller.deploy;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.common.enums.SyncErrorType;
+import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterMetadataDomain;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterByCompleteDataDTO;
+import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterBySimpleDataDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.service.connector.ResourcesConfigService;
+import org.apache.eventmesh.dashboard.console.service.deploy.DeployScriptService;
+import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+@Component
+@Slf4j
+public class CreateCycleService {
+
+ @Autowired
+ private ConfigService configService;
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @Autowired
+ private ClusterRelationshipService clusterRelationshipService;
+
+ @Autowired
+ private ResourcesConfigService resourcesConfigService;
+
+ @Autowired
+ private DeployScriptService deployScriptService;
+
+
+ @Autowired
+ private ClusterMetadataDomain clusterMetadataDomain;
+
+ private ClusterEntity clusterEntity;
+
+
+ private void verifyName() {
+ if (!this.clusterService.nameExist(this.clusterEntity)) {
+ //
+ }
+ }
+
+ private void createDevOps() {
+
+ }
+
+ private void createCLusterEntity() {
+
+ }
+
+ private void createRuntimeEntity() {
+
+ }
+
+ private void createRuntimeConfig() {
+
+ }
+
+ private void persistenceData() {
+
+ }
+
+ private void lockPost() {
+ // 获得端口
+
+ //
+ }
+
+ private void checkResource() {
+
+ }
+
+ private void lockResource() {
+
+ }
+
+
+ private void createInstance() {
+ // 然后通知,检查
+ }
+
+
+ private void createCluster(Long configGatherId) {
+ this.verifyName();
+ this.clusterService.createCluster(clusterEntity);
+ if (Objects.nonNull(configGatherId)) {
+ this.configService.copyConfig(configGatherId, clusterEntity.getId());
+ }
+ }
+
+ public ClusterEntity createClusterBySimpleData(CreateClusterBySimpleDataDTO createClusterBySimpleDataDTO) {
+ clusterEntity = ClusterControllerMapper.INSTANCE.createCluster(createClusterBySimpleDataDTO);
+ this.createCluster(createClusterBySimpleDataDTO.getConfigGatherId());
+ return clusterEntity;
+ }
+
+ public void createClusterByCompleteData(CreateClusterByCompleteDataDTO createClusterByCompleteDataDTO) {
+ // 对进群进行判断,kafka broker 集群,只能有一个
+ // eventmesh 集群,目前只支持一个 meta, 一个runtime, 一个存储。
+
+ // 创建 部署流程
+ // 集群名字是否存在
+ ClusterEntity clusterEntity = this.createClusterBySimpleData(createClusterByCompleteDataDTO);
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(createClusterByCompleteDataDTO.getClusterType());
+ if (clusterFramework.isMainSlave()) {
+ this.createMainSlave(createClusterByCompleteDataDTO);
+ } else {
+ this.createNotMainSlave(createClusterByCompleteDataDTO);
+ }
+ }
+
+ public void createClusterByConfigData(CreateClusterBySimpleDataDTO createClusterBySimpleDataDTO) {
+ // 创建 部署流程
+ // 集群名字是否存在
+ // 创建 config 里面所有数据
+ // 检查资源
+ // 锁定资源
+ // 锁定 端口
+ // 组个调用 kubernetes 创建资源
+ // 检查
+ // 失败,释放资源,端口,删除 kubernetes内容
+ }
+
+ private void createNotMainSlave(CreateClusterByCompleteDataDTO createClusterByCompleteDataDTO) {
+ ClusterEntity clusterEntity = this.createClusterBySimpleData(createClusterByCompleteDataDTO);
+ List<RuntimeEntity> runtimeEntityList = new ArrayList<>();
+ for (int i = 0; i < createClusterByCompleteDataDTO.getCreateNum(); i++) {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterEntity.getId());
+ runtimeEntity.setClusterType(clusterEntity.getClusterType());
+ runtimeEntity.setTrusteeshipType(ClusterTrusteeshipType.SELF);
+ runtimeEntity.setFirstToWhom(clusterEntity.getFirstToWhom());
+ runtimeEntity.setFirstSyncState(clusterEntity.getFirstSyncState());
+ runtimeEntity.setSyncErrorType(clusterEntity.getSyncErrorType());
+ runtimeEntity.setReplicationType(ReplicationType.NOT);
+ runtimeEntityList.add(runtimeEntity);
+ }
+ }
+
+ public void createMainSlave(CreateClusterByCompleteDataDTO createClusterByCompleteDataDTO) {
+ List<ClusterEntity> clusterEntityList = new ArrayList<>();
+ for (int i = 0; i < createClusterByCompleteDataDTO.getCreateNum(); i++) {
+ ClusterEntity newCluster = ClusterControllerMapper.INSTANCE.createCluster(createClusterByCompleteDataDTO);
+ newCluster.setTrusteeshipType(ClusterTrusteeshipType.SELF);
+ newCluster.setFirstToWhom(FirstToWhom.COMPLETE);
+ newCluster.setFirstSyncState(FirstToWhom.COMPLETE);
+ newCluster.setSyncErrorType(SyncErrorType.NOT);
+ newCluster.setReplicationType(ReplicationType.NOT);
+ clusterEntityList.add(newCluster);
+ }
+ List<RuntimeEntity> runtimeEntityList = new ArrayList<>();
+ clusterEntityList.forEach(entity -> {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(entity.getId());
+ runtimeEntity.setClusterType(entity.getClusterType());
+ runtimeEntity.setTrusteeshipType(ClusterTrusteeshipType.SELF);
+ runtimeEntity.setFirstToWhom(entity.getFirstToWhom());
+ runtimeEntity.setFirstSyncState(entity.getFirstSyncState());
+ runtimeEntity.setSyncErrorType(entity.getSyncErrorType());
+ runtimeEntity.setReplicationType(ReplicationType.MAIN);
+
+ runtimeEntityList.add(runtimeEntity);
+ if (Objects.equals(createClusterByCompleteDataDTO.getReplicationType(), ReplicationType.MAIN_SLAVE)) {
+ runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(entity.getId());
+ runtimeEntity.setClusterType(entity.getClusterType());
+ runtimeEntity.setTrusteeshipType(entity.getTrusteeshipType());
+ runtimeEntity.setFirstToWhom(entity.getFirstToWhom());
+ runtimeEntity.setFirstSyncState(entity.getFirstSyncState());
+ runtimeEntity.setSyncErrorType(entity.getSyncErrorType());
+ runtimeEntity.setReplicationType(ReplicationType.SLAVE);
+ runtimeEntityList.add(runtimeEntity);
+ }
+ });
+ runtimeEntityList.forEach(entity -> {
+ ClusterType clusterType = entity.getClusterType();
+ Map<String, Object> portMap = new HashMap<>();
+
+ portMap.forEach((key, value) -> {
+
+ });
+ });
+
+
+ }
+
+ public void registerRuntime(RuntimeEntity runtimeEntity) {
+ this.runtimeService.insertRuntime(runtimeEntity);
+ }
+
+ public void createRuntime() {
+ // 创建 部署流程
+
+ // 创建 runtime
+
+ // 判断是否 有模板
+
+ // 获得 cluster 默认模板
+
+ // 创建 config 里面所有数据
+ // 持久化数据
+ // 检查资源
+ // 锁定资源
+ // 需要一个被 console 管理的端口,所以要 锁定 端口
+ //
+ }
+
+
+ // TODO 添加修改绑定解绑 meta 集群,都需要 所有的 runtime集群。是通过事件方式处理还是立即处理?
+ // IP 管理
+ // 配置写入,
+ // 可动态修改配置(可以在线修改),
+ // 不可能动态修改配置,修改 yaml 重新启动容器,是否支持灰度修改
+ // 配置末班, a 配置 1, 变成2
+ // meta deployment
+ // 存储 StatefulSet 暴露端口 hostIP
+ // 是否直接暴露端口, 是否使用 service。 每次只能穿件一个 实例
+ // 1. jmx
+ // 2. nameservice 负载不太均匀问题
+ // 3. eventmesh runtime admin
+ // broker + queue
+ // 磁盘,
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
similarity index 51%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
index f8f1944..5fd7996 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
@@ -15,33 +15,39 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.controller.message;
+package org.apache.eventmesh.dashboard.console.controller.deploy;
-import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
-import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
+import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ResourceConfigControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.IdDTO;
+import org.apache.eventmesh.dashboard.console.modle.OrganizationIdDTO;
+import org.apache.eventmesh.dashboard.console.modle.deploy.resouce.QueryResourceByObjectTypeDTO;
import java.util.List;
-import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("groupRelationship")
-public class GroupRelationshipController {
+@RequestMapping("resourcesConfig")
+public class ResourcesConfigController {
-
- public List<TopicEntity> queryTopicByGroupId(@RequestBody @Validated IdDTO idDTO) {
-
+ public List<ResourcesConfigEntity> queryResourcesConfigByObjectType(
+ @RequestBody QueryResourceByObjectTypeDTO queryResourcesConfigByObjectTypeDTO) {
+ ResourcesConfigEntity resourcesConfigEntity =
+ ResourceConfigControllerMapper.INSTANCE.queryResourcesConfigByObjectType(queryResourcesConfigByObjectTypeDTO);
return null;
}
- public List<GroupEntity> queryGroupByTopicId(@RequestBody @Validated IdDTO idDTO) {
- return null;
+ public Integer deleteResourcesConfig(@RequestBody IdDTO idDTO) {
+ // 作废之前检查,是否使用过
+ return 0;
}
+ public List<ResourcesConfigEntity> queryResourcesConfigByOrganization(OrganizationIdDTO organizationIdDTO) {
+ return null;
+ }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java
new file mode 100644
index 0000000..95ef6d0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java
@@ -0,0 +1,144 @@
+/*
+ * 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.console.controller.deploy.create;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByDeployScriptDO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
+
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.List;
+import java.util.Objects;
+
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class CreateClusterByDeployScriptHandler implements UpdateHandler<CreateClusterByDeployScriptDO> {
+
+ private ClusterService clusterService;
+
+ private ConfigService configService;
+
+ private RuntimeService runtimeService;
+
+ private ClusterRelationshipService clusterRelationshipService;
+
+ private ClusterEntity clusterEntity;
+
+ private ClusterFramework clusterFramework;
+
+ private ClusterType clusterType;
+
+ private ReplicationType replicationType;
+
+
+ private final List<RuntimeEntity> runtimeEntityList = new ArrayList<>();
+
+ @Override
+ public void init() {
+
+ }
+
+ private void handlerMetadata(ClusterEntity clusterEntity) {
+ this.clusterType = clusterEntity.getClusterType();
+ this.replicationType = clusterEntity.getReplicationType();
+ this.clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
+ }
+
+ @Override
+ public void handler(CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
+ this.clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByDeployScript(createClusterByDeployScriptDO);
+
+ this.clusterService.insertCluster(this.clusterEntity);
+ this.handlerMetadata(this.clusterEntity);
+ if (Objects.nonNull(createClusterByDeployScriptDO.getConfigGatherId())) {
+ configService.copyConfig(createClusterByDeployScriptDO.getConfigGatherId(), this.clusterEntity.getId());
+ }
+ if (this.clusterFramework.isMainSlave()) {
+ this.mainSlaveHandler(createClusterByDeployScriptDO, this.clusterEntity);
+ } else {
+ this.ordinaryRuntime(createClusterByDeployScriptDO);
+ }
+
+ this.runtimeService.batchInsert(this.runtimeEntityList);
+ }
+
+ private void ordinaryRuntime(CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
+ Deque<Integer> linkedList = null;
+ if (this.clusterType.isStorage()) {
+ clusterEntity.setRuntimeIndex(createClusterByDeployScriptDO.getCreateNum());
+ linkedList = this.clusterService.getIndex(this.clusterEntity);
+ }
+ for (int i = 0; i < createClusterByDeployScriptDO.getCreateNum(); i++) {
+ this.createRuntimeEntity(this.clusterEntity, replicationType,
+ Objects.isNull(linkedList) ? Integer.valueOf(0) : linkedList.pop());
+ }
+ }
+
+ private void mainSlaveHandler(CreateClusterByDeployScriptDO createClusterByDeployScriptDO, ClusterEntity clusterEntity) {
+ List<ClusterEntity> clusterEntityList = new ArrayList<>();
+ for (int i = 0; i < createClusterByDeployScriptDO.getCreateNum(); i++) {
+ ClusterEntity newClusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByDeployScript(createClusterByDeployScriptDO);
+ clusterEntityList.add(newClusterEntity);
+ }
+ this.clusterService.batchInsert(clusterEntityList, clusterEntity);
+ clusterEntityList.forEach(entity -> {
+ this.createRuntimeEntity(clusterEntity, ReplicationType.MAIN, 0);
+ if (createClusterByDeployScriptDO.getReplicationType().isMainSlave()) {
+ this.createRuntimeEntity(clusterEntity, ReplicationType.SLAVE, 1);
+ }
+ });
+ }
+
+ private void createRuntimeEntity(ClusterEntity clusterEntity, ReplicationType replicationType, int index) {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterEntity.getClusterId());
+ runtimeEntity.setClusterType(clusterEntity.getClusterType());
+ runtimeEntity.setDeployScriptId(clusterEntity.getDeployScriptId());
+ runtimeEntity.setResourcesConfigId(clusterEntity.getResourcesConfigId());
+ runtimeEntity.setFirstToWhom(FirstToWhom.NOT);
+ runtimeEntity.setTrusteeshipType(ClusterTrusteeshipType.SELF);
+ runtimeEntity.setName(clusterEntity.getName() + "_" + index);
+ runtimeEntity.setHost("127.0.0.1");
+ runtimeEntity.setPort(8080);
+ runtimeEntity.setReplicationType(replicationType);
+ runtimeEntity.setRuntimeIndex(index);
+ runtimeEntity.setDeployStatusType(DeployStatusType.CREATE_FULL_WAIT);
+ this.runtimeEntityList.add(runtimeEntity);
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java
new file mode 100644
index 0000000..f069152
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java
@@ -0,0 +1,97 @@
+/*
+ * 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.console.controller.deploy.create;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
+import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByDeployScriptDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.Objects;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class CreateRuntimeByDeployScriptHandler implements UpdateHandler<CreateRuntimeByDeployScriptDTO> {
+
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDTO) {
+ ClusterEntity clusterEntity = ClusterControllerMapper.INSTANCE.toClusterEntity(createRuntimeByDeployScriptDTO);
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+ RuntimeEntity runtimeEntity = ClusterCycleControllerMapper.INSTANCE.createRuntimeByDeployScript(createRuntimeByDeployScriptDTO);
+ if (Objects.isNull(runtimeEntity.getDeployScriptId()) && Objects.isNull(clusterEntity.getDeployScriptId())) {
+ return;
+ }
+
+ if (Objects.isNull(runtimeEntity.getResourcesConfigId()) && Objects.isNull(clusterEntity.getResourcesConfigId())) {
+ return;
+ }
+ if (Objects.nonNull(runtimeEntity.getDeployScriptId())) {
+ runtimeEntity.setDeployScriptId(createRuntimeByDeployScriptDTO.getDeployScriptId());
+ }
+
+ if (Objects.nonNull(runtimeEntity.getResourcesConfigId())) {
+ runtimeEntity.setResourcesConfigId(createRuntimeByDeployScriptDTO.getResourcesConfigId());
+ }
+ ReplicationType replicationType = createRuntimeByDeployScriptDTO.getReplicationType();
+ Deque<Integer> linkedList = new ArrayDeque<>();
+ if (!Objects.equals(replicationType, ReplicationType.SLAVE) && clusterEntity.getClusterType().isStorage()) {
+ clusterEntity.setRuntimeIndex(1);
+ linkedList = this.clusterService.getIndex(clusterEntity);
+ } else if (Objects.equals(replicationType, ReplicationType.SLAVE)) {
+ linkedList.add(1);
+ } else {
+ linkedList.add(0);
+ }
+
+ runtimeEntity.setClusterType(clusterEntity.getClusterType());
+ runtimeEntity.setTrusteeshipType(ClusterTrusteeshipType.SELF);
+ runtimeEntity.setReplicationType(replicationType);
+ runtimeEntity.setDeployStatusType(DeployStatusType.CREATE_WAIT);
+ runtimeEntity.setRuntimeIndex(linkedList.poll());
+ this.runtimeService.insertRuntime(runtimeEntity);
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md
new file mode 100644
index 0000000..33a7903
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md
@@ -0,0 +1,157 @@
+
+##
+1. 存储 remote 服务
+ 1. topic 创建在 cluster main runtime
+2. message
+ 1. 发送
+ 2. 查看消息
+ 3. 发布订阅
+ 4. console -> 抽象层 -> broker
+ 5. rocketmq 4.0 push(pull) 5.0 pull
+3. offset
+4. k8s
+ 1. 集群
+ 2. 创建
+ 3.
+ 2. 节点
+ 3. 创建
+ 4. 停用
+ 5. 删除
+ 2. console , docker 执行脚本
+ 2. console 与 操作分开
+ 3. 6c 16G
+ 4. eventmesh
+ 5. kafka
+ 1. 取舍问题
+ 6. rocketmq
+ 1. 简单
+ 2. 不做难得
+ 3. 两个集群
+ 1. 单节点
+ 2. 一主已从
+ 7. pulsuer
+ 1. 我有
+5. 数据采集快
+ 1. 存储已经支持的采集
+ 2. RocketMQ 实现
+6. 前端
+7. 认证与权限,介入
+ 1. rocketmq 的插件
+ 2. acl -> console 同步
+ 2. kafka 的 插件
+ 3. 修改
+8. 一键部署
+9. 巡检
+10. 告警
+
+
+## 部署业务模块
+>
+
+## 难点
+ 超级难点一:
+ 因消息中间件架构不一样,所以处理不一样。
+ Kafka是
+ 1. CAP 架构,操作一个节点就可以。
+ 2. 单注册中心,meta 集群决定 kafka 集群的 一致性架构
+ 3. 操作性行为
+ 4. 难点 复制:kafka 基于 topic 复制
+ RocketMQ 是
+ 1. 多子集群
+ 1. 子集群主从架构。且部分功能独立
+ 2. 有 raft 架构
+ 3. 难点 复制:RocketMQ 是 主从复制
+ 2. 多注册中心,使用 AP 架构。broker 集群架构由 broker 集群决定
+ pulsar(占时不支持) 是
+ 1. 多计算集群多存储集群的计算与存储分离架构
+ 2. 存储使用 BookKeeper,只能通过 pulsar broker 进行操作
+ 2. 多注册中心。meta 集群决定 pulsar 集群的 一致性架构
+ 3. 跨集群复制
+ 4. 难点 复制: 基于 BookKeeper 复制
+
+ 集群创建的时候,可以定义集群 一致性 架构
+ broker 集群决定一致性架构
+
+重置维度
+1. 最大
+2. 最小
+3. 指定 offset
+4. 指定 某个时间点
+PS: RocketMQ 的 queue 与 kafka 的 partition 是一个意思。
+超级难点一:
+ 因消息中间件架构不一样,所以处理不一样
+ kafka 的 offset 操作时 cluster行为
+ RocketMQ 操作时 broker 行为
+
+kafka 只需要 队列id 就行了
+ 1. 按照某个维度重置 topic 下面所有 队列
+ 2. 按照某个维度重置 topic 下某个队列
+RocketMQ 的重置场景
+ 1. 按照某个维度重置 topic 在集群里面所有的 队列
+ 2. 按照某个维度重置 topic 在集群里面某个主从节点的 队列
+ 3. 按照某个维度重置 topic 在集群里面所有的 下某个队列
+ 4. 按照某个维度重置 topic 在集群里面某个主从节点的 下某个队列
+ PS:以上 每次操作都需要同时操作主节点与从节点
+ 5. 按照某个维度重置 topic 在某个节点上的所有 队列
+ 6. 按照某个维度重置 topic 在某个节点上的所有 某个队列
+
+
+## 数据关联
+1. 所有对 eventmesh 的操作,需要再对应的存储集群进行操作
+2. 什么状态的集群进行操作【】。读取数据的时候,需要过滤掉,不正常得节点
+
+##
+
+## 数据创建
+1. 把导出的数据,导入
+ 1. 点击 eventmesh 集群导出 or 备份
+ 1. 如果 eventmesh 独立集群直接操作
+ 2. 不是,检查 依赖集群是否同时进行了备份
+ 1. 没有,提示某某集群
+ 2. 点击 runtime 集群
+ 3. 点击 meta 集群
+ 4. 点击 存储 集群
+ 1. 存储集群
+2. 直接点击 cluster 绑定
+ 1. 定时 保存 cluster 信息
+ 2. 绑定 集群架构
+ 1. eventmesh cluster
+ 1. meta cluster 列表
+ 1. runtime列表
+ 2. 一份 runtime config
+ 2. runtime cluster 列表
+ 1. runtime
+ 1. 每个 runtime config
+ 2. runtime 的 acl
+ 3. topic 列表
+ 4. group
+ 3. 存储 cluster 列表
+ 1. meta cluster 列表
+ 1. runtime列表
+ 2. 一份 runtime config
+ 2. runtime cluster 列表
+ 1. runtime
+ 1. 每个 runtime config
+ 2. user
+ 3. acl
+ 4. topic 列表
+ 5. group 列表
+ 2. 绑定 集群配置
+ 3. 绑定 runtime 配置
+ 4. 如果没有 resource 信息是不允许绑定的
+ 5. 是否可以绑定 topic信息
+ 6. 是否绑定 group 信息
+ 7. 是否绑定 acl 信息
+3. case 修改就是创建
+4. 在 runtime 点击编辑。TODO 不允许在在runtime编辑。
+ 1. 只能 添加 resource
+5. 在 deploy 模块,添加
+6. deploy
+ 1. 部署方案
+ 2. 资源配置
+ 3. 部署关系
+7. 部署信息
+ 1. 每个runtime 的部署 对应一个 资源信息
+ 2. cluster 第一次部署对应一个部署信息
+ 1. 这次
+8.
\ No newline at end of file
diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
similarity index 83%
copy from eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
index 6b8d5ec..8d13773 100644
--- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/operation/connector/RuntimeOptService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
@@ -15,12 +15,16 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.service.operation.connector;
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.handler;
/**
- * k8s operation service
+ *
*/
-public interface RuntimeOptService {
+public interface UpdateHandler<T> {
+
+ void init();
+
+ void handler(T t);
- void createRuntime();
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java
new file mode 100644
index 0000000..cbcd273
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java
@@ -0,0 +1,110 @@
+/*
+ * 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.console.controller.deploy.pause;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterAndRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PauseCluster implements UpdateHandler<ClusterEntity> {
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @Autowired
+ private ClusterRelationshipService clusterRelationshipService;
+
+
+ private List<RuntimeEntity> selfRuntimeList = new ArrayList<>();
+
+ private List<RuntimeEntity> notSelfRuntimeList = new ArrayList<>();
+
+
+ @Override
+ public void init() {
+
+ }
+
+ /**
+ * 关系解除,如果
+ *
+ * @param clusterEntity
+ */
+ @Override
+ public void handler(ClusterEntity clusterEntity) {
+
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+
+ if (clusterEntity.getClusterType().isMeta()) {
+ // 检查 meta 集群 是否被关联,如何被关联,就禁止删除
+ ClusterRelationshipEntity clusterRelationshipEntity = new ClusterRelationshipEntity();
+ clusterRelationshipEntity.setClusterId(clusterEntity.getId());
+ List<ClusterAndRelationshipEntity> clusterRelationshipEntityList =
+ this.clusterRelationshipService.queryClusterAndRelationshipEntityListByClusterId(clusterRelationshipEntity);
+ if (!clusterRelationshipEntityList.isEmpty()) {
+ // 打印结果
+ return;
+ }
+ }
+
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterEntity.getId());
+ ClusterAllMetadataDO clusterAllMetadata = this.runtimeService.queryAllByClusterId(runtimeEntity, true, true);
+
+ clusterAllMetadata.getRuntimeEntityList().forEach(entity -> {
+ // TODO
+ if (entity.getTrusteeshipType().isSelf()) {
+ entity.setDeployStatusType(DeployStatusType.PAUSE_FULL_WAIT);
+ } else {
+ entity.setStatus(1L);
+ }
+ });
+
+ clusterAllMetadata.getClusterEntityList().forEach(entity -> {
+
+ });
+
+ if (clusterEntity.getClusterType().isMeta()) {
+ // 得到 所有关联项目
+
+ // 获得 所有关联项目的 存储 cluster
+
+ //
+ }
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseRuntime.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseRuntime.java
new file mode 100644
index 0000000..93189f9
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseRuntime.java
@@ -0,0 +1,53 @@
+/*
+ * 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.console.controller.deploy.pause;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PauseRuntime implements UpdateHandler<RuntimeEntity> {
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(RuntimeEntity runtimeEntity) {
+ RuntimeEntity newRuntimeEntity = this.runtimeService.queryRuntimeEntityById(runtimeEntity);
+ if (newRuntimeEntity.getTrusteeshipType().isSelf()) {
+ newRuntimeEntity.setDeployStatusType(DeployStatusType.PAUSE_WAIT);
+ } else {
+ newRuntimeEntity.setStatus(0L);
+ }
+ this.runtimeService.deactivate(runtimeEntity);
+
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java
new file mode 100644
index 0000000..82c66a8
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.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.console.controller.deploy.relationship;
+
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+public class RelationshipHandler implements UpdateHandler<ClusterRelationshipEntity> {
+
+ private ClusterService clusterService;
+
+ private ClusterRelationshipService clusterRelationshipService;
+
+ private RuntimeService runtimeService;
+
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(ClusterRelationshipEntity clusterRelationshipEntity) {
+ // 绑定 meta 集群, 那么下面所有的 runtime 集群,需要更新更新
+ // 绑定 runtime 集群, main cluster 依赖的
+ clusterRelationshipService.addClusterRelationshipEntry(clusterRelationshipEntity);
+
+ if (clusterRelationshipEntity.getRelationshipType().isMeta()) {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterRelationshipEntity.getClusterId());
+ //runtimeService.queryOnlyRuntimeByClusterId(runtimeEntity);
+ }
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/UnRelationshipHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/UnRelationshipHandler.java
new file mode 100644
index 0000000..485061c
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/UnRelationshipHandler.java
@@ -0,0 +1,45 @@
+/*
+ * 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.console.controller.deploy.relationship;
+
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+public class UnRelationshipHandler implements UpdateHandler<ClusterRelationshipEntity> {
+
+ private ClusterService clusterService;
+
+ private ClusterRelationshipService clusterRelationshipService;
+
+ private RuntimeService runtimeService;
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(ClusterRelationshipEntity clusterRelationshipEntity) {
+ // 取消 runtime ,什么都不用管
+ // 接触 meta ,关联 集群下 runtime 都需要管理
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
similarity index 71%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
index 3eaa45b..c6e8f90 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
@@ -15,21 +15,21 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.cluster;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+package org.apache.eventmesh.dashboard.console.controller.deploy.uninstall;
-import lombok.Data;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-@Data
-public class ClusterHomeListVO {
+public class UninstallClusterHandler implements UpdateHandler<ClusterEntity> {
+ @Override
+ public void init() {
- @Data
- public static class ClusterHomeListData {
+ }
- private ClusterEntity clusterEntity;
+ @Override
+ public void handler(ClusterEntity clusterEntity) {
}
-
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
similarity index 66%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
index 1b5d564..987de5e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterRelationshipMetadata.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
@@ -15,26 +15,21 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+package org.apache.eventmesh.dashboard.console.controller.deploy.uninstall;
-import lombok.Data;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+public class UninstallRuntimeHandler implements UpdateHandler<RuntimeEntity> {
-@Data
-public class ClusterRelationshipMetadata extends MetadataConfig {
-
- private ClusterType clusterType;
-
- private Long relationshipId;
-
- private ClusterType relationshipType;
+ @Override
+ public void init() {
- private Integer status;
+ }
@Override
- public String getUnique() {
- return null;
+ public void handler(RuntimeEntity runtimeEntity) {
+
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
index 31c36e3..ef38b02 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.mapstruct.config.ConfigControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.dto.config.DetailConfigsVO;
import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.config.UpdateConfigDTO;
@@ -32,32 +32,27 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("/cluster/config")
public class ConfigController {
@Autowired
private ConfigService configService;
- @PostMapping("/updateConfigs")
+ @PostMapping("/cluster/config/updateConfigs")
public String updateConfigsByTypeAndId(@Validated @RequestBody UpdateConfigDTO updateConfigDTO) {
- try {
- configService.updateConfigsByInstanceId(updateConfigDTO.getUsername(), updateConfigDTO.getClusterId(), updateConfigDTO.getInstanceType(),
- updateConfigDTO.getInstanceId(), updateConfigDTO.getChangeConfigEntities());
- } catch (Exception e) {
- return e.getMessage();
- }
+
return "success";
}
- @PostMapping("/getInstanceDetailConfigs")
+ @PostMapping("/cluster/config/getInstanceDetailConfigs")
public List<DetailConfigsVO> getInstanceDetailConfigs(@Validated @RequestBody GetConfigsListDTO getConfigsListDTO) {
- List<ConfigEntity> configEntityList = configService.selectToFront(ConfigControllerMapper.INSTANCE.queryEntityByConfig(getConfigsListDTO));
- Map<String, String> stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType());
+ List<ConfigEntity> configEntityList = configService.selectToFront(getConfigsListDTO.getInstanceId(),
+ getConfigsListDTO.getInstanceType(), getConfigsListDTO);
+ Map<String, String> stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType(),
+ getConfigsListDTO.getInstanceId(), getConfigsListDTO.getInstanceType());
ArrayList<DetailConfigsVO> showDetailConfigsVOS = new ArrayList<>();
configEntityList.forEach(n -> {
DetailConfigsVO showDetailConfigsVO = new DetailConfigsVO();
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
index 4a96974..f3d0b5a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.HealthCheckResultEntity;
@@ -26,23 +27,21 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("/cluster/health")
public class HealthController {
@Autowired
HealthDataService healthDataService;
- @GetMapping("/getHistoryLiveStatus")
+ @GetMapping("/cluster/health/getHistoryLiveStatus")
public List<HealthCheckResultEntity> getHistoryLiveStatusById(Integer type, Long instanceId, String startTime) {
- return healthDataService.selectInstanceLiveStatusHistory(type, instanceId, LocalDateTime.parse(startTime));
+ return healthDataService.getInstanceLiveStatusHistory(type, instanceId, LocalDateTime.parse(startTime));
}
- @GetMapping("/getInstanceLiveProportion")
+ @GetMapping("/cluster/health/getInstanceLiveProportion")
public InstanceLiveProportionVo getInstanceLiveProportion(Integer instanceType, Long theClusterId) {
- return healthDataService.selectInstanceLiveProportion(theClusterId, instanceType);
+ return healthDataService.getInstanceLiveProportion(theClusterId, instanceType);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
index 36ec3d0..525de4f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
-import org.apache.eventmesh.dashboard.console.mapstruct.log.LogControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
import org.apache.eventmesh.dashboard.console.service.function.LogService;
@@ -28,19 +28,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("/cluster/log")
public class LogController {
@Autowired
private LogService logService;
- @PostMapping("/getList")
+ @PostMapping("/cluster/log/getList")
public List<LogEntity> getLogLIstToFront(@Validated @RequestBody GetLogListDTO getLogListDTO) {
- return logService.selectLogListByCluster(LogControllerMapper.INSTANCE.queryEntityByLog(getLogListDTO));
+ return logService.getLogListByCluster(getLogListDTO);
}
-}
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
index 4667fce..46e4920 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
@@ -16,6 +16,7 @@
*/
+
package org.apache.eventmesh.dashboard.console.controller.function;
@@ -40,8 +41,9 @@ public class OverviewController {
private Map<String, OverviewService> overviewServiceMap;
@PostMapping("overview")
- public Map<String, Integer> overview(@RequestBody @Validated OverviewDTO overviewDTO) {
+ public Object overview(@RequestBody @Validated OverviewDTO overviewDTO) {
+ OverviewService overviewService = overviewServiceMap.get(overviewDTO.getOverviewType().name());
- return null;
+ return overviewService.overview(overviewDTO);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
index a2f8c7b..d1d5802 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
@@ -16,13 +16,14 @@
*/
+
package org.apache.eventmesh.dashboard.console.controller.message;
import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.GroupControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
import org.apache.eventmesh.dashboard.console.modle.IdDTO;
+import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
import org.apache.eventmesh.dashboard.console.service.message.GroupService;
import java.util.List;
@@ -46,8 +47,8 @@ public class GroupController {
private GroupService groupService;
@PostMapping("queryGroupListByClusterId")
- public List<GroupEntity> queryGroupListByClusterId(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
- return groupService.selectGroupByClusterId(GroupControllerMapper.INSTANCE.queryGroupListByClusterId(clusterIdDTO));
+ public List<GroupEntity> queryGroupListByClusterId(@RequestBody @Validated RuntimeIdDTO runtimeIdDTO) {
+ return groupService.getGroupByClusterId(GroupControllerMapper.INSTANCE.queryGroupListByClusterId(runtimeIdDTO));
}
@PostMapping("deleteGroupById")
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
index f8f1944..a726dbc 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.message;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
index 366c106..bfdddc4 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
@@ -15,9 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.message;
+import org.apache.eventmesh.dashboard.console.domain.OperationRangeDomain;
import org.apache.eventmesh.dashboard.console.modle.message.offset.QueryOffsetByMessageMetadataDTO;
import org.apache.eventmesh.dashboard.console.modle.message.offset.ResetOffsetDTO;
import org.apache.eventmesh.dashboard.service.remoting.OffsetRemotingService;
@@ -37,10 +39,13 @@ import com.lamp.decoration.core.result.ResultObject;
@RequestMapping("offset")
public class OffsetOperateController {
- @Autowired
private OffsetRemotingService offsetRemotingService;
+ @Autowired
+ private OperationRangeDomain operationRangeDomain;
+
+
public ResultObject<String> queryOffsetByMessageMetadataDTO(
@RequestBody @Validated QueryOffsetByMessageMetadataDTO queryOffsetByMessageMetadataDTO) {
@@ -49,6 +54,17 @@ public class OffsetOperateController {
public ResultObject<String> resetOffset(@RequestBody @Validated ResetOffsetDTO resetOffsetDTO) {
+ // 得到 订阅信息
+ // 获得 runtime
+
+ switch (resetOffsetDTO.getResetOffsetMode()) {
+ case CONSUME_FROM_LAST_OFFSET:
+ case CONSUME_FROM_FIRST_OFFSET:
+ case CONSUME_FROM_TIMESTAMP:
+ case CONSUME_FROM_DESIGNATED_OFFSET:
+ default:
+ break;
+ }
return null;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
index 25353a2..5a63bd1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
@@ -15,17 +15,25 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.controller.message;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.console.controller.ClusterAbitityService;
+import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterMetadataDomain;
+import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterOperationHandler;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.message.TopicControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.IdDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.topic.CreateTopicDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.topic.GetTopicListDTO;
+import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.topic.TopicDetailGroupVO;
import org.apache.eventmesh.dashboard.console.service.message.TopicService;
+import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -44,24 +52,121 @@ public class TopicController {
private TopicService topicService;
+ @Autowired
+ private ClusterAbitityService clusterAbitityService;
+
+ @Autowired
+ private ClusterMetadataDomain clusterMetadataDomain;
+
+ /**
+ * @param getTopicListDTO
+ * @return
+ */
@PostMapping("/queryTopicListByClusterId")
public List<TopicEntity> queryTopicListByClusterId(@Validated @RequestBody GetTopicListDTO getTopicListDTO) {
- return topicService.selectTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
+ // cap 的直接查询
+ if (this.clusterAbitityService.isCAP(getTopicListDTO)) {
+ topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
+ }
+ // 非 CAP 另外查询
+ return topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
}
@PostMapping("queryTopicListById ")
- public TopicEntity queryTopicById(@Validated @RequestBody IdDTO idDTO) {
- return topicService.selectTopicById(TopicControllerMapper.INSTANCE.queryTopicListById(idDTO));
+ public TopicEntity queryTopicById(@Validated @RequestBody RuntimeIdDTO runtimeIdDTO) {
+ TopicEntity topicEntity = topicService.selectTopicById(TopicControllerMapper.INSTANCE.queryTopicListById(runtimeIdDTO));
+ if (this.clusterAbitityService.isCAP(topicEntity)) {
+ return topicEntity;
+ }
+ //
+ List<TopicEntity> queryList = new ArrayList<>();
+ // 如果 是 eventmesh 集群。 得到 eventmesh 所有 runtime , 所有存储
+ clusterMetadataDomain.operation(topicEntity.getClusterId(), new ClusterOperationHandler() {
+
+ @Override
+ public void handler(RuntimeMetadata baseSyncBase) {
+ TopicEntity topicEntity = new TopicEntity();
+ queryList.add(topicEntity);
+ topicEntity.setClusterId(baseSyncBase.getClusterId());
+ topicEntity.setClusterType(baseSyncBase.getClusterType());
+ topicEntity.setRuntimeId(baseSyncBase.getId());
+ topicEntity.setTopicName(topicEntity.getTopicName());
+ }
+
+ @Override
+ public void handler(ClusterMetadata clusterDO) {
+ TopicEntity topicEntity = new TopicEntity();
+ queryList.add(topicEntity);
+ topicEntity.setClusterId(clusterDO.getClusterId());
+ topicEntity.setClusterType(clusterDO.getClusterType());
+ topicEntity.setRuntimeId(clusterDO.getClusterId());
+ topicEntity.setTopicName(topicEntity.getTopicName());
+ }
+ });
+
+
+
+ topicService.queryRuntimeByBaseSyncEntity(queryList);
+ return null;
}
@GetMapping("deleteTopic")
public Integer deleteTopic(@Validated @RequestBody IdDTO idDTO) {
- return topicService.deleteTopic(TopicControllerMapper.INSTANCE.deleteTopic(idDTO));
+ TopicEntity topicEntity = this.topicService.selectTopicById(TopicControllerMapper.INSTANCE.deleteTopic(idDTO));
+ if (this.clusterAbitityService.isCAP(topicEntity)) {
+ return this.topicService.deleteTopicById(topicEntity);
+ }
+ // 通过 clusterId,runtime id, topic name 删除
+
+ List<TopicEntity> deleteList = new ArrayList<>();
+ // 如果 是 eventmesh 集群。 得到 eventmesh 所有 runtime , 所有存储
+ clusterMetadataDomain.operation(topicEntity.getClusterId(), new ClusterOperationHandler() {
+
+ @Override
+ public void handler(RuntimeMetadata baseSyncBase) {
+ TopicEntity topicEntity = new TopicEntity();
+ deleteList.add(topicEntity);
+ topicEntity.setClusterId(baseSyncBase.getClusterId());
+ topicEntity.setClusterType(baseSyncBase.getClusterType());
+ topicEntity.setRuntimeId(baseSyncBase.getId());
+ }
+
+ @Override
+ public void handler(ClusterMetadata clusterDO) {
+ TopicEntity topicEntity = new TopicEntity();
+ deleteList.add(topicEntity);
+ topicEntity.setClusterId(clusterDO.getClusterId());
+ topicEntity.setClusterType(clusterDO.getClusterType());
+ }
+ });
+ return topicService.deleteTopicByRuntimeIdAndTopicName(deleteList);
}
@PostMapping("createTopic")
public void createTopic(@Validated @RequestBody CreateTopicDTO createTopicDTO) {
- topicService.createTopic(TopicControllerMapper.INSTANCE.createTopic(createTopicDTO));
+ List<TopicEntity> createTopicList = new ArrayList<>();
+ // 如果 是 eventmesh 集群。 得到 eventmesh 所有 runtime , 所有存储
+ clusterMetadataDomain.operation(createTopicDTO.getClusterId(), new ClusterOperationHandler() {
+
+ @Override
+ public void handler(RuntimeMetadata baseSyncBase) {
+ TopicEntity topicEntity = TopicControllerMapper.INSTANCE.createTopic(createTopicDTO);
+ createTopicList.add(topicEntity);
+ topicEntity.setClusterId(baseSyncBase.getClusterId());
+ topicEntity.setClusterType(baseSyncBase.getClusterType());
+ topicEntity.setRuntimeId(baseSyncBase.getId());
+
+ }
+
+ @Override
+ public void handler(ClusterMetadata clusterDO) {
+ TopicEntity topicEntity = TopicControllerMapper.INSTANCE.createTopic(createTopicDTO);
+ createTopicList.add(topicEntity);
+ topicEntity.setClusterId(clusterDO.getClusterId());
+ topicEntity.setClusterType(clusterDO.getClusterType());
+ }
+ });
+ this.topicService.batchInsert(createTopicList);
}
/**
@@ -72,7 +177,7 @@ public class TopicController {
*/
@GetMapping("/cluster/topic/getTopicDetailGroups")
public List<TopicDetailGroupVO> getTopicDetailGroups(Long topicId) {
- return topicService.selectTopicDetailGroups(topicId);
+ return topicService.getTopicDetailGroups(topicId);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
similarity index 79%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
index 3eaa45b..0aa1222 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
@@ -15,21 +15,25 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.cluster;
+
+package org.apache.eventmesh.dashboard.console.domain;
+
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import lombok.Data;
+import java.util.List;
+
+/**
+ *
+ */
+public interface ClusterAndRuntimeDomain {
+
+
-@Data
-public class ClusterHomeListVO {
+ List<ClusterEntity> getClusterByCLusterId(ClusterEntity clusterEntity);
- @Data
- public static class ClusterHomeListData {
- private ClusterEntity clusterEntity;
- }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
similarity index 68%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
index 3eaa45b..67fa472 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
@@ -15,21 +15,19 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.cluster;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-
-import lombok.Data;
-
-@Data
-public class ClusterHomeListVO {
+package org.apache.eventmesh.dashboard.console.domain.Impl;
+import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
- @Data
- public static class ClusterHomeListData {
+import java.util.Collections;
+import java.util.List;
- private ClusterEntity clusterEntity;
+public class ClusterAndRuntimeDomainImpl implements ClusterAndRuntimeDomain {
+ @Override
+ public List<ClusterEntity> getClusterByCLusterId(ClusterEntity clusterEntity) {
+ return Collections.emptyList();
}
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java
new file mode 100644
index 0000000..e08c9fa
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java
@@ -0,0 +1,146 @@
+/*
+ * 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.console.domain;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseSyncEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
+import org.apache.eventmesh.dashboard.console.modle.dto.operation.OperationBaseDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+/**
+ * 可以得到返回的数据为两种: 1. 写入数据的 2. 直接请求其他组件
+ */
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class OperationRangeDomain {
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+
+ private OperationBaseDTO operationBaseDTO;
+
+ private OperationRangeDomainDataHandler rangeDomainDataHandler;
+
+ private final Set<ClusterType> clusterTypeSet = new HashSet<>();
+
+ private ClusterType rangeType;
+
+ private boolean currentType;
+
+
+ public OperationRangeDomain operationBaseDTO(OperationBaseDTO operationBaseDTO) {
+ this.operationBaseDTO = operationBaseDTO;
+ return this;
+ }
+
+
+ public OperationRangeDomain operationRangeDomainDataHandler(OperationRangeDomainDataHandler operationRangeDomainDataHandler) {
+ this.rangeDomainDataHandler = operationRangeDomainDataHandler;
+ return this;
+ }
+
+ public OperationRangeDomain clusterType(ClusterType clusterType) {
+ this.clusterTypeSet.add(clusterType);
+ return this;
+ }
+
+ public OperationRangeDomain rangeType(ClusterType rangeType) {
+ this.rangeType = rangeType;
+ return this;
+ }
+
+ public <T> T hander() {
+ List<T> operationList = new ArrayList<>();
+ if (Objects.equals(operationBaseDTO.getRangeType(), MetadataType.RUNTIME)) {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity = runtimeService.queryRuntimeEntityById(runtimeEntity);
+ // 直接写入
+ operationList.add((T) this.rangeDomainDataHandler.handler(runtimeEntity));
+ return (T) operationList;
+ }
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ ClusterAllMetadataDO clusterAllMetadataDO =
+ runtimeService.queryAllByClusterId(runtimeEntity, true, false);
+ clusterAllMetadataDO.getClusterEntityList().forEach((value) -> {
+ ClusterFramework clusterFramework1 = ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType());
+ if (!clusterFramework1.isCAP()) {
+ return;
+ }
+
+ if (!clusterTypeSet.isEmpty() && !clusterTypeSet.contains(value.getClusterType())) {
+ return;
+ }
+ if (!Objects.equals(this.rangeType, value.getClusterType().getAssemblyNodeType())) {
+ return;
+ }
+
+ operationList.add((T) this.rangeDomainDataHandler.handler(value));
+ });
+ clusterAllMetadataDO.getRuntimeEntityList().forEach((value) -> {
+ ClusterFramework clusterFramework1 = ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType());
+ if (clusterFramework1.isCAP()) {
+ return;
+ }
+ if (!clusterTypeSet.isEmpty() && !clusterTypeSet.contains(value.getClusterType())) {
+ return;
+ }
+ if (!Objects.equals(this.rangeType, value.getClusterType().getAssemblyNodeType())) {
+ return;
+ }
+ operationList.add((T) this.rangeDomainDataHandler.handler(value));
+ });
+
+ return (T) operationList;
+ }
+
+ /**
+ *
+ */
+ public static interface OperationRangeDomainDataHandler {
+
+
+ Object handler(BaseSyncEntity baseEntity);
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java
new file mode 100644
index 0000000..85475d0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java
@@ -0,0 +1,447 @@
+/*
+ * 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.console.domain.metadata;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.modle.domain.ClusterEntityDO;
+import org.apache.eventmesh.dashboard.console.modle.domain.RuntimeEntityDO;
+import org.apache.eventmesh.dashboard.console.spring.support.metadata.convert.ClusterConvertMetaData;
+import org.apache.eventmesh.dashboard.console.spring.support.metadata.convert.RuntimeConvertMetaData;
+import org.apache.eventmesh.dashboard.core.cluster.ClusterBaseDO;
+import org.apache.eventmesh.dashboard.core.cluster.ClusterDO;
+import org.apache.eventmesh.dashboard.core.cluster.ColonyDO;
+import org.apache.eventmesh.dashboard.core.cluster.RuntimeBaseDO;
+import org.apache.eventmesh.dashboard.core.cluster.RuntimeDO;
+import org.apache.eventmesh.dashboard.core.function.SDK.ConfigManage;
+import org.apache.eventmesh.dashboard.core.function.SDK.SDKTypeEnum;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.AbstractMultiCreateSDKConfig;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.AbstractSimpleCreateSDKConfig;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.NetAddress;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 直接序列化,或则 使用 mapper
+ */
+@SuppressWarnings({"unchecked", "rawtypes", "RedundantCast"})
+@Slf4j
+public class ClusterMetadataDomain {
+
+ private ColonyDO<ClusterDO> colonyDO;
+
+
+ private boolean coreModel = true;
+
+ private boolean buildConfig = false;
+
+ @Setter
+ private DataHandler handler;
+
+ public void isConsoleModel() {
+ this.coreModel = false;
+ }
+
+ public void useBuildConfig() {
+ this.buildConfig = true;
+ }
+
+
+ public ColonyDO<ClusterDO> getColonyDO(Long clusterId) {
+ return colonyDO.getAllColonyDO().get(clusterId);
+ }
+
+ public List<ColonyDO<ClusterDO>> getMetaColonyDO(Long clusterId) {
+ ColonyDO<ClusterDO> clusterDO = colonyDO.getAllColonyDO().get(clusterId);
+ if (Objects.isNull(clusterDO)) {
+ return null;
+ }
+
+ // TODO
+ if (colonyDO.getClusterType().isMetaAndRuntime()) {
+ return new ArrayList<>(clusterDO.getRuntimeColonyDOMap().values());
+ }
+ return new ArrayList<>(clusterDO.getMetaColonyDOList().values());
+ }
+
+ public void setMainCluster(ClusterEntity clusterEntity) {
+ this.colonyDO = ColonyDO.create(ClusterEntityDO.class, clusterEntity);
+ this.colonyDO.setClusterId(clusterEntity.getClusterId());
+ this.colonyDO.setClusterType(clusterEntity.getClusterType());
+ this.colonyDO.setSuperiorId(-0L);
+ }
+
+ public void rootClusterDHO() {
+ this.colonyDO = ColonyDO.create(ClusterEntityDO.class, null);
+ this.colonyDO.setSuperiorId(-0L);
+ }
+
+ public QueueCondition createQueueCondition() {
+ return new QueueCondition();
+ }
+
+
+ public void handlerMetadata(MetadataAllDO metadataAllDO) {
+ Map<Long, ColonyDO<ClusterDO>> colonyDOMap = new HashMap<>();
+
+ this.setClusterEntityAndDefinitionCluster(metadataAllDO.getClusterEntityList(), metadataAllDO.getClusterRelationshipEntityList(),
+ colonyDOMap);
+ this.setRuntimeEntity(metadataAllDO.getRuntimeEntityList(), colonyDOMap);
+
+ colonyDOMap.forEach((key, value) -> {
+ AbstractMultiCreateSDKConfig createSDKConfig = value.getClusterDO().getMultiCreateSDKConfig();
+ if (Objects.isNull(createSDKConfig) || createSDKConfig.isNullAddress()) {
+ return;
+ }
+ if (!ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType()).isCAP()) {
+ return;
+ }
+ if (Objects.nonNull(this.handler)) {
+ // TODO
+ this.handler.registerCluster(null, value.getClusterDO(), value);
+ //this.handler.registerCluster(value.getClusterDO().getClusterInfo(), value.getClusterDO(), value);
+ }
+ });
+ }
+
+
+ public List<ClusterEntity> setClusterEntityAndDefinitionCluster(List<ClusterEntity> clusterEntityList,
+ List<ClusterRelationshipEntity> clusterRelationshipEntityList,
+ Map<Long, ColonyDO<ClusterDO>> colonyDOMap) {
+ List<ClusterEntity> definitionClusteList = new ArrayList<>();
+ if (CollectionUtils.isNotEmpty(clusterEntityList)) {
+ clusterEntityList.forEach(v -> {
+ if (v.getClusterType().isDefinition()) {
+ definitionClusteList.add(v);
+ }
+ if (Objects.equals(v.getStatus(), 0L)) {
+ ColonyDO<ClusterDO> colonyDO = this.colonyDO.remove(v.getId());
+ if (Objects.nonNull(this.handler)) {
+ this.handler.unRegisterCluster(v, colonyDO.getClusterDO(), colonyDO);
+ }
+ } else {
+ ClusterBaseDO clusterEntityDO = this.createClusterBaseDO(v);
+ ColonyDO<ClusterDO> colonyDO = this.colonyDO.register(v.getId(), v.getClusterType(), clusterEntityDO);
+ if (!v.getClusterType().isDefinition()) {
+ colonyDOMap.put(v.getId(), colonyDO);
+ }
+ }
+ });
+ }
+ if (CollectionUtils.isEmpty(clusterRelationshipEntityList)) {
+ return definitionClusteList;
+ }
+ clusterRelationshipEntityList.forEach(v -> {
+ try {
+ if (Objects.equals(v.getStatus(), 0L)) {
+ this.colonyDO.unRelationship(v.getClusterId(), v.getRelationshipId());
+ } else {
+ this.colonyDO.relationship(v.getClusterId(), v.getRelationshipId());
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+ return definitionClusteList;
+ }
+
+ public void setRuntimeEntity(List<RuntimeEntity> runtimeEntityList, Map<Long, ColonyDO<ClusterDO>> colonyDOMap) {
+ if (Objects.isNull(runtimeEntityList)) {
+ return;
+ }
+ runtimeEntityList.forEach(value -> {
+ NetAddress netAddress = new NetAddress();
+ netAddress.setAddress(value.getHost());
+ netAddress.setPort(value.getPort());
+ ColonyDO<ClusterDO> colonyDO;
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType());
+ if (Objects.equals(value.getStatus(), 0L)) {
+ colonyDO = this.colonyDO.removeRuntime(value.getClusterId(), value.getId(), netAddress);
+ if (Objects.nonNull(colonyDO) && clusterFramework.isCAP()) {
+ colonyDOMap.put(value.getClusterId(), colonyDO);
+ } else {
+ if (Objects.nonNull(this.handler)) {
+ this.handler.unRegisterRuntime(value, null, colonyDO);
+ }
+ }
+ } else {
+ RuntimeBaseDO runtimeBaseDO = this.createRuntimeDO(value);
+ colonyDO = this.colonyDO.register(value.getClusterId(), value.getId(), runtimeBaseDO, netAddress);
+
+ if (Objects.isNull(colonyDO)) {
+ log.warn(" not queue colonyDO, runtime is {}", value);
+ return;
+ }
+ if (clusterFramework.isCAP()) {
+ colonyDOMap.put(value.getClusterId(), colonyDO);
+ } else {
+ if (Objects.nonNull(this.handler)) {
+ this.handler.registerRuntime(value, runtimeBaseDO, colonyDO);
+ }
+ }
+ }
+ });
+
+ }
+
+ private ClusterBaseDO createClusterBaseDO(ClusterEntity clusterEntity) {
+ ClusterBaseDO clusterBaseDO;
+ ClusterType clusterType = clusterEntity.getClusterType();
+ if (this.coreModel) {
+ clusterBaseDO = new ClusterDO();
+ ClusterMetadata clusterMetadata = ClusterConvertMetaData.INSTANCE.toMetaData(clusterEntity);
+ clusterBaseDO.setClusterInfo(clusterMetadata);
+ } else {
+ clusterBaseDO = new ClusterEntityDO();
+ clusterBaseDO.setClusterInfo(clusterEntity);
+ }
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterType);
+ if (this.buildConfig && !clusterType.isDefinition() && clusterFramework.isCAP()) {
+ AbstractMultiCreateSDKConfig config =
+ ConfigManage.getInstance().getMultiCreateSDKConfig(clusterEntity.getClusterType(), SDKTypeEnum.ADMIN);
+ config.setKey(clusterEntity.getId().toString());
+ clusterBaseDO.setMultiCreateSDKConfig(config);
+ }
+ return clusterBaseDO;
+ }
+
+ private RuntimeBaseDO createRuntimeDO(RuntimeEntity runtimeEntity) {
+ RuntimeBaseDO runtimeBaseDO;
+ if (this.coreModel) {
+ runtimeBaseDO = new RuntimeDO();
+ RuntimeMetadata runtimeMetadata = RuntimeConvertMetaData.INSTANCE.toMetaData(runtimeEntity);
+ runtimeBaseDO.setRuntimeMetadata(runtimeMetadata);
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(runtimeEntity.getClusterType());
+ if (!clusterFramework.isCAP()) {
+ AbstractSimpleCreateSDKConfig config =
+ ConfigManage.getInstance().getSimpleCreateSDKConfig(runtimeEntity.getClusterType(), SDKTypeEnum.ADMIN);
+ config.setKey(runtimeEntity.getId().toString());
+ config.setNetAddress(this.createNetAddress(runtimeEntity));
+ runtimeBaseDO.setCreateSDKConfig(config);
+ }
+ } else {
+ runtimeBaseDO = new RuntimeEntityDO();
+ runtimeBaseDO.setRuntimeMetadata(runtimeEntity);
+ }
+ return runtimeBaseDO;
+ }
+
+ private NetAddress createNetAddress(RuntimeEntity runtimeEntity) {
+ NetAddress netAddress = new NetAddress();
+ netAddress.setAddress(runtimeEntity.getHost());
+ netAddress.setPort(runtimeEntity.getPort());
+ return netAddress;
+ }
+
+
+ public void setResource() {
+
+ }
+
+ public void setConfigEntity() {
+
+ }
+
+ /**
+ * TODO @see OperationRangeDomain.
+ * @param clusterId
+ * @param clusterOperationHandler
+ */
+ public void operation(Long clusterId, ClusterOperationHandler clusterOperationHandler) {
+
+ // 需要识别最小维度
+
+ ColonyDO<ClusterDO> colonyDO = this.colonyDO.getAllColonyDO().get(clusterId);
+ ClusterType clusterType = colonyDO.getClusterType();
+ if (Objects.equals(clusterType, ClusterType.EVENTMESH_RUNTIME)) {
+ colonyDO.getClusterDO().getRuntimeMap().forEach((key, value) -> {
+ clusterOperationHandler.handler(value.getRuntimeMetadata());
+ });
+ } else if (Objects.equals(clusterType, ClusterType.EVENTMESH_CLUSTER)) {
+ colonyDO.getRuntimeColonyDOMap().forEach((key, value) -> {
+ value.getClusterDO().getRuntimeMap().forEach((k, v) -> {
+ clusterOperationHandler.handler(v.getRuntimeMetadata());
+ });
+ });
+
+ } else if (clusterType.isStorage()) {
+ if (clusterType.isDefinition()) {
+ colonyDO.getStorageColonyDOMap().forEach((key, value) -> {
+ value.getRuntimeColonyDOMap().forEach((k, v) -> {
+ value.getClusterDO().getRuntimeMap().forEach((kk, vv) -> {
+ clusterOperationHandler.handler(vv.getRuntimeMetadata());
+ });
+ });
+ });
+ } else {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterType);
+ if (clusterFramework.isCAP()) {
+ clusterOperationHandler.handler(colonyDO.getClusterDO().getClusterInfo());
+ } else {
+ colonyDO.getClusterDO().getRuntimeMap().forEach((k, v) -> {
+ clusterOperationHandler.handler(v.getRuntimeMetadata());
+ });
+ }
+ }
+ }
+ }
+
+
+ public <T> T queue(QueueCondition queueCondition) {
+ QueueConditionHandler queueConditionHandler = new QueueConditionHandler();
+ queueConditionHandler.colonyDO = this.colonyDO.getAllColonyDO().get(queueCondition.clusterId);
+ queueConditionHandler.queueCondition = queueCondition;
+ return (T) queueConditionHandler.handler();
+ }
+
+
+ /**
+ *
+ */
+ @SuppressWarnings("rawtypes")
+ public interface DataHandler<T extends RuntimeBaseDO, C extends ClusterBaseDO> {
+
+ /**
+ * TODO 只有 非 CAP 模式的 runtime调用此方法。 CAP 模式的 runtime 更新默认为 Cluster 更新
+ */
+ void registerRuntime(RuntimeEntity runtimeEntity, T t, ColonyDO<C> colonyDO);
+
+ /**
+ * TODO 只有 非 CAP 模式的 runtime调用此方法。 CAP 模式的 runtime 更新默认为 Cluster 更新
+ */
+ void unRegisterRuntime(RuntimeEntity runtimeEntity, T t, ColonyDO<C> colonyDO);
+
+ void registerCluster(ClusterEntity clusterEntity, C c, ColonyDO<C> colonyDO);
+
+ void unRegisterCluster(ClusterEntity clusterEntity, C c, ColonyDO<C> colonyDO);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private static class QueueConditionHandler {
+
+ private QueueCondition queueCondition;
+
+ private ColonyDO<ClusterDO> colonyDO;
+
+ private Map<Long, ColonyDO<ClusterDO>> currentColonyDOMap;
+
+ private final List<Object> resultData = new ArrayList<>();
+
+ public <T> T handler() {
+ this.getColonyDOMap();
+ if (MapUtils.isEmpty(currentColonyDOMap)) {
+ return (T) resultData;
+ }
+ this.currentColonyDOMap.forEach((k, v) -> {
+ this.handlerData(v);
+ });
+ return (T) this.resultData;
+ }
+
+ public void getColonyDOMap() {
+ if (this.queueCondition.clusterType == ClusterType.META) {
+ this.currentColonyDOMap = this.colonyDO.getMetaColonyDOList();
+ } else if (this.queueCondition.clusterType == ClusterType.RUNTIME) {
+ this.currentColonyDOMap = this.colonyDO.getRuntimeColonyDOMap();
+ } else if (this.queueCondition.clusterType == ClusterType.STORAGE) {
+ this.currentColonyDOMap = this.colonyDO.getStorageColonyDOMap();
+ }
+ }
+
+ public void handlerData(ColonyDO colonyDO) {
+ if (this.queueCondition.resultType == ClusterType.CLUSTER) {
+ if (this.queueCondition.resultId) {
+ resultData.add(colonyDO.getClusterId());
+ } else {
+ resultData.add(colonyDO.getClusterDO().getClusterInfo());
+ }
+ } else {
+ Map<Long, Object> data = colonyDO.getClusterDO().getRuntimeMap();
+ resultData.add(this.queueCondition.resultId ? data.keySet() : data.values());
+ }
+ }
+
+
+ }
+
+
+ public static class QueueCondition {
+
+ private Long clusterId;
+
+ /**
+ *
+ */
+ private ClusterType clusterType;
+
+ private final ClusterType resultType = ClusterType.CLUSTER;
+
+ private boolean resultId = false;
+
+
+ public QueueCondition clusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ return this;
+ }
+
+ public QueueCondition clusterType(ClusterType clusterType) {
+ this.clusterType = clusterType;
+ return this;
+ }
+
+ public QueueCondition meta() {
+ this.clusterType = ClusterType.META;
+ return this;
+ }
+
+ public QueueCondition storage() {
+ this.clusterType = ClusterType.STORAGE;
+ return this;
+ }
+
+ public QueueCondition runtime() {
+ this.clusterType = ClusterType.RUNTIME;
+ return this;
+ }
+
+ public QueueCondition() {
+ }
+
+ public QueueCondition resultId() {
+ this.resultId = true;
+ return this;
+ }
+ }
+}
diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/cluster/ClusterDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterOperationHandler.java
similarity index 76%
copy from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/cluster/ClusterDO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterOperationHandler.java
index 20621ae..75e2bca 100644
--- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/cluster/ClusterDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterOperationHandler.java
@@ -15,21 +15,22 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.core.cluster;
+
+package org.apache.eventmesh.dashboard.console.domain.metadata;
import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
+/**
+ *
+ */
+public interface ClusterOperationHandler {
+
-import lombok.Data;
+ void handler(RuntimeMetadata baseSyncBase);
-@Data
-public class ClusterDO {
- private ClusterMetadata clusterInfo;
+ void handler(ClusterMetadata clusterDO);
- private Map<Long, RuntimeMetadata> runtimeMap = new ConcurrentHashMap<>();
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/MetadataAllDO.java
similarity index 61%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/MetadataAllDO.java
index 18c2cb2..aa8fefa 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/MetadataAllDO.java
@@ -15,28 +15,28 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.service.cluster;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterAndRelationshipEntity;
+package org.apache.eventmesh.dashboard.console.domain.metadata;
+
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.AbstractMultiCreateSDKConfig;
import java.util.List;
-/**
- *
- */
-public interface ClusterRelationshipService {
-
-
- void insertClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity);
-
- Integer relieveRelationship(ClusterRelationshipEntity clusterRelationshipEntity);
+import lombok.Builder;
+import lombok.Data;
- List<ClusterAndRelationshipEntity> queryClusterAndRelationshipEntityListByClusterId(ClusterRelationshipEntity clusterRelationshipEntity);
+@Data
+@Builder
+public class MetadataAllDO {
- List<ClusterRelationshipEntity> selectAll();
+ private List<ClusterEntity> clusterEntityList;
- List<ClusterRelationshipEntity> selectNewlyIncreased(ClusterRelationshipEntity clusterRelationshipEntity);
+ private List<ClusterRelationshipEntity> clusterRelationshipEntityList;
+ private List<RuntimeEntity> runtimeEntityList;
+ private List<AbstractMultiCreateSDKConfig> abstractMultiCreateSDKConfigList;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java
index 59c0a67..874a48f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java
@@ -15,8 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+
import java.io.Serializable;
import java.time.LocalDateTime;
@@ -27,10 +30,13 @@ import lombok.EqualsAndHashCode;
/**
* Base Entity provide some basic fields that every Eventmesh Dashboard Entity would have
+ * <p>
+ * 12 broker -> 12 queue , 11 queue , 1broker 没有 队列。 副本,随机出现在一个 broker
*/
@Data
-@EqualsAndHashCode(callSuper = false, exclude = {"createTime", "updateTime"})
+@EqualsAndHashCode(callSuper = false)
@Schema(name = "BaseEntity", description = "Base entity")
+@Deprecated
public class BaseEntity implements Serializable {
private static final long serialVersionUID = -2697805837923579585L;
@@ -40,9 +46,16 @@ public class BaseEntity implements Serializable {
@Schema(name = "id", description = "primary key")
protected Long id;
+ /**
+ * 集群id,不是 eventmesh集群id。
+ */
protected Long clusterId;
+ protected ClusterType clusterType;
+
protected LocalDateTime createTime;
protected LocalDateTime updateTime;
+
+ private Integer status;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java
deleted file mode 100644
index 1f453fe..0000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.console.entity;
-
-import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
-import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectorConfigEntity;
-
-import lombok.Data;
-
-@Data
-public class CreateConnectionEntity {
-
- private Long clusterId;
-
- private AddConnectionEntity addConnectionEntity;
-
- private AddConnectorConfigEntity addConnectorConfigEntity;
-}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
index c4f2e8c..49d740e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
@@ -15,12 +15,18 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity;
+import lombok.AllArgsConstructor;
import lombok.Data;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
+@AllArgsConstructor
@Data
+@Deprecated
public class DefaultConfigKey {
private String businessType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java
index 78e28d4..a8046f8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity;
@@ -22,7 +23,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class StoreEntity extends BaseEntity {
private Long clusterId;
@@ -44,8 +46,6 @@ public class StoreEntity extends BaseEntity {
private String rack;
- private Short status;
-
private String endpointMap;
private Long startTimestamp;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseClusterIdEntity.java
similarity index 76%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseClusterIdEntity.java
index c930ed1..276089e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseClusterIdEntity.java
@@ -15,22 +15,21 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.entity.cluster;
+package org.apache.eventmesh.dashboard.console.entity.base;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
import lombok.Data;
+import lombok.EqualsAndHashCode;
-@Data
-public class ClusterRelationshipEntity extends BaseEntity {
- private ClusterType clusterType;
+@Data
+@EqualsAndHashCode(callSuper = true)
+public abstract class BaseClusterIdEntity extends BaseOrganizationEntity {
- private Long relationshipId;
+ private Long clusterId;
- private ClusterType relationshipType;
+ private ClusterType clusterType;
- private Integer status;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseIdEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseIdEntity.java
new file mode 100644
index 0000000..a4897c2
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseIdEntity.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.console.entity.base;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import lombok.Data;
+
+@Data
+public class BaseIdEntity implements Serializable {
+
+ private Long id;
+
+ private LocalDateTime createTime;
+
+ private Long createUserId;
+
+ private LocalDateTime updateTime;
+
+ private Long updateUserId;
+
+ /**
+ * 数据展示过程,操作必须是具体的行为 过程有:等待,完成,中 具体操作是一个有动词+名词的行为:停止扩容, 一个操作允许有多个过程。是否可以在过程中取消行为 集群创建中 关闭集群:停止集群的运行,可以让重启集群 删除集群: 关闭集群之后,可以备份数据,删除集群数据 扩容中, 缩容中
+ * 重启前检查: 检查 集群依赖情况 检查 资源(最低集群) -> 资源上锁
+ * <p>
+ * 重启: 检查 集群依赖情况 申请资源 -> 申请失败 -> 申请成功 -> 部署A集群 -> 部署B集群 -> 部署成功 -> 测试 -> 开始心跳测试 -> 心跳测试中 -> 心跳测试成功 -> 开始数据测试 -> 数据测试中 -> 数据测试成功 等待资源释放 -> 资源释放中 ->
+ * 资源释放失败 -> 完成资源释放 -> 重启集群 -> -> 删除集群数据 -> 删除集群数据中 -> 完成集群数据删除 ->
+ * <p>
+ * 数据状态: 集群状态: 是否与集群状态共享 启动中 运行 停运中 已停运 卸载中 完成卸载 作废 运维状态:
+ * <p>
+ * 检查状态,独立一个字段。用 二进制方式 1. 心跳失败 2. 配置异常 3.
+ */
+ private Long status;
+
+ private Integer isDelete;
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseOrganizationEntity.java
similarity index 79%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseOrganizationEntity.java
index 6dafeef..622fe75 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseOrganizationEntity.java
@@ -15,20 +15,19 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.config;
+
+package org.apache.eventmesh.dashboard.console.entity.base;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class UpdateConfigsLog {
-
- private Long instanceId;
+@EqualsAndHashCode(callSuper = true)
+public class BaseOrganizationEntity extends BaseIdEntity {
- private Long clusterId;
- private String name;
+ private Long organizationId;
- private String configProperties;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
similarity index 79%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
index 96f4b69..0c89a9d 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/offset/GetOffsetRequest.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
@@ -15,16 +15,17 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.remoting.offset;
+package org.apache.eventmesh.dashboard.console.entity.base;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class GetOffsetRequest {
+@EqualsAndHashCode(callSuper = true)
+public class BaseRuntimeIdEntity extends BaseClusterIdEntity {
- private String bootstrapServers;
+ private Long runtimeId;
- private String groupName;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java
new file mode 100644
index 0000000..cf12538
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java
@@ -0,0 +1,81 @@
+/*
+ * 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.console.entity.base;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.common.enums.SyncErrorType;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 此类 runtime 与 cluster 共用
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public abstract class BaseSyncEntity extends BaseClusterIdEntity {
+
+ private String name;
+
+ private String version;
+
+ private ClusterTrusteeshipType trusteeshipType;
+
+ private FirstToWhom firstToWhom;
+
+ private FirstToWhom firstSyncState;
+
+ private ReplicationType replicationType;
+
+ private SyncErrorType syncErrorType;
+
+ private DeployStatusType deployStatusType;
+
+ private Long resourcesConfigId;
+
+ private Long deployScriptId;
+
+ private String deployScriptName;
+
+ private String deployScriptVersion;
+
+ /**
+ * 不想加字段,这个字段作为 port 的索引,目前只支持范围获得
+ */
+ private Integer runtimeIndex;
+
+ /**
+ * 上线时间
+ */
+ private LocalDateTime onlineTimestamp;
+
+ /**
+ * 下线时间
+ */
+ private LocalDateTime offlineTimestamp;
+
+
+ private LocalDateTime startTimestamp;
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
similarity index 71%
copy from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
index 3827f93..6b6a233 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
@@ -15,27 +15,29 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.common.model.metadata;
+
+package org.apache.eventmesh.dashboard.console.entity.cases;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseOrganizationEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GroupMetadata extends MetadataConfig {
-
- private String name;
+public class CaseEntity extends BaseOrganizationEntity {
- private Integer memberCount;
- private String members;
+ private String caseType;
- private Integer type;
+ /**
+ * cluster , runtime
+ */
+ private String objectType;
- private String state;
- @Override
- public String getUnique() {
- return name;
- }
+ /**
+ *
+ */
+ private String objectId;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/CreateClusterDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/DeployScriptEntity.java
similarity index 70%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/CreateClusterDTO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/DeployScriptEntity.java
index 2102c5c..cb1ebd3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/CreateClusterDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/DeployScriptEntity.java
@@ -15,36 +15,32 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.cluster;
-import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+package org.apache.eventmesh.dashboard.console.entity.cases;
-import javax.validation.constraints.NotNull;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseOrganizationEntity;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class CreateClusterDTO {
+@EqualsAndHashCode(callSuper = true)
+public class DeployScriptEntity extends BaseOrganizationEntity {
- @NotNull
private String name;
- @NotNull
- private ClusterTrusteeshipType trusteeshipType;
+ private String version;
- @NotNull
private ClusterType clusterType;
- @NotNull
- private String version;
-
+ private String description;
- private String jmxProperties = "";
+ private String startRuntimeVersion;
- private String description = "";
+ private String endRuntimeVersion;
+ private String content;
- private Integer authType = 0;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/PortEntity.java
similarity index 73%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/PortEntity.java
index 3eaa45b..bedfe57 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/ClusterHomeListVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/PortEntity.java
@@ -15,21 +15,18 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.cluster;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+package org.apache.eventmesh.dashboard.console.entity.cases;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class ClusterHomeListVO {
-
-
- @Data
- public static class ClusterHomeListData {
-
- private ClusterEntity clusterEntity;
+@EqualsAndHashCode(callSuper = true)
+public class PortEntity extends BaseClusterIdEntity {
- }
+ private Integer currentPort;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
similarity index 75%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
index 6dafeef..b5d6b3d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
@@ -15,20 +15,18 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.config;
+package org.apache.eventmesh.dashboard.console.entity.cases;
+
+import org.apache.eventmesh.dashboard.console.entity.base.BaseOrganizationEntity;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class UpdateConfigsLog {
-
- private Long instanceId;
-
- private Long clusterId;
+@EqualsAndHashCode(callSuper = true)
+public class ResouceEntity extends BaseOrganizationEntity {
- private String name;
- private String configProperties;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResourcesConfigEntity.java
similarity index 74%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResourcesConfigEntity.java
index 1796fa5..f1606fa 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResourcesConfigEntity.java
@@ -15,21 +15,24 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.config;
+
+package org.apache.eventmesh.dashboard.console.entity.cases;
+
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class DetailConfigsVO {
+@EqualsAndHashCode(callSuper = true)
+public class ResourcesConfigEntity extends CaseEntity {
- private String configName;
+ private Float cpuNum;
- private String configValue;
+ private Float memNum;
- private String defaultValue;
+ private Float diskNum;
- private Integer isModify;
+ private Float gpuNum;
- private Integer alreadyUpdate;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
index b19bbb6..b300b6d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClientEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClientEntity.java
index 452805f..823e2d1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClientEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClientEntity.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.common.enums.RecordStatus;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import java.sql.Timestamp;
@@ -28,17 +28,11 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class ClientEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class ClientEntity extends BaseRuntimeIdEntity {
private static final long serialVersionUID = 8204133370609215856L;
- /**
- * Primary key
- */
- @Schema(name = "id", description = "primary key")
- private Long id;
-
private String name;
private String platform;
@@ -65,13 +59,6 @@ public class ClientEntity extends BaseEntity {
@Schema(name = "protocol", example = "http", allowableValues = {"http", "grpc", "tcp"})
private String protocol;
- /**
- * 0: not active, 1: active
- *
- * @see RecordStatus
- */
- @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
- private Integer status;
/**
* csv format config id list.<br> Example value: 1,2,7<br> This field is updated when the configuration is modified via the web API, but is not
@@ -87,8 +74,5 @@ public class ClientEntity extends BaseEntity {
private Timestamp endTime;
- public void setStatusEntity(RecordStatus status) {
- this.status = status.getNumber();
- }
}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
index 78b008c..c200814 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
@@ -22,8 +23,10 @@ import org.apache.eventmesh.dashboard.common.enums.ClusterType;
import java.time.LocalDateTime;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
+@EqualsAndHashCode(callSuper = true)
public class ClusterAndRelationshipEntity extends ClusterEntity {
private LocalDateTime relationshipTime;
@@ -32,6 +35,6 @@ public class ClusterAndRelationshipEntity extends ClusterEntity {
private ClusterType relationshipType;
- private Integer status;
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterEntity.java
index 121fe8e..76000b3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterEntity.java
@@ -15,36 +15,35 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+package org.apache.eventmesh.dashboard.console.entity.cluster;
+import org.apache.eventmesh.dashboard.common.enums.ClusterOwnType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseSyncEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
+/**
+ *
+ */
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class ClusterEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class ClusterEntity extends BaseSyncEntity {
- private String name;
-
- private ClusterTrusteeshipType trusteeshipType;
-
- private ClusterType clusterType;
-
- private String version;
private String jmxProperties;
+ private String config;
+
private String description;
- private Integer authType;
+ private String authType;
- private Integer runState;
- private Integer status;
+ /**
+ * 如何解除共享
+ */
+ private ClusterOwnType clusterOwnType;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
index c930ed1..2b1baae 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
@@ -15,22 +15,32 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
+
+import java.time.LocalDateTime;
import lombok.Data;
+import lombok.EqualsAndHashCode;
@Data
-public class ClusterRelationshipEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class ClusterRelationshipEntity extends BaseClusterIdEntity {
- private ClusterType clusterType;
+ /**
+ *
+ */
private Long relationshipId;
private ClusterType relationshipType;
- private Integer status;
+ private LocalDateTime relationshipTime;
+
+ private LocalDateTime unRelationshipTime;
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ConnectionEntity.java
index 9f8468a..1444cf3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ConnectionEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ConnectionEntity.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.common.enums.RecordStatus;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import java.sql.Timestamp;
@@ -32,8 +32,8 @@ import lombok.EqualsAndHashCode;
* A Connection is a link from a source to a sink.
*/
@Data
-@EqualsAndHashCode(callSuper = true, exclude = {"status", "endTime"})
-public class ConnectionEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class ConnectionEntity extends BaseRuntimeIdEntity {
private static final long serialVersionUID = 6565578252656944905L;
@@ -69,9 +69,6 @@ public class ConnectionEntity extends BaseEntity {
private Long runtimeId;
- @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
- private Integer status;
-
private String topic;
private Long groupId;
@@ -80,8 +77,4 @@ public class ConnectionEntity extends BaseEntity {
private String description;
-
- public void setStatusEnum(RecordStatus statusEnum) {
- this.status = statusEnum.getNumber();
- }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/InstanceUserEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/InstanceUserEntity.java
index 35c0fc5..89b2162 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/InstanceUserEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/InstanceUserEntity.java
@@ -15,17 +15,18 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class InstanceUserEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class InstanceUserEntity extends BaseRuntimeIdEntity {
private Integer instanceType;
@@ -37,6 +38,4 @@ public class InstanceUserEntity extends BaseEntity {
private String token;
- private Integer status;
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/NetConnectionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/NetConnectionEntity.java
index f9785fb..e4a27b6 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/NetConnectionEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/NetConnectionEntity.java
@@ -15,9 +15,10 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import java.time.LocalDateTime;
@@ -26,7 +27,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class NetConnectionEntity extends BaseEntity {
+public class NetConnectionEntity extends BaseRuntimeIdEntity {
private Long clusterId;
@@ -41,7 +42,6 @@ public class NetConnectionEntity extends BaseEntity {
private Integer runtimePort;
- private int status;
private String description;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
index 750f265..3850d0d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+package org.apache.eventmesh.dashboard.console.entity.cluster;
-import java.time.LocalDateTime;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseSyncEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -28,23 +27,30 @@ import lombok.EqualsAndHashCode;
*
*/
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class RuntimeEntity extends BaseEntity {
-
- private String name;
+@EqualsAndHashCode(callSuper = true)
+public class RuntimeEntity extends BaseSyncEntity {
private String host;
+ /**
+ * 添加的时候只需要 host 与 post eventmesh runtime 是 admin port。通过 runtime admin 获得所有的配置。 meta 需要 host 与 post store host 与 post jmxPort
+ */
private Integer port;
private Integer jmxPort;
- private LocalDateTime startTimestamp;
+ private Integer adminPort;
private String rack;
- private Integer status;
-
private String endpointMap;
+ private String createScriptContent;
+
+ private Long kubernetesClusterId;
+
+ private String authType;
+
+
+
}
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 5bab3fc..416df43 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
@@ -15,11 +15,11 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.connector;
import org.apache.eventmesh.dashboard.common.enums.KubernetesPodStatus;
-import org.apache.eventmesh.dashboard.common.enums.RecordStatus;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -27,8 +27,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class ConnectorEntity extends BaseEntity {
+@EqualsAndHashCode(callSuper = true)
+public class ConnectorEntity extends BaseRuntimeIdEntity {
private static final long serialVersionUID = -8226303660232951326L;
@@ -40,14 +40,6 @@ public class ConnectorEntity extends BaseEntity {
private String type;
- /**
- * 0: not active, 1: active
- *
- * @see RecordStatus
- */
- @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
- private Integer status;
-
private String host;
private Integer port;
@@ -65,9 +57,6 @@ public class ConnectorEntity extends BaseEntity {
*/
private String configIds;
- public void setStatusEnum(RecordStatus statusEnum) {
- this.status = statusEnum.getNumber();
- }
public void setKubernetesPodStatusEnum(KubernetesPodStatus kubernetesPodStatusEnum) {
this.podState = kubernetesPodStatusEnum.getNumber();
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
index cdf3140..e1c23d2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
@@ -15,30 +15,33 @@
* limitations under the License.
*/
+
package org.apache.eventmesh.dashboard.console.entity.function;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class ConfigEntity extends BaseEntity {
-
- private Long id;
+public class ConfigEntity extends BaseClusterIdEntity {
- private Long clusterId;
private String businessType;
+ private Long retrospectId;
+
/**
* config type 0:runtime,1:storage,2:connector,3:topic
*/
- private Integer instanceType;
+ private MetadataType instanceType;
private Long instanceId;
... 27821 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org