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
0d08a5f8
Commit
0d08a5f8
authored
14 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1527 Automatically detect openbis url.
SVN: 15973
parent
9db03c96
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/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java
+14
-2
14 additions, 2 deletions
...isd/openbis/plugin/query/client/api/v1/FacadeFactory.java
with
14 additions
and
2 deletions
openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/FacadeFactory.java
+
14
−
2
View file @
0d08a5f8
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
package
ch.systemsx.cisd.openbis.plugin.query.client.api.v1
;
package
ch.systemsx.cisd.openbis.plugin.query.client.api.v1
;
import
ch.systemsx.cisd.common.spring.HttpInvokerUtils
;
import
ch.systemsx.cisd.common.spring.HttpInvokerUtils
;
import
ch.systemsx.cisd.openbis.generic.shared.DefaultLimsServiceStubFactory
;
import
ch.systemsx.cisd.openbis.generic.shared.OpenBisServiceFactory
;
import
ch.systemsx.cisd.openbis.plugin.query.server.api.v1.ResourceNames
;
import
ch.systemsx.cisd.openbis.plugin.query.server.api.v1.ResourceNames
;
import
ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer
;
import
ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer
;
...
@@ -29,14 +31,24 @@ public class FacadeFactory
...
@@ -29,14 +31,24 @@ public class FacadeFactory
{
{
private
static
final
int
SERVER_TIMEOUT_MIN
=
5
;
private
static
final
int
SERVER_TIMEOUT_MIN
=
5
;
// Trick for discovering the server Url
private
static
String
getServiceUrl
(
String
serverUrl
)
{
OpenBisServiceFactory
openBisServiceFactory
=
new
OpenBisServiceFactory
(
serverUrl
,
new
DefaultLimsServiceStubFactory
());
openBisServiceFactory
.
createService
();
return
openBisServiceFactory
.
getUsedServerUrl
()
+
ResourceNames
.
QUERY_PLUGIN_SERVER_URL
;
}
/**
/**
* Creates a facade for specified server URL, user Id, and password.
* Creates a facade for specified server URL, user Id, and password.
*/
*/
public
static
IQueryApiFacade
create
(
String
serverURL
,
String
userID
,
String
password
)
public
static
IQueryApiFacade
create
(
String
serverURL
,
String
userID
,
String
password
)
{
{
String
serviceUrl
=
getServiceUrl
(
serverURL
);
IQueryApiServer
service
=
IQueryApiServer
service
=
HttpInvokerUtils
.
createServiceStub
(
IQueryApiServer
.
class
,
serv
erURL
HttpInvokerUtils
.
createServiceStub
(
IQueryApiServer
.
class
,
serv
iceUrl
,
+
ResourceNames
.
QUERY_PLUGIN_SERVER_URL
,
SERVER_TIMEOUT_MIN
);
SERVER_TIMEOUT_MIN
);
String
sessionToken
=
service
.
tryToAuthenticateAtQueryServer
(
userID
,
password
);
String
sessionToken
=
service
.
tryToAuthenticateAtQueryServer
(
userID
,
password
);
if
(
sessionToken
==
null
)
if
(
sessionToken
==
null
)
{
{
...
...
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