Re: [vysper] cloning and forwarding stanzas

2009-09-04 Thread Fernando Padilla
Well, here is a sample pseudo code for creating an iterable of MUC stanzas.. { ListString listOfJid = Lists.newArrayList( m...@example.com/A, y...@example.com/B ); TransformerString,Stanza transformer = new StanzaCloneWithNewTo( templateStanza ); IterableStanza stanzas = Iterables.transform(

Re: [vysper] cloning and forwarding stanzas

2009-09-04 Thread Bernd Fondermann
Fernando Padilla wrote: Well, here is a sample pseudo code for creating an iterable of MUC stanzas.. { ListString listOfJid = Lists.newArrayList( m...@example.com/A, y...@example.com/B ); TransformerString,Stanza transformer = new StanzaCloneWithNewTo( templateStanza ); IterableStanza

Re: [vysper] cloning and forwarding stanzas

2009-09-02 Thread Bernd Fondermann
Fernando Padilla wrote: I wonder, would it be too complicated to create something like CopyOnWriteStanzaClone? I also wonder if there is some way to not generate all of the stanzas right away, but only as they are processed. Basically following the google-collections ideas of creating

Re: [vysper] cloning and forwarding stanzas

2009-09-02 Thread Fernando Padilla
Right. The idea is that you should have methods and returns be as low as possible ( Iterable ), instead of higher requirements ( Collection, List, Set, etc ). This just gives you some flexibility on how to implement things, and reduce the number of data structures you have to maintain or

Re: [vysper] cloning and forwarding stanzas

2009-09-02 Thread Bernd Fondermann
On Wed, Sep 2, 2009 at 18:06, Fernando Padillaf...@alum.mit.edu wrote: Right.  The idea is that you should have methods and returns be as low as possible ( Iterable ), instead of higher requirements ( Collection, List, Set, etc ).  This just gives you some flexibility on how to implement

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Niklas Gustavsson
On Mon, Aug 31, 2009 at 7:40 PM, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: Now there are convenience methods to replace 'to' and 'from' only in  StanzaBuilder.createForward(Stanza original, Entity from, Entity to) and  T extends Stanza T StanzaBuilder.createForwardStanza(        

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Bernd Fondermann
Niklas Gustavsson wrote: On Mon, Aug 31, 2009 at 7:40 PM, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: Now there are convenience methods to replace 'to' and 'from' only in StanzaBuilder.createForward(Stanza original, Entity from, Entity to) and T extends Stanza T

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Michael Jakl
Hi! On Mon, Aug 31, 2009 at 19:40, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: If you want to relay a message to many addressees (say thousands), we might not want to create 1000 lists, if we only want to replace the from entity for every new stanza and could reuse one list for that

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Bernd Fondermann
Michael Jakl wrote: Hi! On Mon, Aug 31, 2009 at 19:40, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: If you want to relay a message to many addressees (say thousands), we might not want to create 1000 lists, if we only want to replace the from entity for every new stanza and could

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Michael Jakl
Hi! On Tue, Sep 1, 2009 at 10:45, Bernd Fondermannbf_...@brainlounge.de wrote: Michael Jakl wrote: On Mon, Aug 31, 2009 at 19:40, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: If you want to relay a message to many addressees (say thousands), we might not want to create 1000 lists,

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Bernd Fondermann
Michael Jakl wrote: Hi! On Tue, Sep 1, 2009 at 10:45, Bernd Fondermannbf_...@brainlounge.de wrote: Michael Jakl wrote: On Mon, Aug 31, 2009 at 19:40, bernd.fondermannbernd.fonderm...@brainlounge.de wrote: If you want to relay a message to many addressees (say thousands), we might not want

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Michael Jakl
Hi! On Tue, Sep 1, 2009 at 11:27, Bernd Fondermannbf_...@brainlounge.de wrote: It's not 'easier'. It would use less objects, yet not neccessarily much less memory though. Think about it: Queueing up the character data needs much more memory: what's now stored as 1 immutable inner object (and

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Bernd Fondermann
Michael Jakl wrote: Hi! On Tue, Sep 1, 2009 at 11:27, Bernd Fondermannbf_...@brainlounge.de wrote: It's not 'easier'. It would use less objects, yet not neccessarily much less memory though. Think about it: Queueing up the character data needs much more memory: what's now stored as 1

Re: [vysper] cloning and forwarding stanzas

2009-09-01 Thread Fernando Padilla
I wonder, would it be too complicated to create something like CopyOnWriteStanzaClone? I also wonder if there is some way to not generate all of the stanzas right away, but only as they are processed. Basically following the google-collections ideas of creating Iterables whose items are

[vysper] cloning and forwarding stanzas

2009-08-31 Thread bernd.fondermann
Hi, sometimes we need to coerce a stanza into one or more copies and make slight changes, like replacing the 'to' attribute. StanzaBuilder.createClone facilitates that. It takes a list of attributes which replace original attributes on the copy. Convenience: Now there are convenience methods to