package org.nl.acs.udw.service.impl;

import org.nl.acs.udw.UnifiedData;
import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAppService;

import java.util.List;

/**
 * @author 20220102CG\noblelift
 */
public class UnifiedDataAccessorImpl implements UnifiedDataAccessor {
    private String unified_key;
    private UnifiedDataAppService unifiedDataAppService;

    public UnifiedDataAccessorImpl() {
    }

    public void setUnifiedKey(String unified_key) {
        this.unified_key = unified_key;
    }

    public void setUnifiedDataService(UnifiedDataAppService unifiedDataService) {
        this.unifiedDataAppService = unifiedDataService;
    }

    @Override
    public List<String> getAllKey() {
        return this.unifiedDataAppService.getAllDataKey(this.unified_key);
    }

    @Override
    public Object getValue(String key) {
        return this.unifiedDataAppService.getValue(this.unified_key, key);
    }

    @Override
    public void setValue(String key, Object value) {
        this.unifiedDataAppService.setValue(this.unified_key, key, value);
    }

    @Override
    public void removeValue( String key) {
        this.unifiedDataAppService.removeValue(this.unified_key, key);
    }

    @Override
    public void setValueWithPersistence(String key, Object value) {
        this.unifiedDataAppService.setValueWithPersistence(this.unified_key, key, value);
    }

    @Override
    public UnifiedData getUnifiedData(String key) {
        return this.unifiedDataAppService.getUnifiedData(this.unified_key, key);
    }

    @Override
    public List<UnifiedData> getHistoryUnifiedData(String key) {
        return this.unifiedDataAppService.getHistoryUnifiedData(this.unified_key, key);
    }
}
