package com.atlassian.stash.internal.repository.sync.dao;

import com.atlassian.stash.internal.repository.sync.RefSyncResult;
import com.atlassian.bitbucket.repository.sync.RefSyncStatus;
import com.atlassian.bitbucket.repository.sync.RejectedRef;
import com.atlassian.bitbucket.repository.sync.RejectedRefState;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * @since 2.6
 */
public interface RefSyncDao {

    void cleanup(int repositoryId);

    @Nullable
    RejectedRef getRef(int repositoryId, @Nonnull String refId);

    @Nullable
    RefSyncStatus getStatus(int repositoryId);

    boolean isEnabled(int repositoryId);

    int removeRef(int repositoryId, @Nonnull String refId);

    void setEnabled(int repositoryId, boolean enabled);

    void setStatus(int repositoryId, @Nonnull RefSyncResult result) throws RefSyncNotConfiguredException;

    boolean updateRef(int repositoryId, @Nonnull String refId, @Nonnull RejectedRefState state);
}
