Skip to content

Commit

Permalink
chore(maintenance): fixed doclint complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
swells committed Jun 28, 2016
2 parents 5726f43 + 9a7aaab commit c2d3eac
Show file tree
Hide file tree
Showing 23 changed files with 1,238 additions and 1,436 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ dependencies {
compile "commons-codec:commons-codec:1.9"
compile "commons-lang:commons-lang:2.6"
compile "commons-logging:commons-logging:1.2"
compile "org.apache.httpcomponents:httpcore:4.3.2"
compile "org.apache.httpcomponents:httpmime:4.3.5"
compile "org.apache.httpcomponents:httpclient:4.3.5"
compile "org.apache.httpcomponents:httpcore:4.4.4"
compile "org.apache.httpcomponents:httpmime:4.5.2"
compile "org.apache.httpcomponents:httpclient:4.5.2"
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
Expand All @@ -22,7 +22,7 @@ dependencies {

jar {
baseName = 'jDeployR'
version = '8.0.0'
version = '8.0.5'
}

javadoc {
Expand Down
10 changes: 5 additions & 5 deletions examples/tutorial/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'application'
sourceCompatibility = "1.6"
targetCompatibility = "1.6"

applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:8000/deployr",
applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:8050/deployr",
"-Dusername=testuser",
"-Dpassword=ADD_TESTUSER_PASSWORD"]

Expand All @@ -17,9 +17,9 @@ dependencies {
compile "commons-codec:commons-codec:1.9"
compile "commons-lang:commons-lang:2.6"
compile "commons-logging:commons-logging:1.2"
compile "org.apache.httpcomponents:httpcore:4.3.2"
compile "org.apache.httpcomponents:httpmime:4.3.5"
compile "org.apache.httpcomponents:httpclient:4.3.5"
compile "org.apache.httpcomponents:httpcore:4.4.4"
compile "org.apache.httpcomponents:httpmime:4.5.2"
compile "org.apache.httpcomponents:httpclient:4.5.2"
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
Expand All @@ -28,7 +28,7 @@ dependencies {

jar {
baseName = 'client-tutorial'
version = '8.0.0'
version = '8.0.5'
}

task execute(type: JavaExec) {
Expand Down
21 changes: 0 additions & 21 deletions src/main/java/com/revo/deployr/client/RClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,27 +197,6 @@ public URL renderScript(String scriptName,
throws RClientException,
RDataException;

/**
* Execute a repository-managed shell script. Execution occurs on the
* DeployR server. The response captures the line-by-line console output
* generated by the execution of the shell script on the server.
* Only shell scripts created by an ADMIN user on the DeployR server
* can be executed on this call. All attempts to execute shell scripts
* not created by an ADMIN user will be rejected. Access to shell
* scripts is also governed by standard repository access controls.
* <p>
* @throws RClientException if RClient fails to complete call.
* @throws RSecurityException if DeployR server security conditions not met on call.
*/
public List<String> executeShell(String shellName,
String shellDirectory,
String shellAuthor,
String shellVersion,
String args)
throws RClientException,
RSecurityException,
RDataException;

/**
* Interrupts the current execution on the HTTP blackbox project associated
* with the current HTTP session.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public RRepositoryFileDetails(String filename, String directory,
String restricted, boolean shared, boolean published,
List<String> authors, String inputs, String outputs,
String tags, RRepositoryFile.Category category,
String md5, Date lastModified) {
String sha256, Date lastModified) {
this.filename = filename;
this.directory = directory;
this.author = author;
Expand All @@ -48,7 +48,8 @@ public RRepositoryFileDetails(String filename, String directory,
this.outputs = outputs;
this.tags = tags;
this.category = category;
this.md5 = md5;
this.sha256 = sha256;
this.md5 = this.sha256; // @deprecated - as of 8.0.5 server, use sha256
this.lastModified = lastModified;
this.url = url;
}
Expand Down Expand Up @@ -142,8 +143,14 @@ public RRepositoryFileDetails(String filename, String directory,
*/
public final RRepositoryFile.Category category;

/**
* Repository file 256 checksum.
*/
public final String sha256;

/**
* Repository file md5 checksum.
* @deprecated As of release 8.0.5 server, replaced by {@link #sha256}
*/
public final String md5;

Expand All @@ -156,6 +163,4 @@ public RRepositoryFileDetails(String filename, String directory,
* Repository file url.
*/
public final URL url;


}
12 changes: 11 additions & 1 deletion src/main/java/com/revo/deployr/client/about/RUserDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@

public class RUserDetails {

public RUserDetails(String username, String displayname, String cookie, RUserLimitDetails limits) {
public RUserDetails(String username,
String displayname,
String cookie,
String csrf,
RUserLimitDetails limits) {

this.username = username;
this.displayname = displayname;
this.cookie = cookie;
this.csrf = csrf;
this.limits = limits;
}

Expand All @@ -45,4 +50,9 @@ public RUserDetails(String username, String displayname, String cookie, RUserLim
* About limits for currently authenticated user.
*/
public final RUserLimitDetails limits;

/**
* The `X_CSRF_TOKEN` value.
*/
public final String csrf;
}
22 changes: 14 additions & 8 deletions src/main/java/com/revo/deployr/client/call/AbstractCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ public abstract class AbstractCall implements RCall, RCoreResponse {
protected HttpClient httpClient;
protected String serverUrl;
protected Future future;
protected HttpUriRequest httpUriRequest;


protected HttpUriRequest httpUriRequest;
protected Map<String, String> httpParams = new HashMap();
protected Map<String, String> httpHeaders = new HashMap();

/**
* Method, internal use only.
Expand Down Expand Up @@ -118,6 +117,12 @@ public boolean isCompleted() {
return future.isDone();
}

public void addHeader(String name, String value) {
if (value != null) {
httpHeaders.put(name, value);
}
}

/*
* Protected implementation making HTTP Request.
*/
Expand Down Expand Up @@ -164,17 +169,18 @@ protected RCoreResult makeRequest(HttpUriRequest httpUriRequest, String API) {
RCoreResultImpl pResult = null;

try {
// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpUriRequest.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(this.httpUriRequest);
StatusLine statusLine = response.getStatusLine();

HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();

pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
} catch (UnsupportedEncodingException ueex) {
log.warn("AbstractCall: makeRequest unsupported encoding exception=" + ueex);
} catch (IOException ioex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
Expand Down Expand Up @@ -72,7 +73,7 @@ public RCoreResult call() {
try {

HttpPost httpPost = new HttpPost(serverUrl + API);
super.httpUriRequest = httpPost;
super.httpUriRequest = httpPost;

List<NameValuePair> postParams = new ArrayList<NameValuePair>();
postParams.add(new BasicNameValuePair("format", "json"));
Expand All @@ -91,12 +92,17 @@ public RCoreResult call() {

httpPost.setEntity(entity);

// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpPost.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();
pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

} catch (UnsupportedEncodingException ueex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
Expand Down Expand Up @@ -83,12 +84,17 @@ public RCoreResult call() {

httpPost.setEntity(entity);

// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpPost.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();
pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

} catch (UnsupportedEncodingException ueex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
Expand Down Expand Up @@ -86,12 +87,17 @@ public RCoreResult call() {

httpPost.setEntity(entity);

// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpPost.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();
pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

} catch (UnsupportedEncodingException ueex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
Expand Down Expand Up @@ -96,12 +97,17 @@ public RCoreResult call() {

httpPost.setEntity(entity);

// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpPost.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();
pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

} catch (UnsupportedEncodingException ueex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
Expand Down Expand Up @@ -100,12 +101,17 @@ public RCoreResult call() {

httpPost.setEntity(entity);

// set any custom headers on the request
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
httpPost.addHeader(entry.getKey(), entry.getValue());
}

HttpResponse response = httpClient.execute(httpPost);
StatusLine statusLine = response.getStatusLine();
HttpEntity responseEntity = response.getEntity();
String markup = EntityUtils.toString(responseEntity);

pResult = new RCoreResultImpl();
pResult = new RCoreResultImpl(response.getAllHeaders());
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());

} catch (UnsupportedEncodingException ueex) {
Expand Down
Loading

0 comments on commit c2d3eac

Please sign in to comment.