All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sirius.biz.jobs.JobDescription Maven / Gradle / Ivy

There is a newer version: 9.6
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.biz.jobs;

import sirius.kernel.async.Tasks;
import sirius.kernel.commons.Context;
import sirius.kernel.di.std.Named;
import sirius.kernel.di.std.Priorized;
import sirius.web.tasks.ManagedTaskContext;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;

/**
 * Created by aha on 22.07.16.
 */
public abstract class JobDescription implements Priorized, Named {

    @Nonnull
    public abstract String getFactory();

    @Nonnull
    public abstract String getTitle();

    public String getTaskTitle(Context parameters) {
        return getTitle();
    }

    @Override
    public int getPriority() {
        return Priorized.DEFAULT_PRIORITY;
    }

    @Nullable
    public String getDescription() {
        return null;
    }

    public List getPermissions() {
        return Collections.emptyList();
    }

    public void collectParameters(Consumer parameterCollector) {
    }

    public boolean verifyParameters(Context parameters) {
        return true;
    }

    @Nonnull
    public String getPreferredExecutor() {
        return Tasks.DEFAULT;
    }

    public boolean isEditable() {
        return false;
    }

    public abstract void execute(Context parameters, ManagedTaskContext task);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy