mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 14:38:45 +00:00
added getter of shardname and checking for only numbers and chars in
shardname
This commit is contained in:
@@ -36,6 +36,10 @@ public class ShardNameDTO {
|
||||
}
|
||||
|
||||
public static ShardNameDTO create(String replicaSetName, String shardname) throws Exception {
|
||||
if(!shardname.matches("[a-zA-Z0-9]*")) {
|
||||
throw new Exception("Only a-z, A-Z and 0-9 characters are allowed in shardname!");
|
||||
}
|
||||
|
||||
final String name;
|
||||
// "S-" "-" "-"
|
||||
if (TargetGroup.SAILING_TARGET_GROUP_NAME_PREFIX.length() + 1 + replicaSetName.length() + 1
|
||||
@@ -63,6 +67,10 @@ public class ShardNameDTO {
|
||||
return targetGroupname;
|
||||
}
|
||||
|
||||
public String getShardName() {
|
||||
return shardName;
|
||||
}
|
||||
|
||||
public static boolean isValidTargetGroupName(String name) {
|
||||
boolean ret = true;
|
||||
if(
|
||||
|
||||
Reference in New Issue
Block a user