code: private void saveAssociation( AbstractApplication app, String targetId, String instancePathOrComponentName, boolean add )
  	throws IOException {
  
  		// Association means an exact mapping between an application instance
  		// and a target ID.
  		InstanceContext key = new InstanceContext( app, instancePathOrComponentName );
  
  		// Remove the old association, always.
  		if( instancePathOrComponentName != null ) {
  			String oldTargetId = this.instanceToCachedId.remove( key );
  			if( oldTargetId != null ) {
  				File associationFile = findTargetFile( oldTargetId, TARGETS_ASSOC_FILE );
  				Properties props = Utils.readPropertiesFileQuietly( associationFile, this.logger );
  				props.remove( key.toString());
  				writeProperties( props, associationFile );
  			}
  		}
  
  		// Register a potential new association and update the cache.
  		if( add ) {
  			File associationFile = findTargetFile( targetId, TARGETS_ASSOC_FILE );
  			if( associationFile == null )
  				throw new IOException( "Target " + targetId + " does not exist." );
  
  			Properties props = Utils.readPropertiesFileQuietly( associationFile, this.logger );
  			props.setProperty( key.toString(), "" );
  			writeProperties( props, associationFile );
  
  			this.instanceToCachedId.put( key, targetId );
  		}
  	}
docs: Private methods