Search in sources :

Example 1 with SessionSavingMode

use of com.cognifide.apm.api.actions.SessionSavingMode in project APM by Cognifide.

the class SessionSave method process.

private ActionResult process(final Context context, boolean execute) {
    ActionResult actionResult = context.createActionResult();
    if (execute) {
        try {
            SessionSavingMode savingMode = SessionSavingMode.valueOfMode(mode);
            SessionSavingPolicy savingPolicy = context.getSavingPolicy();
            savingPolicy.setMode(savingMode);
            actionResult.logMessage("Session saving mode set to: " + mode);
        } catch (IllegalArgumentException e) {
            actionResult.logError(MessagingUtils.createMessage(e));
        }
    }
    return actionResult;
}
Also used : ActionResult(com.cognifide.apm.api.actions.ActionResult) SessionSavingMode(com.cognifide.apm.api.actions.SessionSavingMode) SessionSavingPolicy(com.cognifide.apm.api.actions.SessionSavingPolicy)

Aggregations

ActionResult (com.cognifide.apm.api.actions.ActionResult)1 SessionSavingMode (com.cognifide.apm.api.actions.SessionSavingMode)1 SessionSavingPolicy (com.cognifide.apm.api.actions.SessionSavingPolicy)1