Skip to content

Commit

Permalink
add remoting service and move models into common module
Browse files Browse the repository at this point in the history
  • Loading branch information
Lambert-Rao committed Mar 27, 2024
1 parent 1dfc379 commit 413ba11
Show file tree
Hide file tree
Showing 99 changed files with 2,417 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.constant;
package org.apache.eventmesh.dashboard.common.constant;

public class ApiPrefix {
public static final String API_PREFIX = "/eventmesh-dashboard/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.constant.health;
package org.apache.eventmesh.dashboard.common.constant.health;

public class HealthCheckTypeConstant {

Expand All @@ -35,5 +35,5 @@ public class HealthCheckTypeConstant {
public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_TOPIC = "rocketmq4-topic";

public static final String HEALTH_CHECK_SUBTYPE_NACOS_CONFIG = "nacos-config";
public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTER = "nacos-register";
public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY = "nacos-registry";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.constant.health;
package org.apache.eventmesh.dashboard.common.constant.health;

public class HealthConstant {
public static final String NEW_LINE_ENDING = "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums;
package org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum StatusEnum {
public enum DataStatus {
INACTIVE(0, "Inactive"),
ACTIVE(1, "Active");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums;
package org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum StoreType {

STANDALONE(0, "Standalone"),
ROCKETMQ(1, "RocketMQ"),
KAFKA(2, "Kafka"),
PULSAR(3, "Pulsar"),
RABBITMQ(4, "RabbitMQ"),
REDIS(5, "Redis");

@Getter
private final Integer number;
@Getter
private final String name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums.health;
package org.apache.eventmesh.dashboard.common.enums.health;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,24 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums.health;
package org.apache.eventmesh.dashboard.common.enums.health;

import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER;
import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME;
import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE;
import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC;
import static org.apache.eventmesh.dashboard.console.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN;
import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum HealthCheckType {
UNKNOWN(0, HEALTH_CHECK_TYPE_UNKNOWN),
UNKNOWN(0, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN),

CLUSTER(1, HEALTH_CHECK_TYPE_CLUSTER),
CLUSTER(1, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER),

RUNTIME(2, HEALTH_CHECK_TYPE_RUNTIME),
RUNTIME(2, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME),

TOPIC(3, HEALTH_CHECK_TYPE_TOPIC),
TOPIC(3, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC),

STORAGE(4, HEALTH_CHECK_TYPE_STORAGE);
STORAGE(4, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE);

@Getter
private final Integer number;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.common.enums.metadata;

public enum MetadataServiceTypeEnum {

RUNTIME,

CENTER_ETCD,

META_NACOS,

TOPIC,

CLUSTER,

CLIENT,

GROUP,

CONNECTION,


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.common.enums.metadata;

public enum MetadataTypeEnum {

CENTER,

CLUSTER,

RUNTIME,

TOPIC,

GROUP,

SUBSCRIPTION,

STORE
;

}
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.common.model.metadata;

import lombok.Data;

@Data
public class AclMetadata {

private Long clusterId;
private String principal;
private Integer operation;
private String permissionType;
private String host;
private String resourceType;
private String resourceName;
private Integer patternType;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.common.model.metadata;

import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum;

import lombok.Data;

@Data
public class ClientMetadata extends MetadataConfig {


{
this.setServiceTypeEnums(MetadataServiceTypeEnum.CLIENT);
}

private String name;

private String platform;

/**
* programing language of client
*/
private String language;

/**
* process id
*/
private Long pid;

private String host;

private Integer port;

/**
* protocol used to connect to runtime.
*/
private String protocol;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.common.model.metadata;

import org.apache.eventmesh.dashboard.common.enums.StoreType;
import org.apache.eventmesh.dashboard.common.enums.metadata.MetadataServiceTypeEnum;

import lombok.Data;

@Data
public class ClusterMetadata extends MetadataConfig {

{
this.setServiceTypeEnums(MetadataServiceTypeEnum.CLUSTER);
}

private String clusterName;

private String registryAddress;

private String bootstrapServers;

private String eventmeshVersion;

private String clientProperties;

private String jmxProperties;

private String regProperties;

private Integer authType;

private Integer runState;

private Integer status;

private StoreType storeType;

private String description;
}
Loading

0 comments on commit 413ba11

Please sign in to comment.