diff --git a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java index f86f51726f2800a9140cbadd17c61891442ae264..95ec68f22ddd29091379c8fb9ade5ea05dc73421 100644 --- a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java +++ b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java @@ -15,21 +15,23 @@ */ package ch.systemsx.cisd.openbis.generic.server; -import ch.systemsx.cisd.openbis.generic.shared.ISessionWorkspaceProvider; -import ch.systemsx.cisd.openbis.generic.shared.SessionWorkspaceProvider; import org.springframework.context.ApplicationContext; import ch.ethz.sis.openbis.generic.asapi.v3.plugin.service.IImportService; +import ch.ethz.sis.openbis.generic.dssapi.v3.IDataStoreServerApi; import ch.ethz.sis.openbis.generic.server.asapi.v3.ApplicationServerApi; import ch.ethz.sis.openbis.generic.server.asapi.v3.IApplicationServerInternalApi; import ch.systemsx.cisd.common.mail.IMailClient; import ch.systemsx.cisd.common.mail.MailClient; import ch.systemsx.cisd.common.mail.MailClientParameters; +import ch.systemsx.cisd.common.spring.HttpInvokerUtils; import ch.systemsx.cisd.openbis.generic.server.business.bo.ICommonBusinessObjectFactory; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.shared.ISessionWorkspaceProvider; +import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; +import ch.systemsx.cisd.openbis.generic.shared.SessionWorkspaceProvider; import ch.systemsx.cisd.openbis.generic.shared.pat.IPersonalAccessTokenConfig; import ch.systemsx.cisd.openbis.generic.shared.pat.IPersonalAccessTokenConverter; -import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; /** * Provider of common openBIS server services. @@ -40,11 +42,22 @@ public class CommonServiceProvider { private static ApplicationContext applicationContext; + private static IDataStoreServerApi dataStoreServerApi; + + private CommonServiceProvider() + { + } + public static void setApplicationContext(ApplicationContext context) { applicationContext = context; } + public static void setDataStoreServerApi(final String dssURL, final int timeoutInMinutes) + { + dataStoreServerApi = HttpInvokerUtils.createServiceStub(IDataStoreServerApi.class, dssURL + IDataStoreServerApi.SERVICE_URL, timeoutInMinutes * 60 * 1000); + } + public static ICommonServerForInternalUse getCommonServer() { return (ICommonServerForInternalUse) applicationContext @@ -104,8 +117,9 @@ public class CommonServiceProvider return applicationContext; } - private CommonServiceProvider() + public static IDataStoreServerApi getDataStoreServerApi() { + return dataStoreServerApi; } } diff --git a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java index 6032cef90f5ef421852fa66f6d59352c0b0d3f0f..95f5445aab50a95e6fc4313f55b35e3d8fee68d8 100644 --- a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java +++ b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java @@ -33,8 +33,6 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; -import ch.systemsx.cisd.openbis.generic.server.dataaccess.*; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.*; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +59,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.context.IProgressListener; import ch.ethz.sis.openbis.generic.server.asapi.v3.context.IProgressStack; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.OperationContext; -import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.search.AbstractSearchObjectsOperationExecutor; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.operation.IOperationsExecutor; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sample.ListSampleTechIdByIdentifier; import ch.ethz.sis.openbis.generic.server.asapi.v3.utils.ExceptionUtils; @@ -148,6 +145,19 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.fetchoptions.experime import ch.systemsx.cisd.openbis.generic.server.business.bo.materiallister.IMaterialLister; import ch.systemsx.cisd.openbis.generic.server.business.bo.samplelister.ISampleLister; import ch.systemsx.cisd.openbis.generic.server.business.bo.util.DataSetRegistrationCache; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.DynamicPropertyEvaluationOperation; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataSetTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataStoreDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataStoreDataSourceManager; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDynamicPropertyEvaluationScheduler; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityPropertyTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IMetaprojectDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPersonDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPropertyTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.ISampleTypeDAO; import ch.systemsx.cisd.openbis.generic.shared.Constants; import ch.systemsx.cisd.openbis.generic.shared.IDataStoreService; import ch.systemsx.cisd.openbis.generic.shared.IOpenBisSessionManager; @@ -159,7 +169,63 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchableEntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.EntityOperationsState; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ArchiverDataSetCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Attachment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentWithContent; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivingStatus; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypeWithVocabularyTerms; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentFetchOption; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentFetchOptions; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Grantee; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IDatasetLocationNode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListMaterialCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignments; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignmentsFetchOption; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewExperiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMaterial; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMaterialWithType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMetaproject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewProject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSamplesWithTypes; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSpace; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyTypeWithVocabulary; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleAssignment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy.RoleCode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SourceType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Space; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TrackingDataSetCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTerm; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.IObjectId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.experiment.ExperimentPermIdId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.metaproject.IMetaprojectId; @@ -409,6 +475,7 @@ public class ServiceForDataStoreServer extends AbstractCommonServer<IServiceForD conversationClient.setDataStoreInformation(dssURL, info.getTimeoutInMinutes()); conversationServer.setDataStoreInformation(info.getDataStoreCode(), dssURL, info.getTimeoutInMinutes()); + CommonServiceProvider.setDataStoreServerApi(dssURL, info.getTimeoutInMinutes()); } private String checkVersion(DataStoreServerInfo info, Session session, String dssSessionToken)