Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ public class ClusterRequest {
@ApiModelProperty(value = "Primary key")
private Integer id;

@NotBlank
@NotBlank(message = "cluster name cannot be blank")
@ApiModelProperty(value = "Cluster name")
private String name;

@NotBlank
@NotBlank(message = "cluster type cannot be blank")
@ApiModelProperty(value = "Cluster type, including TUBE, PULSAR, DATA_PROXY, etc.")
private String type;

@ApiModelProperty(value = "Cluster url")
private String url;

@NotBlank
@NotBlank(message = "clusterTags cannot be blank")
@ApiModelProperty(value = "Cluster tags, separated by commas")
private String clusterTags;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ public class PulsarClusterDTO {

private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); // thread safe

@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080")
@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080",
notes = "Pulsar service URL is the 'url' field of the cluster")
private String adminUrl;

@ApiModelProperty(value = "Pulsar tenant")
private String tenant;
@ApiModelProperty(value = "Pulsar tenant, default is 'public'")
private String tenant = "public";

/**
* Get the dto instance from the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
@ApiModel("Inlong cluster info for Pulsar")
public class PulsarClusterInfo extends ClusterInfo {

@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080")
@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080",
notes = "Pulsar service URL is the 'url' field of the cluster")
private String adminUrl;

@ApiModelProperty(value = "Pulsar tenant")
private String tenant;
@ApiModelProperty(value = "Pulsar tenant, default is 'public'")
private String tenant = "public";

public PulsarClusterInfo() {
this.setType(ClusterType.PULSAR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.apache.inlong.manager.common.pojo.cluster.ClusterRequest;
import org.apache.inlong.manager.common.util.JsonTypeDefine;

import javax.validation.constraints.NotBlank;

/**
* Inlong cluster request for Pulsar
*/
Expand All @@ -36,12 +38,13 @@
@ApiModel("Inlong cluster request for Pulsar")
public class PulsarClusterRequest extends ClusterRequest {

@NotBlank(message = "adminUrl cannot be blank")
@ApiModelProperty(value = "Pulsar admin URL, such as: http://127.0.0.1:8080",
notes = "Pulsar service URL is the 'url' field of the cluster")
private String adminUrl;

@ApiModelProperty(value = "Pulsar tenant")
private String tenant;
@ApiModelProperty(value = "Pulsar tenant, default is 'public'")
private String tenant = "public";

public PulsarClusterRequest() {
this.setType(ClusterType.PULSAR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
Expand All @@ -43,7 +44,9 @@ public class TubeClusterDTO {

private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); // thread safe

@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080")
@NotBlank(message = "masterWebUrl cannot be blank")
@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080",
notes = "Tube master RPC URL is the 'url' field of the cluster")
private String masterWebUrl;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
@ApiModel("Inlong cluster info for Tube")
public class TubeClusterInfo extends ClusterInfo {

@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080")
@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080",
notes = "Tube master RPC URL is the 'url' field of the cluster")
private String masterWebUrl;

public TubeClusterInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
@ApiModel("Inlong cluster request for Tube")
public class TubeClusterRequest extends ClusterRequest {

@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080")
@ApiModelProperty(value = "Master Web URL http://120.0.0.1:8080",
notes = "Tube master RPC URL is the 'url' field of the cluster")
private String masterWebUrl;

// no field

public TubeClusterRequest() {
this.setType(ClusterType.TUBE);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
@JsonTypeInfo(use = Id.NAME, visible = true, property = "mqType")
public class InlongGroupRequest {

@NotBlank(message = "inlongGroupId cannot be blank")
@ApiModelProperty(value = "Inlong group id", required = true)
@Length(min = 4, max = 200)
@Pattern(regexp = "^(?![0-9]+$)[a-z][a-z0-9_-]{1,200}$",
message = "inlongGroupId must starts with a lowercase letter "
+ "and contains only lowercase letters, digits, `-` or `_`")
@Length(min = 4, max = 100, message = "inlongGroupId length must be between 4 and 100")
@Pattern(regexp = "^[a-z0-9_-]{4,100}$",
message = "inlongGroupId only supports lowercase letters, numbers, '-', or '_'")
private String inlongGroupId;

@ApiModelProperty(value = "Inlong group name", required = true)
Expand Down Expand Up @@ -121,13 +121,12 @@ public void checkParams() {
throw new BusinessException("inlongGroupId cannot be null");
}

if (inlongGroupId.length() < 4 || inlongGroupId.length() > 200) {
throw new BusinessException("characters for inlongGroupId must be more than 4 and less than 200");
if (inlongGroupId.length() < 4 || inlongGroupId.length() > 100) {
throw new BusinessException("characters for inlongGroupId must be more than 4 and less than 100");
}

if (!SmallTools.isLowerOrNum(inlongGroupId)) {
throw new BusinessException("inlongGroupId must starts with a lowercase letter "
+ "and contains only lowercase letters, digits, `-` or `_`");
throw new BusinessException("inlongGroupId only supports lowercase letters, numbers, '-', or '_'");
}

if (StringUtils.isBlank(mqType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public class DataNodeRequest {
@ApiModelProperty(value = "Primary key")
private Integer id;

@NotBlank
@ApiModelProperty(value = "Node name")
@NotBlank(message = "node name cannot be blank")
@ApiModelProperty(value = "Node name")
private String name;

@NotBlank
@NotBlank(message = "node type cannot be blank")
@ApiModelProperty(value = "Node type, including MYSQL, HIVE, KAFKA, ES, etc.")
private String type;

Expand All @@ -56,13 +56,13 @@ public class DataNodeRequest {
@ApiModelProperty(value = "Node username")
private String username;

@ApiModelProperty(value = "Node token")
@ApiModelProperty(value = "Node token if needed")
private String token;

@ApiModelProperty(value = "Extended params")
private String extParams;

@NotBlank
@NotBlank(message = "inCharges cannot be blank")
@ApiModelProperty(value = "Name of responsible person, separated by commas", required = true)
private String inCharges;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.inlong.manager.common.pojo.common.UpdateValidation;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;
import java.util.Map;

Expand All @@ -36,22 +40,26 @@
@JsonTypeInfo(use = Id.NAME, visible = true, property = "sinkType")
public class SinkRequest {

@ApiModelProperty("Sink id")
@NotNull(groups = UpdateValidation.class)
@ApiModelProperty(value = "Primary key")
private Integer id;

@NotBlank(message = "inlongGroupId cannot be null")
@NotBlank(message = "inlongGroupId cannot be blank")
@ApiModelProperty("Inlong group id")
private String inlongGroupId;

@NotBlank(message = "inlongStreamId cannot be null")
@NotBlank(message = "inlongStreamId cannot be blank")
@ApiModelProperty("Inlong stream id")
private String inlongStreamId;

@NotBlank(message = "sinkType cannot be null")
@NotBlank(message = "sinkType cannot be blank")
@ApiModelProperty("Sink type, including: HIVE, ES, etc.")
private String sinkType;

@NotBlank(message = "sinkName cannot be null")
@NotBlank(message = "sinkName cannot be blank")
@Length(min = 1, max = 100, message = "sinkName length must be between 1 and 100")
@Pattern(regexp = "^[a-z0-9_-]{1,100}$",
message = "sinkName only supports lowercase letters, numbers, '-', or '_'")
@ApiModelProperty("Sink name, unique in one stream")
private String sinkName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.inlong.manager.common.pojo.common.UpdateValidation;
import org.apache.inlong.manager.common.pojo.stream.StreamField;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
Expand All @@ -35,21 +39,26 @@
@JsonTypeInfo(use = Id.NAME, visible = true, property = "sourceType")
public class SourceRequest {

@NotNull(groups = UpdateValidation.class)
@ApiModelProperty(value = "Primary key")
private Integer id;

@NotBlank(message = "inlongGroupId cannot be null")
@NotBlank(message = "inlongGroupId cannot be blank")
@ApiModelProperty("Inlong group id")
private String inlongGroupId;

@NotBlank(message = "inlongStreamId cannot be null")
@NotBlank(message = "inlongStreamId cannot be blank")
@ApiModelProperty("Inlong stream id")
private String inlongStreamId;

@NotBlank(message = "sourceType cannot be null")
@NotBlank(message = "sourceType cannot be blank")
@ApiModelProperty("Source type, including: FILE, KAFKA, etc.")
private String sourceType;

@NotBlank(message = "sourceName cannot be null")
@NotBlank(message = "sourceName cannot be blank")
@Length(min = 1, max = 100, message = "sourceName length must be between 1 and 100")
@Pattern(regexp = "^[a-z0-9_-]{1,100}$",
message = "sourceName only supports lowercase letters, numbers, '-', or '_'")
@ApiModelProperty("Source name, unique in one stream")
private String sourceName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.inlong.manager.common.enums.DataSeparator;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.nio.charset.StandardCharsets;
import java.util.List;

Expand All @@ -35,9 +38,14 @@ public class InlongStreamRequest {
@ApiModelProperty(value = "Primary key")
private Integer id;

@NotBlank(message = "inlongGroupId cannot be blank")
@ApiModelProperty(value = "Inlong group id")
private String inlongGroupId;

@NotBlank(message = "inlongStreamId cannot be blank")
@Length(min = 4, max = 100, message = "inlongStreamId length must be between 4 and 100")
@Pattern(regexp = "^[a-z0-9_-]{4,100}$",
message = "inlongStreamId only supports lowercase letters, numbers, '-', or '_'")
@ApiModelProperty(value = "Inlong stream id")
private String inlongStreamId;

Expand Down
Loading