|
@@ -34,6 +34,7 @@ public class XxlJobExecutor {
|
|
|
private String appname;
|
|
private String appname;
|
|
|
private String address;
|
|
private String address;
|
|
|
private String ip;
|
|
private String ip;
|
|
|
|
|
+ private String includeIpPrefix;
|
|
|
private int port;
|
|
private int port;
|
|
|
private String logPath;
|
|
private String logPath;
|
|
|
private int logRetentionDays;
|
|
private int logRetentionDays;
|
|
@@ -53,6 +54,9 @@ public class XxlJobExecutor {
|
|
|
public void setIp(String ip) {
|
|
public void setIp(String ip) {
|
|
|
this.ip = ip;
|
|
this.ip = ip;
|
|
|
}
|
|
}
|
|
|
|
|
+ public void setIncludeIpPrefix(String includeIpPrefix) {
|
|
|
|
|
+ this.includeIpPrefix = includeIpPrefix;
|
|
|
|
|
+ }
|
|
|
public void setPort(int port) {
|
|
public void setPort(int port) {
|
|
|
this.port = port;
|
|
this.port = port;
|
|
|
}
|
|
}
|
|
@@ -83,6 +87,10 @@ public class XxlJobExecutor {
|
|
|
// init executor-server
|
|
// init executor-server
|
|
|
initEmbedServer(address, ip, port, appname, accessToken);
|
|
initEmbedServer(address, ip, port, appname, accessToken);
|
|
|
}
|
|
}
|
|
|
|
|
+ public boolean checkIncludeIpPrefix() {
|
|
|
|
|
+ String realIp = (ip != null && !ip.trim().isEmpty()) ? ip : IpUtil.getIp();
|
|
|
|
|
+ return includeIpPrefix == null || includeIpPrefix.trim().isEmpty() || includeIpPrefix.contains(realIp.split("\\.")[0]);
|
|
|
|
|
+ }
|
|
|
public void destroy(){
|
|
public void destroy(){
|
|
|
// destroy executor-server
|
|
// destroy executor-server
|
|
|
stopEmbedServer();
|
|
stopEmbedServer();
|