Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
da595e32
Commit
da595e32
authored
6 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-7639: RemoteFastDownloadServer refactored by using JettyHttpClientFactory.getHttpClient()
parent
fd1da0fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis_api/source/java/ch/ethz/sis/openbis/generic/dssapi/v3/fastdownload/RemoteFastDownloadServer.java
+3
-22
3 additions, 22 deletions
...eric/dssapi/v3/fastdownload/RemoteFastDownloadServer.java
with
3 additions
and
22 deletions
openbis_api/source/java/ch/ethz/sis/openbis/generic/dssapi/v3/fastdownload/RemoteFastDownloadServer.java
+
3
−
22
View file @
da595e32
...
...
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeUnit;
import
org.eclipse.jetty.client.HttpClient
;
import
org.eclipse.jetty.client.api.ContentResponse
;
import
org.eclipse.jetty.client.api.Request
;
import
org.eclipse.jetty.util.ssl.SslContextFactory
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
...
@@ -56,6 +55,7 @@ import ch.ethz.sis.filetransfer.InvalidUserSessionException;
import
ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.fastdownload.FastDownloadMethod
;
import
ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.fastdownload.FastDownloadParameter
;
import
ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel
;
import
ch.systemsx.cisd.common.http.JettyHttpClientFactory
;
import
ch.systemsx.cisd.common.reflection.ClassUtils
;
import
ch.systemsx.cisd.common.shared.basic.string.CommaSeparatedListBuilder
;
...
...
@@ -64,8 +64,6 @@ import ch.systemsx.cisd.common.shared.basic.string.CommaSeparatedListBuilder;
*/
class
RemoteFastDownloadServer
implements
IDownloadServer
{
private
HttpClient
httpClient
;
private
String
url
;
private
int
requestTimeoutInSeconds
;
...
...
@@ -309,7 +307,8 @@ class RemoteFastDownloadServer implements IDownloadServer
private
Request
createRequest
(
Map
<
FastDownloadParameter
,
String
>
parameters
)
{
return
getHttpClient
().
newRequest
(
createUri
(
parameters
)).
timeout
(
requestTimeoutInSeconds
,
TimeUnit
.
SECONDS
);
HttpClient
httpClient
=
JettyHttpClientFactory
.
getHttpClient
();
return
httpClient
.
newRequest
(
createUri
(
parameters
)).
timeout
(
requestTimeoutInSeconds
,
TimeUnit
.
SECONDS
);
}
private
String
createUri
(
Map
<
FastDownloadParameter
,
String
>
parameters
)
...
...
@@ -337,24 +336,6 @@ class RemoteFastDownloadServer implements IDownloadServer
}
}
private
HttpClient
getHttpClient
()
{
if
(
httpClient
==
null
)
{
SslContextFactory
sslContextFactory
=
new
SslContextFactory
();
httpClient
=
new
HttpClient
(
sslContextFactory
);
httpClient
.
setIdleTimeout
(
120000
);
try
{
httpClient
.
start
();
}
catch
(
Exception
e
)
{
throw
CheckedExceptionTunnel
.
wrapIfNecessary
(
e
);
}
}
return
httpClient
;
}
private
static
final
class
ParameterBuilder
{
private
Map
<
FastDownloadParameter
,
String
>
parameters
=
new
TreeMap
<>();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment