X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/jaceP2P.git/blobdiff_plain/4fafa3d59cda94e7077ffc000a6d8ada04c922a5..b5a7cb08ee803935699d211fd2abb0afddcbc98a:/src/jaceP2P/SuperNodeListe.java diff --git a/src/jaceP2P/SuperNodeListe.java b/src/jaceP2P/SuperNodeListe.java index 017128a..b207bba 100644 --- a/src/jaceP2P/SuperNodeListe.java +++ b/src/jaceP2P/SuperNodeListe.java @@ -368,8 +368,8 @@ public class SuperNodeListe implements Cloneable { } } } - - public void removeGNode( GNode _g, int _mode ) + + public void removeGNode( GNode _g, int _mode, String _spawnerIP ) { if( _g != null ) { @@ -385,7 +385,7 @@ public class SuperNodeListe implements Cloneable { // if not me, I inform the other super nodes remoteStub = d.getStub() ; try { - remoteStub.delGNodeFromList( (Node)_g.getNode(), _mode ) ; + remoteStub.delGNodeFromList( (Node)_g.getNode(), _mode, _spawnerIP ) ; } catch( Exception e ) { System.err.println( "Unable to remove GNode on SuperNode " + d.getIP() ) ; } @@ -444,7 +444,7 @@ public class SuperNodeListe implements Cloneable { } } - public void propagateReplaceNode( GNode _dead, GNode _remp ) + public void propagateReplaceNode( GNode _dead, GNode _remp, String _spawnerIP ) { if( _dead != null && _remp != null ) { @@ -459,7 +459,7 @@ public class SuperNodeListe implements Cloneable { // if not me, I inform the other super nodes remoteStub = d.getStub() ; try { - remoteStub.updateMappedNode( _dead, _remp ) ; + remoteStub.updateMappedNode( _dead, _remp, _spawnerIP ) ; } catch( Exception e ) { System.err.println( "Unable to propagate replacing node on SuperNode " + d.getIP() ) ; } @@ -468,4 +468,30 @@ public class SuperNodeListe implements Cloneable { } } + + /** + * Send to all SuperNode the deletion of a mapping algorithm. + * @param id The mapping algorithm's identifier + */ + public void removeAlgo( String _id ) + { + SuperNodeData d = null ; + JaceSuperNodeInterface remoteStub = null ; + + for( int i = 0 ; i < liste.size() ; i++ ) + { + d = (SuperNodeData) liste.elementAt( i ) ; + if( ! d.getIP().equals( LocalHost.Instance().getIP() ) ) + { + // if not me, I inform the other super nodes + remoteStub = d.getStub() ; + try { + remoteStub.removeAlgo( _id, 1 ) ; + } catch( Exception e ) { + System.err.println( "Unable to propagate the mapping algorithm deletion " + d.getIP() ) ; + } + } + } + } + }