Hi Saros developers,

 

I post these ideas of Kenny here without further comment.
For your perusal.

 

  Lutz

 

From: Kenny Steinhilber [mailto:golfands...@gmail.com] 
Sent: Samstag, 21. April 2012 05:10
To: Lutz Prechelt
Subject: Re: [Saros] Centralizing project with Saros as a server role

 

On Fri, Apr 20, 2012 at 1:47 PM, Kenny Steinhilber <
<mailto:golfands...@gmail.com> golfands...@gmail.com> wrote:

Hi Lutz,
I have managed to create a working saros plugin that acts as the server role
and accepts invite requests.
The method I used is certainly not something you would want to implement
directly into the solution but I think the idea is still just as useful.

The project is quite large so I spent a lot of time following code paths to
find a good point to create a make-shift invitation process.

I decided instead of creating an entirely new function that would require
the clients to run this custom saros plugin, I will instead tack the
invitation process onto a connection test request.
So when the client performs a connection test on the server, the server is
prompted to reply with an invitation to the current running session.  It
requires that the server has already created a session including the shared
project so the process of turning on the server requires that I start up
that initial session.  From then on, the only people allowed to request a
session invitation are those that are on the servers buddy list, roughly the
white-list.  Any user that requests a session that is not on the white-list
will be revoked.

The end result allows the clients to run the original unmodified saros
plugin and the server is always available to accept session requests.

I have made the following changes to the 12.3.30.r3893 revision.

-----------

Added the method invite(JID buddy) to de.fu_berlin.inf.dpp.ui.wizards

    public boolean invite(JID user) {
        ArrayList<JID> selectedBuddies = new ArrayList<JID>();
        selectedBuddies.add(user);
        CollaborationUtils.addBuddiesToSarosSession(sarosSessionManager,
            selectedBuddies);
        return true;
    }

 

Changed the method processaPacket in the class
de.fu_berlin.inf.dpp.net.internal.ConnectionManager by adding the bolded
code below.

      public void processPacket(Packet packet) {
                IncomingTransferObject ito =
incomingTransferObjectExtensionProvider
                    .getPayload(packet);
                ConnectionTestResponse result = new
ConnectionTestResponse();
                result.transferMode = ito.getTransferMode();
                try {
                    byte[] data = ito.accept(SubMonitor
                        .convert(new NullProgressMonitor()));
                    result.dataHash = Arrays.hashCode(data);
                    log.info(Utils.prefix(new JID(packet.getFrom()))
                        + "Connection Test Data received: " + data.length
                        + " bytes, hashCode==" + result.dataHash);
                    ShareProjectAddBuddiesWizard sessionManager = new
ShareProjectAddBuddiesWizard();
                    sessionManager.invite(new JID(packet.getFrom()));

--------------

I have noticed that when the chat log has a sizable amount of text in it,
the invitation process takes longer between the time the client accepts the
invite and the client receives the folder prompt.  It appears to be
rebuilding the chat log.  The server role of saros I have set up runs like
normal with eclipse in a windows environment.

Another bug I noticed in the current stable release of saros, occasionally
when closing my eclipse session, the process runs in the background just
enough so that it never disconnects the XMPP session from the host.  In my
personal experience this kind of issue occurs because of a threading error.
Maybe the thread that the connection runs on is never closed when shutting
down eclipse. Just speculation and I'm not sure if its already been
addressed in the latest dev revision.

 

You mentioned you wonder about the usefulness of the solution presented and
I agree with the issue you presented, I have come to realize this forking
issue that occurs when a user makes changes offline.  In general the setting
for the use of the server type solution would be one where the entire team
is constantly collaborating and is responsible for the project as a whole;
as opposed to the situation where you have 1 main programmer who is
responsible for the project and occasionally seeks the collaboration of
colleges. As far as the forking issue, these things are the annoyance of
collaborative programming but they are much less likely in the saros setting
than say in a svn setting.  I have handled this by simply having saros store
the incoming project files upon connect in a new folder and then copy and
paste the changes I made on the old project into the shared session project.
I would definitely prefer a more elegant solution but there are few times
when I actually am able to work on the project and do not have access to the
shared session.  Possibly a patching system would be a good solution for
this. In this solution, saros would automatically create a patch file which
contains the differences between the client and the servers copy of the
project, the user could then edit the patch file and apply it to the shared
copy as needed.  This is generally the same solution that is used when
handling forks with a svn setting. I think they call it merging.

 

I believe the optimal solution for a saros server would be one that would
run without the use of eclipse.  It would just handle a session user list
and deal out a copy of the current session project on invitation request.  I
haven't studied saros enough to know for sure, but I assume that in the
current saros release, when a session user makes a change, that user's
client broadcasts that change to all the users in the session? Am I right,
or does it only tell the host and the host tells the other users? If it were
the second case then I guess the server would also need to handle the code
change announcements too.  If it were the first case, then everything should
work exactly the same as it does now as far as the data transfers between
users.  The host would ignore things like highlighting and users positions
in the project. The client would need a new function for handing that
request invitation transaction.

It would probably be best to create the server such that it is written in
java because of the platform portability.

 

You are free to do whatever you please with the ideas presented here.

 

Best regards,

Kenny

 

Here's a little update, I found that MercurialEclipse plugin works well
along side saros.  So I think i'll be using that for merging and my repo
needs

 

 

On Fri, Apr 20, 2012 at 5:01 AM, Lutz Prechelt <prech...@inf.fu-berlin.de>
wrote:

Kenny,


> Congratulations on this magnificent collaboration tool.

Thank you!


> I'm in the process of creating a really crude method of making a Saros
> server that users connect to instead of users connecting to each other.

Have I understood your idea correctly?:

Your crude Saros server will act such that anybody
on the whitelist can send it a "please invite me" request
and will promptly be invited, so the server is always
the host and the session never ends?

Such a thing could probably be realized properly in Saros
with modest effort:
I think "headless" (without GUI) operation of Eclipse is
supported (by Eclipse and at least in principle, certainly
not yet by Saros) and the additional functionality sounds small.

However, I wonder how useful it really would be, because
there is no nice way of updating the server's files if someone
makes changes to them OUTSIDE of the server session.

Anyway: If you are successful please tell us about your experience.

 Lutz




 

 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dpp-devel mailing list
Dpp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dpp-devel

Reply via email to