This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
forked from MORE-Platform/more-studymanager-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple LoggerAction and set handler interval to 1 minute
- Loading branch information
Thomas Kurz
committed
Jan 29, 2024
1 parent
5b2534c
commit 3037835
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...ntervention/src/main/java/io/redlink/more/studymanager/component/action/LoggerAction.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,22 @@ | ||
package io.redlink.more.studymanager.component.action; | ||
|
||
import io.redlink.more.studymanager.core.component.Action; | ||
import io.redlink.more.studymanager.core.exception.ConfigurationValidationException; | ||
import io.redlink.more.studymanager.core.io.ActionParameter; | ||
import io.redlink.more.studymanager.core.properties.ActionProperties; | ||
import io.redlink.more.studymanager.core.sdk.MoreActionSDK; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class LoggerAction extends Action<ActionProperties> { | ||
|
||
protected LoggerAction(MoreActionSDK sdk, ActionProperties properties) throws ConfigurationValidationException { | ||
super(sdk, properties); | ||
} | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(LoggerAction.class); | ||
@Override | ||
public void execute(ActionParameter parameter) { | ||
LOGGER.info(parameter.toString()); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...tion/src/main/java/io/redlink/more/studymanager/component/action/LoggerActionFactory.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 io.redlink.more.studymanager.component.action; | ||
|
||
import io.redlink.more.studymanager.core.exception.ConfigurationValidationException; | ||
import io.redlink.more.studymanager.core.factory.ActionFactory; | ||
import io.redlink.more.studymanager.core.properties.ActionProperties; | ||
import io.redlink.more.studymanager.core.sdk.MoreActionSDK; | ||
|
||
public class LoggerActionFactory extends ActionFactory<LoggerAction, ActionProperties> { | ||
@Override | ||
public LoggerAction create(MoreActionSDK sdk, ActionProperties properties) throws ConfigurationValidationException { | ||
return new LoggerAction(sdk, properties); | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return "logger-action"; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return "Logger Action"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Logs to info level"; | ||
} | ||
} |
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