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

syncloud.synchronization.SyncRecord Maven / Gradle / Ivy

The newest version!
package syncloud.synchronization;

import syncloud.dao.IStateDao;
import syncloud.dao.State;

public class SyncRecord implements ISyncRecord {

    private IStateDao stateDao;

    public SyncRecord(IStateDao stateDao) {
        this.stateDao = stateDao;
    }

    @Override
    public void set(State state) {
        State currentState = stateDao.get(state.fullname);
        if (currentState != null)
            stateDao.update(state);
        else
            stateDao.insert(state);
    }

    @Override
    public State get(String fullname) {
        State state = stateDao.get(fullname);
        return state;
    }

    @Override
    public void remove(String fullname) {
        stateDao.delete(fullname);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy