package org.safehaus.penrose.source;
import org.safehaus.penrose.ldap.*;
import org.safehaus.penrose.filter.Filter;
import java.util.Collection;
import java.util.Map;
/**
* @author Endi S. Dewata
*/
public interface SourceMBean {
public String getName() throws Exception;
public String getDescription() throws Exception;
public SourceConfig getSourceConfig() throws Exception;
public String getConnectionName() throws Exception;
public String getParameter(String name) throws Exception;
public Map getParameters() throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Add
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public AddResponse add(String dn, Attributes attributes) throws Exception;
public AddResponse add(RDN rdn, Attributes attributes) throws Exception;
public void add(AddRequest request, AddResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Bind
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public BindResponse bind(String dn, byte[] password) throws Exception;
public BindResponse bind(DN dn, byte[] password) throws Exception;
public void bind(BindRequest request, BindResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Compare
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Delete
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public DeleteResponse delete(String dn) throws Exception;
public DeleteResponse delete(RDN rdn) throws Exception;
public DeleteResponse delete(DN dn) throws Exception;
public void delete(DeleteRequest request, DeleteResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Find
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public SearchResult find(String dn) throws Exception;
public SearchResult find(RDN rdn) throws Exception;
public SearchResult find(DN dn) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Modify
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public ModifyResponse modify(String dn, Collection<Modification> modifications) throws Exception;
public ModifyResponse modify(RDN rdn, Collection<Modification> modifications) throws Exception;
public ModifyResponse modify(DN dn, Collection<Modification> modifications) throws Exception;
public void modify(ModifyRequest request, ModifyResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ModRdn
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public ModRdnResponse modrdn(String dn, String newRdn, boolean deleteOldRdn) throws Exception;
public ModRdnResponse modrdn(RDN rdn, RDN newRdn, boolean deleteOldRdn) throws Exception;
public ModRdnResponse modrdn(DN dn, RDN newRdn, boolean deleteOldRdn) throws Exception;
public void modrdn(ModRdnRequest request, ModRdnResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Search
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public SearchResponse search(String dn, String filter, int scope) throws Exception;
public SearchResponse search(RDN rdn, Filter filter, int scope) throws Exception;
public SearchResponse search(DN dn, Filter filter, int scope) throws Exception;
public void search(SearchRequest request, SearchResponse response) throws Exception;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Other
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void create() throws Exception;
public void clear() throws Exception;
public void drop() throws Exception;
public void status() throws Exception;
public long getCount() throws Exception;
}