forked from eficode/ClearCaseUCMPlugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixing JENKINS-25059
- Loading branch information
1 parent
725f99b
commit bca45f1
Showing
3 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/net/praqma/hudson/remoting/GetLatestForActivities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package net.praqma.hudson.remoting; | ||
|
||
import hudson.FilePath; | ||
import hudson.remoting.VirtualChannel; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import net.praqma.clearcase.exceptions.UnableToLoadEntityException; | ||
import net.praqma.clearcase.ucm.entities.Activity; | ||
import net.praqma.clearcase.ucm.entities.Version; | ||
import net.praqma.clearcase.ucm.utils.VersionList; | ||
|
||
/** | ||
* | ||
* @author Mads | ||
*/ | ||
public class GetLatestForActivities implements FilePath.FileCallable<Map<Activity, List<Version>>> { | ||
|
||
private static final Logger LOG = Logger.getLogger(GetLatestForActivities.class.getName()); | ||
private VersionList list; | ||
|
||
public GetLatestForActivities(VersionList list) { | ||
this.list = list; | ||
} | ||
|
||
@Override | ||
public Map<Activity, List<Version>> invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { | ||
Map<Activity, List<Version>> activities = list.getLatestForActivities(); | ||
for(Activity a : activities.keySet()) { | ||
try { | ||
a.load(); | ||
} catch (UnableToLoadEntityException ex) { | ||
LOG.severe("Could not autoload actitity "+a); | ||
} | ||
} | ||
return activities; | ||
} | ||
|
||
/** | ||
* @return the list | ||
*/ | ||
public VersionList getList() { | ||
return list; | ||
} | ||
|
||
/** | ||
* @param list the list to set | ||
*/ | ||
public void setList(VersionList list) { | ||
this.list = list; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters