package eu.teraflow.automation.context;

import eu.teraflow.automation.device.model.Device;
import eu.teraflow.automation.device.model.DeviceEvent;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

@ApplicationScoped
public class ContextServiceImpl implements ContextService {

    private final ContextGateway contextGateway;

    @Inject
    public ContextServiceImpl(ContextGateway contextGateway) {
        this.contextGateway = contextGateway;
    }

    @Override
    public Uni<Device> getDevice(String deviceId) {
        return contextGateway.getDevice(deviceId);
    }

    @Override
    public Multi<DeviceEvent> getDeviceEvents() {
        return contextGateway.getDeviceEvents();
    }
}
