diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java index cb6a0c32bb1cb826ec79035b9a371ac095a5ca8b..600dcbfc98d4e540b50382961022a0c8fdc87806 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataService.java @@ -16,15 +16,22 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.server; +import java.util.ArrayList; import java.util.List; +import java.util.Set; import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.server.AbstractServer; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStoreServiceKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; +import ch.systemsx.cisd.openbis.generic.shared.translator.DataStoreServiceTranslator; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataService; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataServiceInternal; @@ -67,6 +74,26 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I } } + public List<DatastoreServiceDescription> listDataStoreServices(String sessionToken) + { + checkSession(sessionToken); + + List<DatastoreServiceDescription> result = new ArrayList<DatastoreServiceDescription>(); + List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores(); + for (DataStorePE dataStore : dataStores) + { + Set<DataStoreServicePE> services = dataStore.getServices(); + for (DataStoreServicePE dataStoreService : services) + { + if (dataStoreService.getKind() == DataStoreServiceKind.PROCESSING) + { + result.add(DataStoreServiceTranslator.translate(dataStoreService)); + } + } + } + return result; + } + public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, long[] rawDataSampleIDs) { diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java index 7af4229bcacbda8c8b47f5273e27b371174e39f5..b9175d98d384a9b3180c996bb9dbed36e67e75a0 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceLogger.java @@ -20,6 +20,7 @@ import java.util.List; import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataService; @@ -44,6 +45,12 @@ class RawDataServiceLogger extends AbstractServerLogger implements IRawDataServi return null; } + public List<DatastoreServiceDescription> listDataStoreServices(String sessionToken) + { + logAccess(sessionToken, "list_data_store_services", ""); + return null; + } + public void processingRawData(String sessionToken, String userID, String dataSetProcessingKey, long[] rawDataSampleIDs) { diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java index 9160444ef8c306c1016e0273a8e441bebf5fc9c7..7a77e5161ee75c5e5c329ec6e79f9b7e33aad474 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IRawDataService.java @@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; /** @@ -40,6 +41,13 @@ public interface IRawDataService extends IServer @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER) public List<Sample> listRawDataSamples(String sessionToken, String userID); + /** + * Lists all processing DSS services. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER) + public List<DatastoreServiceDescription> listDataStoreServices(String sessionToken); + /** * Processes the data sets of specified samples by the DSS processing plug-in of specified key * for the specified user. Implementations should check that the specified user is allowed diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java index 6b4ef6d7726ebf821ffa70c80991e25921b46f49..706d02de2a618bceb16b34c683d194397bd61c18 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java @@ -20,6 +20,7 @@ import java.util.List; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.spring.HttpInvokerUtils; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IRawDataService; @@ -45,6 +46,12 @@ public class RawDataTestClient System.out.println("User: " + user); SessionContextDTO session = service.tryToAuthenticate("test", "a"); String sessionToken = session.getSessionToken(); + List<DatastoreServiceDescription> services = service.listDataStoreServices(sessionToken); + for (DatastoreServiceDescription datastoreServiceDescription : services) + { + System.out.print(datastoreServiceDescription.getLabel()+" "); + } + System.out.println(); List<Sample> samples = service.listRawDataSamples(sessionToken, user); for (Sample sample : samples) {