Skip to content

Commit

Permalink
Updated client to not include pharmacophore align endpoint + removed …
Browse files Browse the repository at this point in the history
…align node + updated swagger codegenerator

Refs #4
  • Loading branch information
sverhoeven committed Jul 21, 2017
1 parent 91fa8c9 commit 0a877db
Show file tree
Hide file tree
Showing 42 changed files with 413 additions and 914 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ kripodb serve data/similarities.frozen.h5 data/fragments.sqlite data/pharmacopho

2. Download swagger code generator
```
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar
```

3. Generate a client for KripoDB web service
```
java -jar swagger-codegen-cli-2.2.2.jar generate \
java -jar swagger-codegen-cli-2.2.3.jar generate \
--input-spec http://localhost:8084/kripo/swagger.json \
--output client \
--lang java \
Expand Down
4 changes: 2 additions & 2 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Require-Bundle: org.knime.core;bundle-version="[3.3.0,4.0.0)",
nl.esciencecenter.e3dchem.knime.pharmacophore.plugin;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: Netherlands eScience Center
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: lib/gson-2.6.2.jar,
Bundle-ClassPath: lib/gson-2.8.1.jar,
lib/logging-interceptor-2.7.5.jar,
lib/okhttp-2.7.5.jar,
lib/okio-1.6.0.jar,
lib/swagger-annotations-1.5.12.jar,
lib/swagger-annotations-1.5.15.jar,
.
Export-Package: nl.esciencecenter.e3dchem.kripodb,
nl.esciencecenter.e3dchem.kripodb.fragments,
Expand Down
4 changes: 2 additions & 2 deletions plugin/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ output.. = target/classes/
bin.includes = META-INF/,\
.,\
plugin.xml,\
lib/gson-2.6.2.jar,\
lib/gson-2.8.1.jar,\
lib/logging-interceptor-2.7.5.jar,\
lib/okhttp-2.7.5.jar,\
lib/okio-1.6.0.jar,\
lib/swagger-annotations-1.5.12.jar
lib/swagger-annotations-1.5.15.jar
Binary file removed plugin/lib/gson-2.6.2.jar
Binary file not shown.
Binary file added plugin/lib/gson-2.8.1.jar
Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
deprecated="false"
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.pharmacophores.PharmacophoresFactory">
</node>
<node
category-path="/community/3d-e-chem/kripodb"
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.pharmacophores.align.AlignFactory"
/>
<node
category-path="/community/3d-e-chem/kripodb/local"
deprecated="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Kripo API
* API to interact with Kripo fragment, fingerprint and similarity data files.
*
* OpenAPI spec version: 2.4.0
* OpenAPI spec version: 2.3.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Kripo API
* API to interact with Kripo fragment, fingerprint and similarity data files.
*
* OpenAPI spec version: 2.4.0
* OpenAPI spec version: 2.3.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -127,6 +127,7 @@ public class ApiClient {

private InputStream sslCaCert;
private boolean verifyingSsl;
private KeyManager[] keyManagers;

private OkHttpClient httpClient;
private JSON json;
Expand All @@ -139,6 +140,7 @@ public class ApiClient {
public ApiClient() {
httpClient = new OkHttpClient();


verifyingSsl = true;

json = new JSON(this);
Expand Down Expand Up @@ -270,6 +272,23 @@ public ApiClient setSslCaCert(InputStream sslCaCert) {
return this;
}

public KeyManager[] getKeyManagers() {
return keyManagers;
}

/**
* Configure client keys to use for authorization in an SSL session.
* Use null to reset to default.
*
* @param managers The KeyManagers to use
* @return ApiClient
*/
public ApiClient setKeyManagers(KeyManager[] managers) {
this.keyManagers = managers;
applySslSettings();
return this;
}

public DateFormat getDateFormat() {
return dateFormat;
}
Expand Down Expand Up @@ -723,12 +742,13 @@ public String sanitizeFilename(String filename) {
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
*
* application/vnd.company+json
* @param mime MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public boolean isJsonMime(String mime) {
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
}

/**
Expand Down Expand Up @@ -1030,6 +1050,13 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
if (response.body() != null) {
try {
response.body().close();
} catch (IOException e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
return null;
} else {
return deserialize(response, returnType);
Expand Down Expand Up @@ -1062,6 +1089,26 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
* @throws ApiException If fail to serialize the request body object
*/
public Call buildCall(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener);

return httpClient.newCall(request);
}

/**
* Build an HTTP request with the given options.
*
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param progressRequestListener Progress request listener
* @return The HTTP request
* @throws ApiException If fail to serialize the request body object
*/
public Request buildRequest(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
updateParamsForAuth(authNames, queryParams, headerParams);

final String url = buildUrl(path, queryParams);
Expand Down Expand Up @@ -1102,7 +1149,7 @@ public Call buildCall(String path, String method, List<Pair> queryParams, Object
request = reqBuilder.method(method, reqBody).build();
}

return httpClient.newCall(request);
return request;
}

/**
Expand Down Expand Up @@ -1251,7 +1298,6 @@ private void initDatetimeFormat() {
*/
private void applySslSettings() {
try {
KeyManager[] keyManagers = null;
TrustManager[] trustManagers = null;
HostnameVerifier hostnameVerifier = null;
if (!verifyingSsl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Kripo API
* API to interact with Kripo fragment, fingerprint and similarity data files.
*
* OpenAPI spec version: 2.4.0
* OpenAPI spec version: 2.3.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Kripo API
* API to interact with Kripo fragment, fingerprint and similarity data files.
*
* OpenAPI spec version: 2.4.0
* OpenAPI spec version: 2.3.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Kripo API
* API to interact with Kripo fragment, fingerprint and similarity data files.
*
* OpenAPI spec version: 2.4.0
* OpenAPI spec version: 2.3.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down
Loading

0 comments on commit 0a877db

Please sign in to comment.