public void setNodes ( final @ Nonnull Collection < ? extends Node > nodes ) throws IOException { Queue . withLock ( new Runnable ( ) { @ Override public void run ( ) { Set < String > toRemove = new HashSet <> ( Nodes . this . nodes . keySet ( ) ) ; for ( Node n : nodes ) { final String name = n . getNodeName ( ) ; toRemove . remove ( name ) ; Nodes . this . nodes . put ( name , n ) ; } Nodes . this . nodes . keySet ( ) . removeAll ( toRemove ) ; // directory clean up will be handled by save jenkins . updateComputerList ( ) ; jenkins . trimLabels ( ) ; } } ) ; save ( ) ; }
Sets the list of nodes .