diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningClientApiTest.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningClientApiTest.java index 737da0a96b376e6c02436fc0d6c156a5f58a8e14..982edfc831ca3df22ba59084e662d17b85ae6f2f 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningClientApiTest.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningClientApiTest.java @@ -67,7 +67,7 @@ public class ScreeningClientApiTest System.out.println(String.format("Connecting to the server '%s' as a user '%s.", serverUrl, userId)); IScreeningOpenbisServiceFacade facade = - ScreeningOpenbisServiceFacade.tryCreate(userId, userPassword, serverUrl); + ScreeningOpenbisServiceFacadeFactory.tryCreate(userId, userPassword, serverUrl); if (facade == null) { System.err.println("Authentication failed: check the user name and password."); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningOpenbisServiceFacadeFactory.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningOpenbisServiceFacadeFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..1d9bf28b3014becac2a2e540c820445d52de8947 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/api/v1/ScreeningOpenbisServiceFacadeFactory.java @@ -0,0 +1,48 @@ +/* + * Copyright 2010 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.screening.client.api.v1; + + +/** + * @author Chandrasekhar Ramakrishnan + */ +public class ScreeningOpenbisServiceFacadeFactory +{ + /** + * Creates a service facade which communicates with the openBIS server at the specified URL. + * Authenticates the user. + * + * @return null if the user could not be authenticated. + */ + public static IScreeningOpenbisServiceFacade tryCreate(String userId, String userPassword, + String serverUrl) + { + return ScreeningOpenbisServiceFacade.tryCreate(userId, userPassword, serverUrl); + } + + /** + * Creates a service facade which communicates with the openBIS server at the specified URL for + * an authenticated user. + * + * @param sessionToken The session token for the authenticated user + * @param serverUrl The URL for the openBIS application server + */ + public static IScreeningOpenbisServiceFacade tryCreate(String sessionToken, String serverUrl) + { + return ScreeningOpenbisServiceFacade.tryCreate(sessionToken, serverUrl); + } +}