001/*
002 *   Licensed to the Apache Software Foundation (ASF) under one
003 *   or more contributor license agreements.  See the NOTICE file
004 *   distributed with this work for additional information
005 *   regarding copyright ownership.  The ASF licenses this file
006 *   to you under the Apache License, Version 2.0 (the
007 *   "License"); you may not use this file except in compliance
008 *   with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *   Unless required by applicable law or agreed to in writing,
013 *   software distributed under the License is distributed on an
014 *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *   KIND, either express or implied.  See the License for the
016 *   specific language governing permissions and limitations
017 *   under the License.
018 *
019 */
020package org.apache.directory.ldap.client.template;
021
022
023import org.apache.directory.api.ldap.model.entry.Attribute;
024import org.apache.directory.api.ldap.model.entry.Entry;
025import org.apache.directory.api.ldap.model.entry.Value;
026import org.apache.directory.api.ldap.model.message.AddRequest;
027import org.apache.directory.api.ldap.model.message.DeleteRequest;
028import org.apache.directory.api.ldap.model.message.ModifyRequest;
029import org.apache.directory.api.ldap.model.message.SearchRequest;
030import org.apache.directory.api.ldap.model.message.SearchScope;
031import org.apache.directory.api.ldap.model.name.Dn;
032
033
034/**
035 * A factory for creating {@link org.apache.directory.api.ldap.model} objects.
036 *
037 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
038 */
039public interface ModelFactory
040{
041    public AddRequest newAddRequest( Entry entry );
042
043
044    public Attribute newAttribute( String name, byte[]... values );
045    
046    
047    public Attribute newAttribute( String name, String... values );
048    
049    
050    public Attribute newAttribute( String name, Value<?>... values );
051
052
053    public DeleteRequest newDeleteRequest( Dn dn );
054
055
056    public Dn newDn( String dn );
057
058
059    public Entry newEntry( String dn );
060
061
062    public Entry newEntry( Dn dn );
063
064
065    public ModifyRequest newModifyRequest( String dn );
066
067
068    public ModifyRequest newModifyRequest( Dn dn );
069
070
071    public SearchRequest newSearchRequest( String baseDn, String filter,
072        SearchScope scope );
073
074
075    public SearchRequest newSearchRequest( Dn baseDn, String filter,
076        SearchScope scope );
077
078
079    public SearchRequest newSearchRequest( String baseDn, String filter,
080        SearchScope scope, String... attributes );
081
082
083    public SearchRequest newSearchRequest( Dn baseDn, String filter,
084        SearchScope scope, String... attributes );
085}