32 lines
906 B
Java
32 lines
906 B
Java
package lightcontainer.protocol;
|
|
|
|
public class HelloRule extends Protocol {
|
|
// Variables
|
|
|
|
// Constructor
|
|
protected HelloRule() {
|
|
super("HELLO", "HELLO "); // TODO : add the regex here (sbe_hello = "HELLO bl domain bl port line")
|
|
}
|
|
|
|
/**
|
|
* Execute the rule on a command.
|
|
*
|
|
* This function allows you to check a command and process those groups (parameters)
|
|
* use the utility functions of {@link Protocol} to facilitate processing, see @see.
|
|
*
|
|
* @param cmd Command on which to execute the rule.
|
|
* @see Protocol#execute(String)
|
|
* @see #matcherCheck(String)
|
|
* @see #matcherGetGroups()
|
|
* @since 1.0
|
|
*/
|
|
@Override
|
|
public void execute(String cmd) {
|
|
if (matcherCheck(cmd)) {
|
|
System.out.println("Good rule ;-) !");
|
|
} else {
|
|
System.out.println("OUPPS unknown rule !");
|
|
}
|
|
}
|
|
}
|