From fa71ce96cf9f3d557c836705ad2c32c70fd962d1 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Thu, 5 Feb 2009 14:09:31 +0000
Subject: [PATCH] LMS-740 interface (super interfaces of IETLLIMSService)
 IWebService and IDataStoreInfoProvider moved from line_base to openbis

SVN: 9711
---
 .../shared/IDataStoreInfoProvider.java        | 37 ++++++++++++
 .../openbis/generic/shared/IWebService.java   | 58 +++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreInfoProvider.java
 create mode 100644 openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IWebService.java

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreInfoProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreInfoProvider.java
new file mode 100644
index 00000000000..c3ece56ac6a
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreInfoProvider.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2008 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.generic.shared;
+
+import ch.systemsx.cisd.common.exceptions.UserFailureException;
+import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE;
+import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier;
+
+/**
+ * Interface specifying data store related requests formats.
+ * 
+ * @author Izabela Adamczyk
+ */
+public interface IDataStoreInfoProvider
+{
+    /**
+     * Returns the data store appropriate for given experiment and data set type.
+     */
+    public DataStorePE getDataStore(final String sessionToken,
+            ExperimentIdentifier experimentIdentifier, String dataSetTypeCode)
+            throws UserFailureException;
+
+}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IWebService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IWebService.java
new file mode 100644
index 00000000000..b9a635b534c
--- /dev/null
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IWebService.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2007 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.generic.shared;
+
+import ch.systemsx.cisd.common.exceptions.UserFailureException;
+
+/**
+ * An abstract set of methods that should be implemented by each <b>LIMS</b> <i>Web Service</i>.
+ * <p>
+ * It includes versioning method and session management ones.
+ * </p>
+ * 
+ * @author Christian Ribeaud
+ */
+public interface IWebService
+{
+
+    /**
+     * Everytime the public <i>Web Service</i> interface changes, we should increment this.
+     * <p>
+     * Kind of versioning of the <i>Web Service</i>.
+     * </p>
+     */
+    public static final int VERSION = 28; // for release S40
+
+    /**
+     * Returns the version of the web service. Does not require any authentication.
+     */
+    public int getVersion();
+
+    /**
+     * Authenticates given <code>user</code> with given <code>password</code>.
+     * 
+     * @return A session token for the user if the user has been successfully authenticated or
+     *         <code>null</code> otherwise.
+     */
+    public String authenticate(String user, String password) throws UserFailureException;
+
+    /**
+     * Closes session by removing given <code>sessionToken</code> from active sessions.
+     */
+    public void closeSession(String sessionToken) throws UserFailureException;
+
+}
\ No newline at end of file
-- 
GitLab