Skip to content

Commit 0a877db

Browse files
committed
Updated client to not include pharmacophore align endpoint + removed align node + updated swagger codegenerator
Refs #4
1 parent 91fa8c9 commit 0a877db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+413
-914
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ kripodb serve data/similarities.frozen.h5 data/fragments.sqlite data/pharmacopho
9898

9999
2. Download swagger code generator
100100
```
101-
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar
101+
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar
102102
```
103103

104104
3. Generate a client for KripoDB web service
105105
```
106-
java -jar swagger-codegen-cli-2.2.2.jar generate \
106+
java -jar swagger-codegen-cli-2.2.3.jar generate \
107107
--input-spec http://localhost:8084/kripo/swagger.json \
108108
--output client \
109109
--lang java \

plugin/META-INF/MANIFEST.MF

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Require-Bundle: org.knime.core;bundle-version="[3.3.0,4.0.0)",
1515
nl.esciencecenter.e3dchem.knime.pharmacophore.plugin;bundle-version="[1.0.0,2.0.0)"
1616
Bundle-Vendor: Netherlands eScience Center
1717
Bundle-ActivationPolicy: lazy
18-
Bundle-ClassPath: lib/gson-2.6.2.jar,
18+
Bundle-ClassPath: lib/gson-2.8.1.jar,
1919
lib/logging-interceptor-2.7.5.jar,
2020
lib/okhttp-2.7.5.jar,
2121
lib/okio-1.6.0.jar,
22-
lib/swagger-annotations-1.5.12.jar,
22+
lib/swagger-annotations-1.5.15.jar,
2323
.
2424
Export-Package: nl.esciencecenter.e3dchem.kripodb,
2525
nl.esciencecenter.e3dchem.kripodb.fragments,

plugin/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ output.. = target/classes/
33
bin.includes = META-INF/,\
44
.,\
55
plugin.xml,\
6-
lib/gson-2.6.2.jar,\
6+
lib/gson-2.8.1.jar,\
77
lib/logging-interceptor-2.7.5.jar,\
88
lib/okhttp-2.7.5.jar,\
99
lib/okio-1.6.0.jar,\
10-
lib/swagger-annotations-1.5.12.jar
10+
lib/swagger-annotations-1.5.15.jar

plugin/lib/gson-2.6.2.jar

-224 KB
Binary file not shown.

plugin/lib/gson-2.8.1.jar

227 KB
Binary file not shown.

plugin/plugin.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
deprecated="false"
3535
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.pharmacophores.PharmacophoresFactory">
3636
</node>
37-
<node
38-
category-path="/community/3d-e-chem/kripodb"
39-
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.pharmacophores.align.AlignFactory"
40-
/>
4137
<node
4238
category-path="/community/3d-e-chem/kripodb/local"
4339
deprecated="false"

plugin/src/java/nl/esciencecenter/e3dchem/kripodb/ws/client/ApiCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Kripo API
33
* API to interact with Kripo fragment, fingerprint and similarity data files.
44
*
5-
* OpenAPI spec version: 2.4.0
5+
* OpenAPI spec version: 2.3.1
66
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.

plugin/src/java/nl/esciencecenter/e3dchem/kripodb/ws/client/ApiClient.java

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Kripo API
33
* API to interact with Kripo fragment, fingerprint and similarity data files.
44
*
5-
* OpenAPI spec version: 2.4.0
5+
* OpenAPI spec version: 2.3.1
66
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
@@ -127,6 +127,7 @@ public class ApiClient {
127127

128128
private InputStream sslCaCert;
129129
private boolean verifyingSsl;
130+
private KeyManager[] keyManagers;
130131

131132
private OkHttpClient httpClient;
132133
private JSON json;
@@ -139,6 +140,7 @@ public class ApiClient {
139140
public ApiClient() {
140141
httpClient = new OkHttpClient();
141142

143+
142144
verifyingSsl = true;
143145

144146
json = new JSON(this);
@@ -270,6 +272,23 @@ public ApiClient setSslCaCert(InputStream sslCaCert) {
270272
return this;
271273
}
272274

275+
public KeyManager[] getKeyManagers() {
276+
return keyManagers;
277+
}
278+
279+
/**
280+
* Configure client keys to use for authorization in an SSL session.
281+
* Use null to reset to default.
282+
*
283+
* @param managers The KeyManagers to use
284+
* @return ApiClient
285+
*/
286+
public ApiClient setKeyManagers(KeyManager[] managers) {
287+
this.keyManagers = managers;
288+
applySslSettings();
289+
return this;
290+
}
291+
273292
public DateFormat getDateFormat() {
274293
return dateFormat;
275294
}
@@ -723,12 +742,13 @@ public String sanitizeFilename(String filename) {
723742
* application/json
724743
* application/json; charset=UTF8
725744
* APPLICATION/JSON
726-
*
745+
* application/vnd.company+json
727746
* @param mime MIME (Multipurpose Internet Mail Extensions)
728747
* @return True if the given MIME is JSON, false otherwise.
729748
*/
730749
public boolean isJsonMime(String mime) {
731-
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
750+
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
751+
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
732752
}
733753

734754
/**
@@ -1030,6 +1050,13 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
10301050
if (returnType == null || response.code() == 204) {
10311051
// returning null if the returnType is not defined,
10321052
// or the status code is 204 (No Content)
1053+
if (response.body() != null) {
1054+
try {
1055+
response.body().close();
1056+
} catch (IOException e) {
1057+
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
1058+
}
1059+
}
10331060
return null;
10341061
} else {
10351062
return deserialize(response, returnType);
@@ -1062,6 +1089,26 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
10621089
* @throws ApiException If fail to serialize the request body object
10631090
*/
10641091
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 {
1092+
Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener);
1093+
1094+
return httpClient.newCall(request);
1095+
}
1096+
1097+
/**
1098+
* Build an HTTP request with the given options.
1099+
*
1100+
* @param path The sub-path of the HTTP URL
1101+
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
1102+
* @param queryParams The query parameters
1103+
* @param body The request body object
1104+
* @param headerParams The header parameters
1105+
* @param formParams The form parameters
1106+
* @param authNames The authentications to apply
1107+
* @param progressRequestListener Progress request listener
1108+
* @return The HTTP request
1109+
* @throws ApiException If fail to serialize the request body object
1110+
*/
1111+
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 {
10651112
updateParamsForAuth(authNames, queryParams, headerParams);
10661113

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

1105-
return httpClient.newCall(request);
1152+
return request;
11061153
}
11071154

11081155
/**
@@ -1251,7 +1298,6 @@ private void initDatetimeFormat() {
12511298
*/
12521299
private void applySslSettings() {
12531300
try {
1254-
KeyManager[] keyManagers = null;
12551301
TrustManager[] trustManagers = null;
12561302
HostnameVerifier hostnameVerifier = null;
12571303
if (!verifyingSsl) {

plugin/src/java/nl/esciencecenter/e3dchem/kripodb/ws/client/ApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Kripo API
33
* API to interact with Kripo fragment, fingerprint and similarity data files.
44
*
5-
* OpenAPI spec version: 2.4.0
5+
* OpenAPI spec version: 2.3.1
66
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.

0 commit comments

Comments
 (0)