Skip to content

Commit

Permalink
fix(*):1. 格式化代码 。2. 第一次整理代码
Browse files Browse the repository at this point in the history
  • Loading branch information
jie@apache.org committed Jun 6, 2024
1 parent 8e3edc3 commit ae4da16
Show file tree
Hide file tree
Showing 178 changed files with 1,402 additions and 1,642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.common.constant;

public class ApiPrefix {

public static final String API_PREFIX = "/eventmesh-dashboard/";

public static final String API_V1_PREFIX = API_PREFIX + "v1/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.common.constant;

public class StoreTypeConstant {

public static final String STORE_TYPE_TYPE_UNKNOWN = "unknown";
public static final String STORE_TYPE_STANDALONE = "standalone";
public static final String STORE_TYPE_REDIS = "redis";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.common.constant.health;

public class HealthConstant {

public static final String NEW_LINE_ENDING = "\n";

public static final String RUNTIME_CHECK_TOPIC = "eventmesh-dashboard-healthcheck-topic";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ public static <T> Result<T> success(T data) {
}

/**
* The request is valid and the result is returned in {@link ResponseEntity}.
* Logic issues should use 422 Unprocessable Entity instead of 200 OK.
* 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)));
Expand Down Expand Up @@ -126,8 +125,7 @@ public StatusMessage(BaseException e) {
}

/**
* Only recommended for returning successful results,
* the stack trace cannot be displayed when returning unsuccessful results.
* Only recommended for returning successful results, the stack trace cannot be displayed when returning unsuccessful results.
*/
public StatusMessage(Status status) {
this.status = status.name();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

public enum ClusterTrusteeshipType {

//
FIRE_AND_FORGET_TRUSTEESHIP,

// 发现 or 长时间没有上线 cluster sync db
TRUSTEESHIP,

REVERSE,

NO_TRUSTEESHIP;

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
package org.apache.eventmesh.dashboard.common.enums;
/*
* 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.
*/

import lombok.Getter;
package org.apache.eventmesh.dashboard.common.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import lombok.Getter;

public enum ClusterType {

DEFAULT(1),
Expand Down Expand Up @@ -52,66 +69,56 @@ public enum ClusterType {


public static final List<ClusterType> STORAGE_TYPES = getStorage();


private static List<ClusterType> getStorage(){
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);
}
}
return list;
}


@Getter
private ClusterType eventmeshNodeType;

@Getter
private ClusterType assemblyName;

@Getter
private ClusterType assemblyNodeType;

@Getter
private ClusterType assemblyBusiness;

@Getter
private RemotingType remotingType;

@Getter
private int code;



ClusterType(int code) {
this.code = code;
}

ClusterType(ClusterType eventmeshNodeType, ClusterType assemblyName, ClusterType assemblyNodeType, ClusterType assemblyBusiness, RemotingType remotingType) {

ClusterType(ClusterType eventmeshNodeType, ClusterType assemblyName, ClusterType assemblyNodeType, ClusterType assemblyBusiness,
RemotingType remotingType) {
this.eventmeshNodeType = eventmeshNodeType;
this.assemblyName = assemblyName;
this.assemblyNodeType = assemblyNodeType;
this.assemblyBusiness = assemblyBusiness;
this.remotingType = remotingType;
}

private static List<ClusterType> getStorage() {
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);
}
}
return list;
}

public boolean isMainCluster(){
return Objects.equals(this, ClusterType.EVENTMESH_CLUSTER ) || Objects.equals(this.assemblyNodeType, ClusterType.CLUSTER );
public boolean isMainCluster() {
return Objects.equals(this, ClusterType.EVENTMESH_CLUSTER) || Objects.equals(this.assemblyNodeType, ClusterType.CLUSTER);
}

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);
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 boolean isSecondFloor() {
return Objects.equals(eventmeshNodeType, ClusterType.STORAGE) ? (Objects.equals(assemblyNodeType, ClusterType.RUNTIME)
|| Objects.equals(assemblyNodeType, ClusterType.META)) : false;
return Objects.equals(eventmeshNodeType, ClusterType.STORAGE) ? (Objects.equals(assemblyNodeType, ClusterType.RUNTIME) || Objects.equals(
assemblyNodeType, ClusterType.META)) : false;
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 RemotingType {
Expand All @@ -15,6 +32,5 @@ public enum RemotingType {
EVENT_MESH_ETCD,

ROCKETMQ,
ROCKETMQ_NAMESERVER
;
ROCKETMQ_NAMESERVER;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

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

import lombok.Data;
import lombok.EqualsAndHashCode;
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 lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ClusterMetadata extends MetadataConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/*
* 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;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;

import lombok.Data;


@Data
public class ClusterRelationshipMetadata extends MetadataConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

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

import lombok.EqualsAndHashCode;
import org.apache.eventmesh.dashboard.common.enums.RecordStatus;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
package org.apache.eventmesh.dashboard.common.model.remoting;

public class BaseGlobalResult extends GlobalResult<String> {

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

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

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

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

import org.apache.eventmesh.dashboard.common.enums.RemotingType;

public @interface RemotingAction {

boolean support();
boolean support();

RemotingType substitution();
RemotingType substitution();

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

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

public enum RemotingOperate {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.common.model.remoting.acl;

public class CreateAclRequest {

//acl is included in runtime config
private String runtimeAddress;
}
Loading

0 comments on commit ae4da16

Please sign in to comment.