Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,237 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
rule-engine-api/src/main/java/org/jetlinks/rule/engine/api/cluster/RunMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.jetlinks.rule.engine.api.cluster; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
public enum RunMode { | ||
//集群模式 | ||
CLUSTER, | ||
//分布式模式 | ||
DISTRIBUTED | ||
} |
20 changes: 20 additions & 0 deletions
20
rule-engine-api/src/main/java/org/jetlinks/rule/engine/api/cluster/SchedulingRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.jetlinks.rule.engine.api.cluster; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
/** | ||
* 调度规则 | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class SchedulingRule implements Serializable { | ||
private String type; | ||
|
||
private Map<String, Object> configuration; | ||
} |
10 changes: 10 additions & 0 deletions
10
...pi/src/main/java/org/jetlinks/rule/engine/api/events/EventSupportRuleInstanceContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.jetlinks.rule.engine.api.events; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
public interface EventSupportRuleInstanceContext { | ||
|
||
void addEventListener(GlobalNodeEventListener listener); | ||
} |
11 changes: 11 additions & 0 deletions
11
...engine-api/src/main/java/org/jetlinks/rule/engine/api/events/GlobalNodeEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.jetlinks.rule.engine.api.events; | ||
|
||
import org.jetlinks.rule.engine.api.RuleData; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
public interface GlobalNodeEventListener { | ||
void onEvent(NodeExecuteEvent executeEvent); | ||
} |
26 changes: 26 additions & 0 deletions
26
rule-engine-api/src/main/java/org/jetlinks/rule/engine/api/events/NodeExecuteEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jetlinks.rule.engine.api.events; | ||
|
||
import lombok.*; | ||
import org.jetlinks.rule.engine.api.RuleData; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString | ||
public class NodeExecuteEvent implements RuleEvent { | ||
|
||
private String event; | ||
|
||
private String nodeId; | ||
|
||
private String instanceId; | ||
|
||
private RuleData ruleData; | ||
|
||
} |
5 changes: 4 additions & 1 deletion
5
rule-engine-api/src/main/java/org/jetlinks/rule/engine/api/events/RuleEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
package org.jetlinks.rule.engine.api.events; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
public interface RuleEvent { | ||
public interface RuleEvent extends Serializable { | ||
|
||
String NODE_EXECUTE_BEFORE = "NODE_EXECUTE_BEFORE"; | ||
|
||
String NODE_EXECUTE_FAIL = "NODE_EXECUTE_FAIL"; | ||
|
||
String NODE_EXECUTE_DONE = "NODE_EXECUTE_DONE"; | ||
|
||
String getEvent(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,4 @@ | |
|
||
public interface RuleHistoryRepository { | ||
void save(RuleHistoryPersistent persistent); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,4 @@ public interface RuleRepository { | |
|
||
Optional<RulePersistent> findRuleById(String ruleId); | ||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...-engine-cluster/src/main/java/org/jetlinks/rule/engine/cluster/ha/ClusterNotifyReply.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.jetlinks.rule.engine.cluster.ha; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ClusterNotifyReply implements Serializable { | ||
|
||
private String replyId; | ||
|
||
private String address; | ||
|
||
private Object reply; | ||
|
||
private boolean success; | ||
|
||
private String errorType; | ||
|
||
private String errorMessage; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ine-cluster/src/main/java/org/jetlinks/rule/engine/cluster/message/InitRuleNodeError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.jetlinks.rule.engine.cluster.message; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author zhouhao | ||
* @since 1.0.0 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class InitRuleNodeError implements Serializable { | ||
private static final long serialVersionUID = -6849794470754667710L; | ||
|
||
private String instanceId; | ||
|
||
private String nodeId; | ||
|
||
private String errorType; | ||
|
||
private String errorMessage; | ||
} |
Oops, something went wrong.