Skip to content
Snippets Groups Projects
Commit 777772cd authored by jakubs's avatar jakubs
Browse files

SP-169 BIS-90 get externalDataManagementSystem from transaction - implementation

SVN: 25870
parent b5d6d3aa
No related branches found
No related tags found
No related merge requests found
Showing
with 170 additions and 4 deletions
......@@ -26,6 +26,7 @@ import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationPersistentMap;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.authorization.IAuthorizationService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSetImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExperimentImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalDataManagementSystemImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IMaterialImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IProjectImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISampleImmutable;
......@@ -179,6 +180,15 @@ public interface IDataSetRegistrationTransaction
*/
IMaterial createNewMaterial(String materialCode, String materialType);
/**
* Get an external data management system from the openBIS AS. Returns null if the object does
* not exist.
*
* @return external data management system or null
*/
IExternalDataManagementSystemImmutable getExternalDataManagementSystem(
String externalDataManagementSystemCode);
// File operations -- The source and destination paths are local to the incoming data set folder
// or incoming directory if the data set is just one file
......
/*
* Copyright 2012 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.etlserver.registrator.api.v1;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalDataManagementSystemImmutable;
/**
* @author Jakub Straszewski
*/
public interface IExternalDataManagementSystem extends IExternalDataManagementSystemImmutable
{
}
......@@ -34,8 +34,8 @@ import ch.systemsx.cisd.etlserver.DssRegistrationLogger;
import ch.systemsx.cisd.etlserver.TopLevelDataSetRegistratorGlobalState;
import ch.systemsx.cisd.etlserver.registrator.AbstractOmniscientTopLevelDataSetRegistrator.OmniscientTopLevelDataSetRegistratorState;
import ch.systemsx.cisd.etlserver.registrator.DataSetFile;
import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationPersistentMap;
import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationDetails;
import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationPersistentMap;
import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationService;
import ch.systemsx.cisd.etlserver.registrator.DataSetStorageAlgorithmRunner;
import ch.systemsx.cisd.etlserver.registrator.IDataSetOnErrorActionDecision.ErrorType;
......@@ -60,6 +60,7 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.authorization.IAuthorizationService;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSetImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExperimentImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalDataManagementSystemImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IMaterialImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IProjectImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.ISampleImmutable;
......@@ -225,11 +226,13 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem
this.autoRecoverySettings = autoRecoverySettings;
}
@Override
public String getUserId()
{
return getStateAsLiveState().getUserId();
}
@Override
public void setUserId(String userIdOrNull)
{
getStateAsLiveState().setUserId(userIdOrNull);
......@@ -380,6 +383,15 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem
return getStateAsLiveState().createNewMaterial(materialCode, materialType);
}
@Override
public IExternalDataManagementSystemImmutable getExternalDataManagementSystem(
String externalDataManagementSystemCode)
{
ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem result =
openBisService.tryGetExternalDataManagementSystem(externalDataManagementSystemCode);
return (null == result) ? null : new ExternalDataManagementSystemImmutable(result);
}
@Override
public String moveFile(String src, IDataSet dst)
{
......@@ -420,8 +432,6 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem
{
return registrationContext;
}
/**
* Commit the transaction. Does not throw exceptions if the commit fails on some datasets!
......@@ -641,7 +651,7 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem
{
return registrationService.getIncomingDataSetFile();
}
@Override
public File getIncoming()
{
......
/*
* Copyright 2012 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.etlserver.registrator.api.v1.impl;
import ch.systemsx.cisd.etlserver.registrator.api.v1.IExternalDataManagementSystem;
/**
* @author Jakub Straszewski
*/
public class ExternalDataManagementSystem extends ExternalDataManagementSystemImmutable implements
IExternalDataManagementSystem
{
public ExternalDataManagementSystem(
ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem externalDMS)
{
super(externalDMS);
}
}
/*
* Copyright 2012 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.etlserver.registrator.api.v1.impl;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IExternalDataManagementSystemImmutable;
/**
* @author Jakub Straszewski
*/
public class ExternalDataManagementSystemImmutable implements
IExternalDataManagementSystemImmutable
{
private final ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem externalDMS;
public ExternalDataManagementSystemImmutable(
ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem externalDMS)
{
this.externalDMS = externalDMS;
}
@Override
public String getCode()
{
return externalDMS.getCode();
}
}
......@@ -50,6 +50,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem;
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.ListSampleCriteria;
......@@ -749,4 +750,12 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
return service.filterToVisibleSamples(session.getSessionToken(), user, sampleIdentifiers);
}
@Override
public ExternalDataManagementSystem tryGetExternalDataManagementSystem(
String externalDataManagementSystemCode)
{
return service.tryGetExternalDataManagementSystem(session.getToken(),
externalDataManagementSystemCode);
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem;
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.ListSampleCriteria;
......@@ -545,4 +546,12 @@ public interface IEncapsulatedOpenBISService
*/
@ManagedAuthentication
public List<String> filterToVisibleSamples(String user, List<String> sampleIdentifiers);
/**
* For given code returns the corresponding {@link ExternalDataManagementSystem}.
*/
@ManagedAuthentication
public ExternalDataManagementSystem tryGetExternalDataManagementSystem(
String externalDataManagementSystemCode);
}
\ No newline at end of file
/*
* Copyright 2012 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.dss.generic.shared.api.internal.v1;
/**
*
*
* @author Jakub Straszewski
*/
public interface IExternalDataManagementSystemImmutable
{
String getCode();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment