From 4fafa3d59cda94e7077ffc000a6d8ada04c922a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Miqu=C3=A9e?= Date: Wed, 24 Feb 2010 13:18:14 +0100 Subject: [PATCH] Correction of grid modification methods. --- src/jaceP2P/JaceSuperNodeServer.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/jaceP2P/JaceSuperNodeServer.java b/src/jaceP2P/JaceSuperNodeServer.java index 58d2401..d2f5786 100644 --- a/src/jaceP2P/JaceSuperNodeServer.java +++ b/src/jaceP2P/JaceSuperNodeServer.java @@ -499,10 +499,6 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements delGNodeFromList( (Node) remp.getNode(), 2 ) ; - /** Updating all mapping **/ - updateMappedNode( gnode, remp ) ; - propagateReplaceNode( gnode, remp ) ; - authorized = false ; SuperNodeListe.Instance().forwardCountNode(); @@ -516,6 +512,8 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements { System.out.println( "Other new node found." ) ; + remp.setMapped( true ) ; + authorized = true ; delGNodeFromList( (Node) remp.getNode(), 2 ) ; @@ -528,6 +526,12 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements } } + + /** Updating all mapping **/ + updateMappedNode( gnode, remp ) ; + propagateReplaceNode( gnode, remp ) ; + + /** Free the gnodes use **/ operating = false ; @@ -546,7 +550,7 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements @Override public void updateMappedNode( GNode _dead, GNode _remp ) { - if( _dead != null ) + if( _remp != null ) { int pos = 0 ; @@ -565,7 +569,7 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements al.updateGrid() ; } else { - System.err.println( "GNode "+_dead+" does not exist in the mapping!" ) ; + System.err.println( "The new GNode is null!" ) ; } } @@ -579,7 +583,7 @@ public class JaceSuperNodeServer extends UnicastRemoteObject implements */ private void propagateReplaceNode( GNode _dead, GNode _remp ) throws RemoteException { - if( _dead != null && _remp != null ) + if( _remp != null ) { SuperNodeListe.Instance().propagateReplaceNode( _dead, _remp ) ; } -- 2.20.1