Hi,
having had some probem with the current API (mainly conflicting methods
like put(AT...) and put(AT, <String, byte[] or ServerValue>...) ), I
have tried to draw a slightly different set of methods.
In the following lists, we have :
- AT = AttributeType
- upId = a String, the User Provided ID
- SA = ServerAttribute
- SV = ServerValue<?>
Bascially, I have added three new methods, with extended semantic :
- removeValues : removes all the values listed from an attribute
- search : searches for an attribute containing ALL the values listed
- getList : returns a list of attribute, given a list of IDs or
AttributeTypes
Here are the proposed methods :
put, add methods :
------------------
ServerAttribute put( AT, String... )
ServerAttribute put( AT, byte[]... )
ServerAttribute put( AT, SV... )
ServerAttribute put( upId, String... )
ServerAttribute put( upId, byte[]... )
ServerAttribute put( upId, SV... )
ServerAttribute put( upId, AT, String... )
ServerAttribute put( upId, AT, byte[]... )
ServerAttribute put( upId, AT, SV... )
List<ServerAttribute> put( SA... )
remove method :
---------------
List<ServerAttribute> remove( AT... )
List<ServerAttribute> remove( upId... )
List<ServerAttribute> remove( SA... )
removeValues method :
---------------------
ServerAttribute removeValues( AT, String... )
ServerAttribute removeValues( AT, byte[]... )
ServerAttribute removeValues( AT, SV... )
ServerAttribute removeValues( upId, String... )
ServerAttribute removeValues( upId, byte[]... )
ServerAttribute removeValues( upId, SV... )
get method :
------------
ServerAttribute ServerAttribute get( AT )
ServerAttribute ServerAttribute get( upId )
ServerAttribute ServerAttribute get( SA )
getList method :
----------------
List<ServerAttribute> getList( AT... )
List<ServerAttribute> getList( upId... )
List<ServerAttribute> getList( SA... )
search method :
---------------
ServerAttribute search( AT, String... )
ServerAttribute search( AT, byte[]... )
ServerAttribute search( AT, SV... )
ServerAttribute search( upId, String... )
ServerAttribute search( upId, byte[]... )
ServerAttribute search( upId, SV... )
Constructors :
--------------
DefaultServerEntry( LdapDN, Registries )
DefaultServerEntry( LdapDN, Registries, AT... )
DefaultServerEntry( LdapDN, Registries, upId... )
DefaultServerEntry( LdapDN, Registries, upId, AT )
DefaultServerEntry( LdapDN, Registries, upId, AT, String... )
DefaultServerEntry( LdapDN, Registries, upId, AT, byte[]... )
DefaultServerEntry( LdapDN, Registries, upId, AT, SV... )
DefaultServerEntry( LdapDN, Registries, SA... )
setObjectClass method :
-----------------------
void setObjectClass( ObjectClassAttribute )
void setObjectClass( ServerAttribute )
void setObjectClass( String... )
void setObjectClass( SV... )
void addObjectClass( ObjectClassAttribute )
void addObjectClass( ServerAttribute )
void addObjectClass( String... )
void addObjectClass( SV... )
Of course, we have some other methods (clone, clear, equals, etc)
wdyt ? Does it seems better ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org