directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@gmail.com>
Subject Re: [ApacheDS] Poor man's cluster interceptor
Date Thu, 19 Feb 2009 19:13:27 GMT
Or just send over an LDIF string.

On Thu, Feb 19, 2009 at 2:12 PM, Emmanuel Lecharny <elecharny@apache.org>wrote:

> Hi,
>
> On Thu, Feb 19, 2009 at 7:55 PM, Yiannis Mavroukakis
> <imavroukakis@gameaccount.com> wrote:
> > Hello all :-)
> >
> > This is off the back of my previous questions about clustering..
> >
> > I've managed to setup a poor man's cluster on our Jboss servers cluster
> > using message queues. I can get messages passed to the JBoss instance but
> > I'm having a few issues..
> > I initially tried to send the entire AddOperationContext obect but I got
> > defeated when it refused to serialize :)
> > I then though I'd break it down to its constituent parts, stuff them in a
> > map and send them off..that worked partially and I am unsure as to which
> > structures
> > I can use in order to be able to recreate the entry on the participating
> > ldap clusters
> >
> > This is what I do at the moment
> >
> > Map<String , byte[ ]> attributes = new HashMap( );
> > ServerEntry entry = addContext.getEntry( );
> >       if( ( entry.get( SchemaConstants.USER_PASSWORD_AT ) != null ) )
> >       {
> >           for( AttributeType attr : entry.getAttributeTypes( ) )
> >           {
> >               EntryAttribute entryAttr = entry.get( attr );
> >               if ( entryAttr.get( ).isBinary( ) )
> >               {
> >                   attributes.put( attr.getName( ) , entryAttr.getBytes( )
> );
> >               }
> >               else
> >               {
> >                   attributes.put( attr.getName( ) ,
> > StringTools.getBytesUtf8( entryAttr.getString( ) ) );
> >               }
> >
> >           }
> > [send to cluster after this]
> >
> > Am I missing something? Do I need to add more/less to the Map?
>
>
> This is a bit overkilling. You can grab the netry into the
> AddOperationContex (getEntry() and clone it. Then, you can remove the
> password from it, and serialize it, as it's a serialiable class.
>
> --
> Regards,
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message