Ah that sounds interesting..do I grab it out of the ServerEntry object and feed it into another?

Alex Karasulu wrote:
Or just send over an LDIF string.

On Thu, Feb 19, 2009 at 2:12 PM, Emmanuel Lecharny <[email protected]>wrote:

Hi,

On Thu, Feb 19, 2009 at 7:55 PM, Yiannis Mavroukakis
<[email protected]> 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


Reply via email to