-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added enable/disable and the ability to provide custom rules
- Loading branch information
Showing
11 changed files
with
254 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package emissary.core.sentinel.rules; | ||
|
||
import emissary.core.sentinel.Sentinel; | ||
|
||
import java.util.Map; | ||
|
||
public class Exit extends Rule { | ||
|
||
public Exit(String place, long timeLimit, double threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
public Exit(String place, String timeLimit, String threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
@Override | ||
public void action(Map<String, Sentinel.Tracker> tracker, String placeSimpleName, Integer counter) { | ||
logger.error("Sentinel detected unrecoverable agent(s) running [{}], exiting now!!", placeSimpleName); | ||
System.exit(1); | ||
} | ||
} |
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,22 @@ | ||
package emissary.core.sentinel.rules; | ||
|
||
import emissary.core.sentinel.Sentinel; | ||
import emissary.server.EmissaryServer; | ||
|
||
import java.util.Map; | ||
|
||
public class Kill extends Rule { | ||
public Kill(String place, long timeLimit, double threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
public Kill(String place, String timeLimit, String threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
@Override | ||
public void action(Map<String, Sentinel.Tracker> tracker, String placeSimpleName, Integer counter) { | ||
logger.error("Sentinel detected unrecoverable agent(s) running [{}], initiating forceful shutdown...", placeSimpleName); | ||
EmissaryServer.stopServerForce(); | ||
} | ||
} |
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 emissary.core.sentinel.rules; | ||
|
||
import emissary.core.sentinel.Sentinel; | ||
|
||
import java.util.Map; | ||
|
||
public class Notify extends Rule { | ||
public Notify(String place, long timeLimit, double threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
public Notify(String place, String timeLimit, String threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
@Override | ||
public void action(Map<String, Sentinel.Tracker> tracker, String placeSimpleName, Integer counter) { | ||
logger.warn("Sentinel detected locked agent(s) running [{}]", placeSimpleName); | ||
} | ||
} |
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,21 @@ | ||
package emissary.core.sentinel.rules; | ||
|
||
import emissary.core.sentinel.Sentinel; | ||
|
||
import java.util.Map; | ||
|
||
public class Recover extends Rule { | ||
public Recover(String place, long timeLimit, double threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
public Recover(String place, String timeLimit, String threshold) { | ||
super(place, timeLimit, threshold); | ||
} | ||
|
||
@Override | ||
public void action(Map<String, Sentinel.Tracker> tracker, String placeSimpleName, Integer counter) { | ||
logger.warn("Sentinel attempting recovery mode..."); | ||
throw new UnsupportedOperationException("Recovery unavailable"); | ||
} | ||
} |
Oops, something went wrong.