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

net.anotheria.portalkit.apis.asynctask.AsyncTaskAPIImpl Maven / Gradle / Ivy

package net.anotheria.portalkit.apis.asynctask;

import net.anotheria.anoplass.api.APIException;
import net.anotheria.anoplass.api.AbstractAPIImpl;
import net.anotheria.portalkit.apis.asynctask.broker.AsyncTaskMessageBroker;
import net.anotheria.portalkit.apis.asynctask.task.AsyncTask;

import java.util.List;

public class AsyncTaskAPIImpl extends AbstractAPIImpl implements AsyncTaskAPI {

    private final AsyncTaskMessageBroker messageBroker;

    public AsyncTaskAPIImpl(AsyncTaskMessageBroker messageBroker) {
        this.messageBroker = messageBroker;
    }

    @Override
    public void addTask(AsyncTask asyncTask) throws APIException {
        messageBroker.send(asyncTask);
    }

    @Override
    public List getTasks(String topicName) throws APIException {
        return messageBroker.getTasks(topicName);
    }

    @Override
    public void deInit() {
        messageBroker.notifyShutdown();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy