    public  void addStageInXFERNodes( SubInfo job,
                                      Collection files, 
                                      int type,
                                      Map<String,PoolTransfer> stageInMap,
                                      BundleValue bundleValue,
                                      Implementation implementation ){
        String jobName    = job.getName();
        String siteHandle = job.getSiteHandle();
        String key = null;
        String par = null;
        int bundle = -1;
        Set tempSet = new HashSet();
        int staged = 0;
        Collection stagedFiles = new ArrayList();
        Collection stageInExecJobs = new ArrayList();
        for(Iterator it = files.iterator();it.hasNext();) {
            FileTransfer ft = (FileTransfer) it.next();
            String lfn = ft.getLFN();
            key = this.constructFileKey(lfn, siteHandle);
            par = (String) mFileTable.get(key);
            if (par != null) {
                it.remove();
                tempSet.add(par);
                if(ft.isTransferringExecutableFile()){
                    String xBitJobName = (String)mSetupMap.get(key);
                    if(key == null){
                        throw new RuntimeException("Internal Pegasus Error while " +
                                                   "constructing bundled stagein jobs");
                    }
                    this.addRelation(xBitJobName,jobName);
                }
            } else {
                boolean contains = stageInMap.containsKey(siteHandle);
                if(!contains){
                    bundle = bundleValue.determine( implementation, job );
                }
                PoolTransfer pt = (contains)?
                                  (PoolTransfer)stageInMap.get(siteHandle):
                                  new PoolTransfer(siteHandle,bundle);
                if(!contains){
                    stageInMap.put(siteHandle,pt);
                }
                String newJobName = pt.addTransfer( ft, type );
                if(ft.isTransferringExecutableFile()){
                    stageInExecJobs.add( newJobName );
                    stagedFiles.add( ft );
                    mLogger.log("Entered " + key + "->" +
                                implementation.getSetXBitJobName(job.getName(),staged),
                                LogManager.DEBUG_MESSAGE_LEVEL);
                    mSetupMap.put(key,
                                  implementation.getSetXBitJobName(job.getName(),staged));
                    staged++;
                }
                mFileTable.put(key, newJobName);
                tempSet.add(newJobName);
            }
        }
        int index = 0;
        Iterator jobIt= stageInExecJobs.iterator();
        for( Iterator it = stagedFiles.iterator(); it.hasNext(); index++){
            Collection execFiles = new ArrayList(1);
            execFiles.add( it.next() );
            implementation.addSetXBitJobs(job, (String)jobIt.next(),
                                                         execFiles,
                                                         SubInfo.STAGE_IN_JOB,
                                                         index);
        }
        mRelationsMap.put(jobName,tempSet);
    }

    public  void addStageInXFERNodes( SubInfo job,
                                      Collection files, 
                                      int type,
                                      Map<String,PoolTransfer> stageInMap,
                                      BundleValue bundleValue,
                                      Implementation implementation ){
        String jobName    = job.getName();
        String siteHandle = job.getSiteHandle();
        String key = null;
        String par = null;
        int bundle = -1;
        Set tempSet = new HashSet();
        int staged = 0;
        Collection stagedFiles = new ArrayList();
        Collection stageInExecJobs = new ArrayList();
        for(Iterator it = files.iterator();it.hasNext();) {
            FileTransfer ft = (FileTransfer) it.next();
            String lfn = ft.getLFN();
            key = this.constructFileKey(lfn, siteHandle);
            par = (String) mFileTable.get(key);
            if (par != null) {
                it.remove();
                tempSet.add(par);
                if(ft.isTransferringExecutableFile()){
                    String xBitJobName = (String)mSetupMap.get(key);
                    if(key == null){
                        throw new RuntimeException("Internal Pegasus Error while " +
                                                   "constructing bundled stagein jobs");
                    }
                    this.addRelation(xBitJobName,jobName);
                }
            } else {
                boolean contains = stageInMap.containsKey(siteHandle);
                if(!contains){
                    bundle = bundleValue.determine( implementation, job );
                }
                PoolTransfer pt = (contains)?
                                  (PoolTransfer)stageInMap.get(siteHandle):
                                  new PoolTransfer(siteHandle,bundle);
                if(!contains){
                    stageInMap.put(siteHandle,pt);
                }
                String newJobName = pt.addTransfer( ft, type );
                if(ft.isTransferringExecutableFile()){
                    stageInExecJobs.add( newJobName );
                    stagedFiles.add( ft );
                    mLogger.log("Entered " + key + "->" +
                                implementation.getSetXBitJobName(job.getName(),staged),
                                LogManager.DEBUG_MESSAGE_LEVEL);
                    mSetupMap.put(key,
                                  implementation.getSetXBitJobName(job.getName(),staged));
                    staged++;
                }
                mFileTable.put(key, newJobName);
                tempSet.add(newJobName);
            }
        }
        int index = 0;
        Iterator jobIt= stageInExecJobs.iterator();
        for( Iterator it = stagedFiles.iterator(); it.hasNext(); index++){
            Collection execFiles = new ArrayList(1);
            execFiles.add( it.next() );
            implementation.addSetXBitJobs(job, (String)jobIt.next(),
                                                         execFiles,
                                                         SubInfo.STAGE_IN_JOB,
                                                         index);
        }
        if( mRelationsMap.containsKey( jobName )){
            tempSet.addAll( (Set) mRelationsMap.get( jobName ) );
        }
        mRelationsMap.put(jobName,tempSet);
    }
