/* Copyright (c) 2013 OpenPlans. All rights reserved.
 * This code is licensed under the BSD New License, available at the root
 * application directory.
 */
package org.geogit.storage;

import java.util.Iterator;
import java.util.List;

import javax.annotation.Nullable;

import org.geogit.api.ObjectId;
import org.geogit.api.RevObject;
import org.geogit.api.plumbing.merge.Conflict;

import com.google.common.base.Optional;

/**
 * Provides an interface for GeoGit staging databases.
 * 
 */
public interface StagingDatabase extends ObjectDatabase {

    @Override
    public void open();

    @Override
    public void close();

    @Override
    public boolean exists(final ObjectId id);

    @Override
    public RevObject get(ObjectId id) throws IllegalArgumentException;

    @Override
    public boolean put(final RevObject object);

    @Override
    public boolean delete(ObjectId objectId);

    @Override
    public void putAll(Iterator<? extends RevObject> objects);

    @Override
    public long deleteAll(Iterator<ObjectId> ids);

    /**
     * Gets the specified conflict from the database.
     * 
     * @param namespace the namespace of the conflict
     * @param path the conflict to retrieve
     * @return the conflict, or {@link Optional#absent()} if it was not found
     */
    public Optional<Conflict> getConflict(@Nullable String namespace, String path);

    /**
     * Gets all conflicts that match the specified path filter.
     * 
     * @param namespace the namespace of the conflict
     * @param pathFilter the path filter, if this is not defined, all conflicts will be returned
     * @return the list of conflicts
     */
    public List<Conflict> getConflicts(@Nullable String namespace, @Nullable String pathFilter);

    /**
     * Adds a conflict to the database.
     * 
     * @param namespace the namespace of the conflict
     * @param conflict the conflict to add
     */
    public void addConflict(@Nullable String namespace, Conflict conflict);

    /**
     * Removes a conflict from the database.
     * 
     * @param namespace the namespace of the conflict
     * @param path the path of feature whose conflict should be removed
     */
    public void removeConflict(@Nullable String namespace, String path);

    /**
     * Removes all conflicts from the database.
     * 
     * @param namespace the namespace of the conflicts to remove
     */
    public void removeConflicts(@Nullable String namespace);

}
@@ -184,35 +184,8 @@
 e;%0A%0A
-import java.util.Iterator;%0A
 impo
@@ -203,16 +203,16 @@
 l.List;%0A
+
 %0Aimport 
@@ -243,73 +243,8 @@
 e;%0A%0A
-import org.geogit.api.ObjectId;%0Aimport org.geogit.api.RevObject;%0A
 impo
@@ -395,16 +395,16 @@
  * %0A */%0A
+
 public i
@@ -458,502 +458,8 @@
  %7B%0A%0A
-    @Override%0A    public void open();%0A%0A    @Override%0A    public void close();%0A%0A    @Override%0A    public boolean exists(final ObjectId id);%0A%0A    @Override%0A    public RevObject get(ObjectId id) throws IllegalArgumentException;%0A%0A    @Override%0A    public boolean put(final RevObject object);%0A%0A    @Override%0A    public boolean delete(ObjectId objectId);%0A%0A    @Override%0A    public void putAll(Iterator%3C? extends RevObject%3E objects);%0A%0A    @Override%0A    public long deleteAll(Iterator%3CObjectId%3E ids);%0A%0A
     

remove unneeded method overrides in StagingDatabase.