Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ after_script:
# http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html
# - oraclejdk8 is not supported anymore.
jdk:
- openjdk8
- openjdk7
cache:
directories:
- $HOME/.m2/repository
139 changes: 80 additions & 59 deletions jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@ public String getDisplayPath() {
return displayPath;
}

public void setDisplayPath(String displayPath) {
public Artifact setDisplayPath(String displayPath) {
this.displayPath = displayPath;
return this;
}

public String getFileName() {
return fileName;
}

public void setFileName(String fileName) {
public Artifact setFileName(String fileName) {
this.fileName = fileName;
return this;
}

public String getRelativePath() {
return relativePath;
}

public void setRelativePath(String relativePath) {
public Artifact setRelativePath(String relativePath) {
this.relativePath = relativePath;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public JenkinsHttpConnection getClient() {
* Set the HTTP client.
* @param client {@link JenkinsHttpConnection}.
*/
public void setClient(final JenkinsHttpConnection client) {
public BaseModel setClient(final JenkinsHttpConnection client) {
this.client = client;
return this;
}
}
21 changes: 12 additions & 9 deletions jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ public String getUrl() {
return url;
}

protected void setNumber(int number) {
protected Build setNumber(int number) {
this.number = number;
return this;
}

protected void setQueueId(int queueId) {
protected Build setQueueId(int queueId) {
this.queueId = queueId;
return this;
}

protected void setUrl(String url) {
protected Build setUrl(String url) {
this.url = url;
return this;
}

/**
Expand Down Expand Up @@ -140,13 +143,13 @@ public String Stop() throws HttpResponseException, IOException {
try {

return client.get(url + "stop");
} catch (HttpResponseException ex) {
if (ex.getStatusCode() == 405) {
} catch (IOException ex) {
if (((HttpResponseException) ex).getStatusCode() == 405) {
stopPost();
return "";
}
throw ex;
}
return "";
}

/** Stops the build which is currently in progress. This version takes in
Expand All @@ -163,13 +166,13 @@ public String Stop(boolean crumbFlag) throws HttpResponseException, IOException
try {

return client.get(url + "stop");
} catch (HttpResponseException ex) {
if (ex.getStatusCode() == 405) {
} catch (IOException ex) {
if (((HttpResponseException) ex).getStatusCode() == 405) {
stopPost(crumbFlag);
return "";
}
throw ex;
}
return "";
}

private void stopPost(boolean crumbFlag) throws HttpResponseException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,54 @@ public String getShortDescription() {
return shortDescription;
}

public void setShortDescription(String shortDescription) {
public BuildCause setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
return this;
}

public int getUpstreamBuild() {
return upstreamBuild;
}

public void setUpstreamBuild(Integer upstreamBuild) {
public BuildCause setUpstreamBuild(Integer upstreamBuild) {
this.upstreamBuild = upstreamBuild;
return this;
}

public String getUpstreamProject() {
return upstreamProject;
}

public void setUpstreamProject(String upstreamProject) {
public BuildCause setUpstreamProject(String upstreamProject) {
this.upstreamProject = upstreamProject;
return this;
}

public String getUpstreamUrl() {
return upstreamUrl;
}

public void setUpstreamUrl(String upstreamUrl) {
public BuildCause setUpstreamUrl(String upstreamUrl) {
this.upstreamUrl = upstreamUrl;
return this;
}

public String getUserId() {
return userId;
}

public void setUserId(String userId) {
public BuildCause setUserId(String userId) {
this.userId = userId;
return this;
}

public String getUserName() {
return userName;
}

public void setUserName(String userName) {
public BuildCause setUserName(String userName) {
this.userName = userName;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public class BuildChangeSet {
/**
* @param items {@link BuildChangeSet}
*/
public void setItems(List<BuildChangeSetItem> items) {
public BuildChangeSet setItems(List<BuildChangeSetItem> items) {
this.items = items;
return this;
}

/**
Expand All @@ -45,8 +46,9 @@ public String getKind() {
/**
* @param kind the kind of (usually svn, git).
*/
public void setKind(String kind) {
public BuildChangeSet setKind(String kind) {
this.kind = kind;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ public String getAbsoluteUrl() {
return absoluteUrl;
}

public void setAbsoluteUrl(String absoluteUrl) {
public BuildChangeSetAuthor setAbsoluteUrl(String absoluteUrl) {
this.absoluteUrl = absoluteUrl;
return this;
}

public String getFullName() {
return fullName;
}

public void setFullName(String fullName) {
public BuildChangeSetAuthor setFullName(String fullName) {
this.fullName = fullName;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,72 +27,81 @@ public List<String> getAffectedPaths() {
return affectedPaths;
}

public void setAffectedPaths(List<String> affectedPaths) {
public BuildChangeSetItem setAffectedPaths(List<String> affectedPaths) {
this.affectedPaths = affectedPaths;
return this;
}

public String getCommitId() {
return commitId;
}

public void setCommitId(String commitId) {
public BuildChangeSetItem setCommitId(String commitId) {
this.commitId = commitId;
return this;
}

public String getTimestamp() {
return timestamp;
}

public void setTimestamp(String timeStamp) {
public BuildChangeSetItem setTimestamp(String timeStamp) {
this.timestamp = timeStamp;
return this;
}

public String getComment() {
return comment;
}

public void setComment(String comment) {
public BuildChangeSetItem setComment(String comment) {
this.comment = comment;
return this;
}

public String getDate() {
return date;
}

public void setDate(String date) {
public BuildChangeSetItem setDate(String date) {
this.date = date;
return this;
}

public String getId() {
return id;
}

public void setId(String id) {
public BuildChangeSetItem setId(String id) {
this.id = id;
return this;
}

public String getMsg() {
return msg;
}

public void setMsg(String msg) {
public BuildChangeSetItem setMsg(String msg) {
this.msg = msg;
return this;
}

public List<BuildChangeSetPath> getPaths() {
return paths;
}

public void setPaths(List<BuildChangeSetPath> paths) {
public BuildChangeSetItem setPaths(List<BuildChangeSetPath> paths) {
this.paths = paths;
return this;
}

public BuildChangeSetAuthor getAuthor() {
return author;
}

public void setAuthor(BuildChangeSetAuthor author) {
public BuildChangeSetItem setAuthor(BuildChangeSetAuthor author) {
this.author = author;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ public String getEditType() {
* @param editType the SCM operation, <code>add</code> or <code>edit</code> or <code>delete</code>
* @see <a href="http://javadoc.jenkins.io/hudson/scm/EditType.html">EditType</a>
*/
public void setEditType(String editType) {
public BuildChangeSetPath setEditType(String editType) {
this.editType = editType;
return this;
}

public String getFile() {
return file;
}

public void setFile(String file) {
public BuildChangeSetPath setFile(String file) {
this.file = file;
return this;
}

@Override
Expand Down
Loading