forked from apache/eventmesh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fixes apache#21 ADD: connection related code: Connection/Client/Connector: Mapper,Entity Connection: ConnectionService,ConnectionDataService others: eventmesh-dashboard.sql test resources MODIFY: pom file: remove dependency of junit, spring-boot-starter-test contains it. pom file: let service module depend on core module. * [ISSUE apache#23] Integrate Checkstyle into Build and CI process (apache#24) * integrate checkstyle * fix import order & remove excessive try-catch * [ISSUE apache#23] Integrate Checkstyle into Build and CI process (apache#24) * integrate checkstyle * fix import order & remove excessive try-catch * fixes apache#21 fixed according to PR#22 conversation Database schema definition modified * fix checkstyle for ConnectorMapper * fix: add StatusEnum add enum support for entity class. * fix: rename KubernetesPodStatus * fix checkstyle --------- Co-authored-by: Pil0tXia <[email protected]>
- Loading branch information
1 parent
828b8f9
commit f7f3a60
Showing
30 changed files
with
1,370 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SchedulerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class SchedulerConfig { | ||
|
||
@Bean | ||
public ThreadPoolTaskScheduler taskScheduler() { | ||
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); | ||
taskScheduler.setPoolSize(5); | ||
return taskScheduler; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...-console/src/main/java/org/apache/eventmesh/dashboard/console/config/SpringDocConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* 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.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.info.License; | ||
|
||
@Configuration | ||
public class SpringDocConfig { | ||
|
||
@Bean | ||
public OpenAPI eventmeshDashboardConsoleOpenAPI() { | ||
return new OpenAPI() | ||
.info(new Info() | ||
.title("Eventmesh Dashboard Console API") | ||
.version("v1") | ||
.license(new License() | ||
.name("License: Apache 2.0") | ||
.url("http://www.apache.org/licenses/LICENSE-2.0") | ||
) | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...oard-console/src/main/java/org/apache/eventmesh/dashboard/console/constant/ApiPrefix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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.constant; | ||
|
||
public class ApiPrefix { | ||
public static final String API_PREFIX = "/eventmesh-dashboard/"; | ||
|
||
public static final String API_V1_PREFIX = API_PREFIX + "v1/"; | ||
} |
25 changes: 25 additions & 0 deletions
25
...va/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.controller.connection; | ||
|
||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class ConnectionController { | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
...-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* 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.dto; | ||
|
||
import java.io.Serializable; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
|
||
public class ConnectionResponse implements Serializable { | ||
|
||
private static final long serialVersionUID = -7317308457824435889L; | ||
|
||
@Schema(name = "id", description = "primary key of table connection") | ||
private Long id; | ||
|
||
@Schema(name = "sourceType", defaultValue = "connector", allowableValues = {"connector", "client"}) | ||
private String sourceType; | ||
|
||
@Schema(name = "sourceId", description = "connectorId or clientId") | ||
private Long sourceId; | ||
|
||
@Schema(name = "sourceStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active") | ||
private Integer sourceStatus; | ||
|
||
// @Schema(name = "sourceConfigList", description = "source config list") | ||
// private List<ConfigEntity> sourceConfigList; | ||
|
||
@Schema(name = "sinkType", defaultValue = "connector", allowableValues = {"connector", "client"}) | ||
private String sinkType; | ||
|
||
@Schema(name = "sinkId", description = "connectorId or clientId") | ||
private Long sinkId; | ||
|
||
@Schema(name = "sinkStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active") | ||
private Integer sinkStatus; | ||
|
||
// @Schema(name = "sinkConfigList", description = "sink config list") | ||
// private List<ConfigEntity> sinkConfigList; | ||
|
||
private Long runtimeId; | ||
|
||
@Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active") | ||
private Integer status; | ||
|
||
@Schema(name = "topic", description = "related topic name from storage") | ||
private String topic; | ||
|
||
private Long groupId; | ||
|
||
private String groupName; | ||
|
||
private String description; | ||
} |
38 changes: 38 additions & 0 deletions
38
...-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.dashboard.console.entity.base; | ||
|
||
import java.io.Serializable; | ||
import java.sql.Timestamp; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
@Schema(name = "BaseEntity", description = "Base entity") | ||
public class BaseEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = -2697805837923579585L; | ||
|
||
private Long clusterId; | ||
|
||
protected Timestamp createTime; | ||
|
||
protected Timestamp updateTime; | ||
} |
95 changes: 95 additions & 0 deletions
95
...sole/src/main/java/org/apache/eventmesh/dashboard/console/entity/client/ClientEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* 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.client; | ||
|
||
import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity; | ||
import org.apache.eventmesh.dashboard.console.enums.StatusEnum; | ||
|
||
import java.sql.Timestamp; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ClientEntity extends BaseEntity { | ||
|
||
private static final long serialVersionUID = 8204133370609215856L; | ||
|
||
/** | ||
* Primary key | ||
*/ | ||
@Schema(name = "id", description = "primary key") | ||
private Long id; | ||
|
||
private String name; | ||
|
||
private String platform; | ||
|
||
/** | ||
* programing language of client | ||
*/ | ||
@Schema(name = "language", example = "java") | ||
private String language; | ||
|
||
/** | ||
* process id | ||
*/ | ||
@Schema(name = "pid", description = "process id") | ||
private Long pid; | ||
|
||
private String host; | ||
|
||
private Integer port; | ||
|
||
/** | ||
* protocol used to connect to runtime. | ||
*/ | ||
@Schema(name = "protocol", example = "http", allowableValues = {"http", "grpc", "tcp"}) | ||
private String protocol; | ||
|
||
/** | ||
* 0: not active, 1: active | ||
* @see StatusEnum | ||
*/ | ||
@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 used during the configuration retrieval process. | ||
*/ | ||
private String configIds; | ||
|
||
private String description; | ||
|
||
/** | ||
* The time when the client is terminated. | ||
*/ | ||
private Timestamp endTime; | ||
|
||
public void setStatusEntity(StatusEnum status) { | ||
this.status = status.getNumber(); | ||
} | ||
} | ||
|
Oops, something went wrong.