Apache Directory Project - [ServerEntry] Slightly modified API

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > January 2008 > [ServerEntry] Slightly modified API





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [ServerEntry] Slightly modified API
Emmanuel Lecharny

2008-01-04, 7:11 am

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



Alex Karasulu

2008-01-04, 1:11 pm

Let me get back to you on this a little later.

Alex

On Jan 4, 2008 4:32 AM, Emmanuel Lecharny <elecharny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> 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
>
>
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com