diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApi.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApi.java index 6f365108c7c2504e8081c39896b47309575afb59..b468a894c8be2ab33a0115e607645fc4cd66b4f5 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApi.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApi.java @@ -43,14 +43,19 @@ import ch.ethz.sis.openbis.generic.server.api.v3.translator.search.SearchCriteri import ch.ethz.sis.openbis.generic.server.api.v3.translator.search.SearchTranslationContext; import ch.ethz.sis.openbis.generic.server.api.v3.utils.ExceptionUtils; import ch.ethz.sis.openbis.generic.shared.api.v3.IApplicationServerApi; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.Deletion; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.experiment.ExperimentDeletionOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.sample.SampleDeletionOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentUpdate; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.Sample; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleUpdate; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.deletion.DeletionFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.sample.SampleFetchOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion.IDeletionId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentPermId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.IExperimentId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.sample.ISampleId; @@ -346,6 +351,58 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi> new SampleTranslator(new TranslationContext(session), managedPropertyEvaluatorFactory, fetchOptions).translate(samples)); } + @Override + @Transactional + @DatabaseCreateOrDeleteModification(value = { ObjectKind.EXPERIMENT, ObjectKind.DELETION }) + @RolesAllowed({ RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + @Capability("DELETE_EXPERIMENT") + public IDeletionId deleteExperiments(String sessionToken, List<? extends IExperimentId> experimentIds, ExperimentDeletionOptions deletionOptions) + { + // TODO Auto-generated method stub + return null; + } + + @Override + @Transactional + @DatabaseCreateOrDeleteModification(value = { ObjectKind.SAMPLE, ObjectKind.DELETION }) + @RolesAllowed({ RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + @Capability("DELETE_SAMPLE") + public IDeletionId deleteSamples(String sessionToken, List<? extends ISampleId> sampleIds, SampleDeletionOptions deletionOptions) + { + // TODO Auto-generated method stub + return null; + } + + @Override + @Transactional(readOnly = true) + @RolesAllowed({ RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Deletion> listDeletions(String sessionToken, DeletionFetchOptions fetchOptions) + { + // TODO Auto-generated method stub + return null; + } + + @Override + @Transactional + @DatabaseCreateOrDeleteModification(value = ObjectKind.DELETION) + @DatabaseUpdateModification(value = { ObjectKind.EXPERIMENT, ObjectKind.SAMPLE, ObjectKind.DATA_SET }) + @RolesAllowed({ RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + @Capability("RESTORE") + public void revertDeletions(String sessionToken, List<? extends IDeletionId> deletionIds) + { + // TODO Auto-generated method stub + } + + @Override + @Transactional + @DatabaseCreateOrDeleteModification(value = { ObjectKind.DELETION, ObjectKind.EXPERIMENT, ObjectKind.SAMPLE, ObjectKind.DATA_SET }) + @RolesAllowed({ RoleWithHierarchy.SPACE_ADMIN, RoleWithHierarchy.SPACE_ETL_SERVER }) + @Capability("PURGE") + public void confirmDeletions(String sessionToken, List<? extends IDeletionId> deletionIds) + { + // TODO Auto-generated method stub + } + @Override public IApplicationServerApi createLogger(IInvocationLoggerContext context) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApiLogger.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApiLogger.java index a9750beaf8eaef8d65f485a7019a3cf1c56dd368..9123f7751b118b0d198a6610adf2fd1716a21c8a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApiLogger.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/ApplicationServerApiLogger.java @@ -19,14 +19,19 @@ package ch.ethz.sis.openbis.generic.server.api.v3; import java.util.List; import ch.ethz.sis.openbis.generic.shared.api.v3.IApplicationServerApi; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.Deletion; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.experiment.ExperimentDeletionOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.sample.SampleDeletionOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentUpdate; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.Sample; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleUpdate; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.deletion.DeletionFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.sample.SampleFetchOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion.IDeletionId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentPermId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.IExperimentId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.sample.ISampleId; @@ -138,4 +143,37 @@ public class ApplicationServerApiLogger extends AbstractServerLogger implements return null; } + @Override + public IDeletionId deleteExperiments(String sessionToken, List<? extends IExperimentId> experimentIds, ExperimentDeletionOptions deletionOptions) + { + logAccess(sessionToken, "delete-experiments", "EXPERIMENT_IDS(%s) DELETION_OPTIONS(%s)", experimentIds, deletionOptions); + return null; + } + + @Override + public IDeletionId deleteSamples(String sessionToken, List<? extends ISampleId> sampleIds, SampleDeletionOptions deletionOptions) + { + logAccess(sessionToken, "delete-samples", "SAMPLE_IDS(%s) DELETION_OPTIONS(%s)", sampleIds, deletionOptions); + return null; + } + + @Override + public List<Deletion> listDeletions(String sessionToken, DeletionFetchOptions fetchOptions) + { + logAccess(sessionToken, "list-deletions", "FETCH_OPTIONS(%s)", fetchOptions); + return null; + } + + @Override + public void revertDeletions(String sessionToken, List<? extends IDeletionId> deletionIds) + { + logAccess(sessionToken, "revert-deletions", "DELETION_IDS(%s)", deletionIds); + } + + @Override + public void confirmDeletions(String sessionToken, List<? extends IDeletionId> deletionIds) + { + logAccess(sessionToken, "confirm-deletions", "DELETION_IDS(%s)", deletionIds); + } + } diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/IApplicationServerApi.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/IApplicationServerApi.java index 758b0280f42496c69292caa1c6a5d0337719b39b..2fc19a78275b62030bd4cdc06b75520efa73b20a 100644 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/IApplicationServerApi.java +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/IApplicationServerApi.java @@ -18,14 +18,19 @@ package ch.ethz.sis.openbis.generic.shared.api.v3; import java.util.List; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.Deletion; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.experiment.ExperimentDeletionOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.sample.SampleDeletionOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentUpdate; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.Sample; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleCreation; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.SampleUpdate; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.deletion.DeletionFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.sample.SampleFetchOptions; +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion.IDeletionId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentPermId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.IExperimentId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.sample.ISampleId; @@ -122,6 +127,26 @@ public interface IApplicationServerApi extends IRpcService public List<Sample> searchSamples(String sessionToken, SampleSearchCriterion searchCriterion, SampleFetchOptions fetchOptions); + // REPLACES: + // - IGeneralInformationChangingService.deleteExperiments(List<Long>, String, DeletionType) + public IDeletionId deleteExperiments(String sessionToken, List<? extends IExperimentId> experimentIds, ExperimentDeletionOptions deletionOptions); + + // REPLACES: + // - IGeneralInformationChangingService.deleteSamples(List<Long>, String, DeletionType) + public IDeletionId deleteSamples(String sessionToken, List<? extends ISampleId> sampleIds, SampleDeletionOptions deletionOptions); + + // REPLACES: + // - IGeneralInformationService.listDeletions(EnumSet<DeletionFetchOption>) + public List<Deletion> listDeletions(String sessionToken, DeletionFetchOptions fetchOptions); + + // REPLACES: + // - IGeneralInformationChangingService.revertDeletions(List<Long>) + public void revertDeletions(String sessionToken, List<? extends IDeletionId> deletionIds); + + // REPLACES: + // - IGeneralInformationChangingService.deletePermanently(List<Long>) + public void confirmDeletions(String sessionToken, List<? extends IDeletionId> deletionIds); + // NOTES: // - initially the new API methods should operate on concrete types (not interfaces) but in the future we want to operate on interfaces only // - attachments should be fetched with entities they refer to (e.g. projects, experiments etc.) when appropriate fetch option is set diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractObjectDeletionOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractObjectDeletionOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..f54fac26a1028056254aa1f9cd8db570df54e725 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractObjectDeletionOptions.java @@ -0,0 +1,41 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion; + +import java.io.Serializable; + +/** + * @author pkupczyk + */ +public class AbstractObjectDeletionOptions implements Serializable +{ + + private static final long serialVersionUID = 1L; + + private String reason; + + public String getReason() + { + return reason; + } + + public void setReason(String reason) + { + this.reason = reason; + } + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractTrashableObjectDeletionOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractTrashableObjectDeletionOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..15aa9d1c0fc0c15360221850332fecd5b31239b6 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/AbstractTrashableObjectDeletionOptions.java @@ -0,0 +1,39 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion; + +/** + * @author pkupczyk + */ +public class AbstractTrashableObjectDeletionOptions extends AbstractObjectDeletionOptions +{ + + private static final long serialVersionUID = 1L; + + private DeletionType deletionType = DeletionType.TRASH; + + public DeletionType getDeletionType() + { + return deletionType; + } + + public void setDeletionType(DeletionType deletionType) + { + this.deletionType = deletionType; + } + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletedObject.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletedObject.java new file mode 100644 index 0000000000000000000000000000000000000000..3ecf95dff2aa1c79fb2fbe646eb970c2f97a7b9b --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletedObject.java @@ -0,0 +1,41 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion; + +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.IObjectId; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("DeletedObject") +public class DeletedObject +{ + + private IObjectId id; + + public IObjectId getId() + { + return id; + } + + public void setId(IObjectId id) + { + this.id = id; + } + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/Deletion.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/Deletion.java new file mode 100644 index 0000000000000000000000000000000000000000..772142fb8132df4a7d9d74f127d07f2d5fd797d9 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/Deletion.java @@ -0,0 +1,71 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion.IDeletionId; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("Deletion") +public class Deletion implements Serializable +{ + + private static final long serialVersionUID = 1L; + + private IDeletionId id; + + private String reason; + + private List<DeletedObject> deletedObjects = new ArrayList<DeletedObject>(); + + public IDeletionId getId() + { + return id; + } + + public void setId(IDeletionId id) + { + this.id = id; + } + + public String getReason() + { + return reason; + } + + public void setReason(String reason) + { + this.reason = reason; + } + + public List<DeletedObject> getDeletedObjects() + { + return deletedObjects; + } + + public void setDeletedObjects(List<DeletedObject> deletedObjects) + { + this.deletedObjects = deletedObjects; + } + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletionType.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletionType.java new file mode 100644 index 0000000000000000000000000000000000000000..698cb52682931f084b358dca9942d7b096fa66f7 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/DeletionType.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion; + +import java.io.Serializable; + +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("DeletionType") +public enum DeletionType implements Serializable +{ + + PERMANENT, TRASH + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/experiment/ExperimentDeletionOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/experiment/ExperimentDeletionOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..9d21b540b2fb837397bc4dec57f24e642362dff2 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/experiment/ExperimentDeletionOptions.java @@ -0,0 +1,31 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.experiment; + +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.AbstractTrashableObjectDeletionOptions; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("ExperimentDeletionOptions") +public class ExperimentDeletionOptions extends AbstractTrashableObjectDeletionOptions +{ + + private static final long serialVersionUID = 1L; + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/sample/SampleDeletionOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/sample/SampleDeletionOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..7974fdd5f1a7878e4308b4cae9a01595e12b769a --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/deletion/sample/SampleDeletionOptions.java @@ -0,0 +1,31 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.sample; + +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.deletion.AbstractTrashableObjectDeletionOptions; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("SampleDeletionOptions") +public class SampleDeletionOptions extends AbstractTrashableObjectDeletionOptions +{ + + private static final long serialVersionUID = 1L; + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletedObjectFetchOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletedObjectFetchOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..72db7c84a90df3e7dbc132ed0793a183d17a9fe6 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletedObjectFetchOptions.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.deletion; + +import java.io.Serializable; + +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("DeletedObjectFetchOptions") +public class DeletedObjectFetchOptions implements Serializable +{ + + private static final long serialVersionUID = 1L; + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletionFetchOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletionFetchOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..70ad5e1b63f2474f66ccf41f6bb72c1ae851ef12 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/fetchoptions/deletion/DeletionFetchOptions.java @@ -0,0 +1,63 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.deletion; + +import java.io.Serializable; + +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("DeletionFetchOptions") +public class DeletionFetchOptions implements Serializable +{ + private static final long serialVersionUID = 1L; + + private DeletedObjectFetchOptions allDeletedObjects; + + private DeletedObjectFetchOptions originallyDeletedObjects; + + public DeletedObjectFetchOptions fetchAllDeletedObjects() + { + if (allDeletedObjects == null) + { + allDeletedObjects = new DeletedObjectFetchOptions(); + } + return allDeletedObjects; + } + + public boolean hasAllDeletedObjects() + { + return allDeletedObjects != null; + } + + public DeletedObjectFetchOptions fetchOriginallyDeletedObjects() + { + if (originallyDeletedObjects == null) + { + originallyDeletedObjects = new DeletedObjectFetchOptions(); + } + return originallyDeletedObjects; + } + + public boolean hasOriginallyDeletedObjects() + { + return originallyDeletedObjects != null; + } + +} \ No newline at end of file diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/DeletionId.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/DeletionId.java new file mode 100644 index 0000000000000000000000000000000000000000..d8831d80d8d202794774972e8b45c8c657535961 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/DeletionId.java @@ -0,0 +1,25 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion; + +/** + * @author pkupczyk + */ +public class DeletionId +{ + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/IDeletionId.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/IDeletionId.java new file mode 100644 index 0000000000000000000000000000000000000000..a563c099d9ea15fbca54a173400fa3469b2802d9 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/shared/api/v3/dto/id/deletion/IDeletionId.java @@ -0,0 +1,31 @@ +/* + * 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.ethz.sis.openbis.generic.shared.api.v3.dto.id.deletion; + +import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.IObjectId; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * Holds information that uniquely identifies a deletion in openBIS. + * + * @author pkupczyk + */ +@JsonObject("IDeletionId") +public interface IDeletionId extends IObjectId +{ + +} \ No newline at end of file