package edu.prlab.tyler.iotgateway.cloud.services;

import edu.prlab.tyler.iotgateway.cloud.pojo.device.Device;
import edu.prlab.tyler.iotgateway.cloud.repositories.DeviceRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class DeviceService extends CrudService<Device, Long> {

    private DeviceRepository repository;

    @Autowired
    public DeviceService(DeviceRepository repository) {
        super(repository);
        this.repository = repository;
    }

    public Optional<Device> readByUDN(String udn) {
        return repository.findByUdn(udn);
    }

}
