Navigation Menu

Skip to content

Commit

Permalink
First commit for JENKINS-26484
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsNielsen committed Jan 26, 2015
1 parent dead363 commit 12b03a0
Show file tree
Hide file tree
Showing 22 changed files with 474 additions and 69 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.534</version>
<version>1.554.3</version>
</parent>

<properties>
Expand Down Expand Up @@ -430,14 +430,14 @@
<dependency>
<groupId>net.praqma</groupId>
<artifactId>cool</artifactId>
<version>0.6.36</version>
<version>0.6.37-SNAPSHOT</version>
<type>jar</type>
</dependency>

<dependency>
<groupId>net.praqma</groupId>
<artifactId>cool</artifactId>
<version>0.6.36</version>
<version>0.6.37-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/net/praqma/hudson/remoting/GetRelatedStreams.java
Expand Up @@ -10,20 +10,39 @@
import java.util.List;

import net.praqma.clearcase.ucm.entities.Stream;
import net.praqma.hudson.scm.Polling;
import net.praqma.hudson.scm.Polling.PollingType;

public class GetRelatedStreams implements FileCallable<List<Stream>> {

private static final long serialVersionUID = -8984877325832486334L;
private final Stream stream;

@Deprecated
private final boolean pollingChildStreams;

private final TaskListener listener;
private final boolean multisitePolling;
private final Polling polling;
private final String hyperLinkName;

@Deprecated
public GetRelatedStreams( TaskListener listener, Stream stream, boolean pollingChildStreams, boolean multisitePolling ) {
this.stream = stream;
this.pollingChildStreams = pollingChildStreams;
this.listener = listener;
this.multisitePolling = multisitePolling;
this.polling = null;
this.hyperLinkName = "FeedFrom";
}

public GetRelatedStreams( TaskListener listener, Stream stream, Polling polling, boolean multisitePolling, String hyperLinkName ) {
this.stream = stream;
this.pollingChildStreams = polling.isPollingChilds();
this.listener = listener;
this.multisitePolling = multisitePolling;
this.polling = polling;
this.hyperLinkName = hyperLinkName;
}

@Override
Expand All @@ -35,6 +54,8 @@ public List<Stream> invoke( File f, VirtualChannel channel ) throws IOException,
try {
if( pollingChildStreams ) {
streams = stream.getChildStreams( multisitePolling );
} else if(polling.getType().equals(PollingType.siblingshlink)) {
streams = stream.getDeliveringStreamsUsingHlink(hyperLinkName);
} else {
streams = stream.getSiblingStreams();
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/net/praqma/hudson/remoting/RemoteUtil.java
Expand Up @@ -15,6 +15,7 @@
import hudson.model.BuildListener;
import hudson.model.TaskListener;
import java.util.logging.Logger;
import net.praqma.hudson.scm.Polling;

public abstract class RemoteUtil {

Expand Down Expand Up @@ -54,11 +55,11 @@ public static void endView( FilePath workspace, String viewtag ) throws IOExcept

}

public static List<Stream> getRelatedStreams( FilePath workspace, TaskListener listener, Stream stream, boolean pollingChildStreams, boolean slavePolling, boolean multisitePolling ) throws IOException, InterruptedException {
public static List<Stream> getRelatedStreams( FilePath workspace, TaskListener listener, Stream stream, Polling polling, boolean slavePolling, boolean multisitePolling, String hLinkFeedFrom ) throws IOException, InterruptedException {
if( slavePolling ) {
return workspace.act( new GetRelatedStreams( listener, stream, pollingChildStreams, multisitePolling ) );
return workspace.act( new GetRelatedStreams( listener, stream, polling, multisitePolling, hLinkFeedFrom) );
} else {
GetRelatedStreams t = new GetRelatedStreams( listener, stream, pollingChildStreams, multisitePolling );
GetRelatedStreams t = new GetRelatedStreams( listener, stream, polling, multisitePolling, hLinkFeedFrom );
return t.invoke( null, null );
}
}
Expand Down

0 comments on commit 12b03a0

Please sign in to comment.