From 16422a2760100a260e13a5d3f05ba78ede047117 Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Thu, 31 May 2012 14:34:50 +0000
Subject: [PATCH] SP-45, BIS-21 make some classes serializable for recovery in
 screening

SVN: 25427
---
 .../cisd/openbis/dss/etl/dto/ImageLibraryInfo.java       | 6 +++++-
 .../cisd/openbis/dss/etl/dto/RelativeImageFile.java      | 6 +++++-
 .../openbis/dss/etl/dto/api/impl/FeatureDefinition.java  | 5 ++++-
 .../dss/etl/dto/api/impl/ImageDataSetStructure.java      | 6 +++++-
 .../openbis/dss/etl/dto/api/impl/ThumbnailsInfo.java     | 9 +++++++--
 .../cisd/openbis/dss/etl/dto/api/v1/Channel.java         | 5 ++++-
 .../cisd/openbis/dss/etl/dto/api/v1/ImageFileInfo.java   | 6 +++++-
 .../cisd/openbis/dss/etl/dto/api/v1/ImageIdentifier.java | 6 +++++-
 .../dss/etl/dto/api/v1/ImageStorageConfiguraton.java     | 5 ++++-
 .../dss/etl/dto/api/v1/ThumbnailsStorageFormat.java      | 5 ++++-
 .../dto/api/v1/transformations/ImageTransformation.java  | 7 ++++++-
 .../openbis/dss/etl/featurevector/FeatureValuesMap.java  | 5 ++++-
 .../shared/imaging/dataaccess/ImgFeatureDefDTO.java      | 6 +++++-
 13 files changed, 63 insertions(+), 14 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/ImageLibraryInfo.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/ImageLibraryInfo.java
index b225c6862b5..17561e6ff9d 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/ImageLibraryInfo.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/ImageLibraryInfo.java
@@ -16,13 +16,17 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto;
 
+import java.io.Serializable;
+
 /**
  * Stores information about the library and its reader which should be used to read the image.
  * 
  * @author Tomasz Pylak
  */
-public class ImageLibraryInfo
+public class ImageLibraryInfo implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     // Which image library should be used to read the image?
     private final String name;
 
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/RelativeImageFile.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/RelativeImageFile.java
index 53df7a99792..051161ecac4 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/RelativeImageFile.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/RelativeImageFile.java
@@ -16,6 +16,8 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto;
 
+import java.io.Serializable;
+
 import ch.systemsx.cisd.common.utilities.AbstractHashable;
 import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.ImageFileInfo;
 import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.ImageIdentifier;
@@ -25,8 +27,10 @@ import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.ImageIdentifier;
  * 
  * @author Tomasz Pylak
  */
-public class RelativeImageFile extends AbstractHashable
+public class RelativeImageFile extends AbstractHashable implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private final String imageRelativePath;
 
     private final String imageIDOrNull;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/FeatureDefinition.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/FeatureDefinition.java
index 6eda73dd15f..9e842f12049 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/FeatureDefinition.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/FeatureDefinition.java
@@ -16,6 +16,7 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.impl;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -39,8 +40,10 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.ImgFe
  * 
  * @author Tomasz Pylak
  */
-public class FeatureDefinition implements IFeatureDefinition
+public class FeatureDefinition implements IFeatureDefinition, Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private final ImgFeatureDefDTO imgFeatureDefDTO;
 
     private final List<FeatureValuesMap> values;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ImageDataSetStructure.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ImageDataSetStructure.java
index 325040d2753..1590263d7cb 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ImageDataSetStructure.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ImageDataSetStructure.java
@@ -16,6 +16,7 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.impl;
 
+import java.io.Serializable;
 import java.util.List;
 
 import ch.systemsx.cisd.common.collections.CollectionUtils;
@@ -33,8 +34,11 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.utils.ToStringUtil;
  * 
  * @author Tomasz Pylak
  */
-public class ImageDataSetStructure
+public class ImageDataSetStructure implements Serializable
 {
+    
+    private static final long serialVersionUID = 1L;
+
     private List<ImageFileInfo> images;
 
     private List<Channel> channels;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ThumbnailsInfo.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ThumbnailsInfo.java
index bd71a0d82d5..6c3c8c3f444 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ThumbnailsInfo.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/impl/ThumbnailsInfo.java
@@ -1,5 +1,6 @@
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.impl;
 
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -15,10 +16,14 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.Color
  * 
  * @author Tomasz Pylak
  */
-public class ThumbnailsInfo
+public class ThumbnailsInfo implements Serializable
 {
-    public static class PhysicalDatasetInfo
+    private static final long serialVersionUID = 1L;
+
+    public static class PhysicalDatasetInfo implements Serializable
     {
+        private static final long serialVersionUID = 1L;
+
         private final String rootPath;
 
         private int thumbnailsWidth;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java
index dbb5d610ccc..c2a615f1a7d 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/Channel.java
@@ -1,6 +1,7 @@
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1;
 
 import java.awt.Color;
+import java.io.Serializable;
 
 import ch.systemsx.cisd.common.image.WavelengthColor;
 import ch.systemsx.cisd.common.utilities.AbstractHashable;
@@ -14,8 +15,10 @@ import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.transformations.ImageTransfor
  * 
  * @author Tomasz Pylak
  */
-public final class Channel extends AbstractHashable
+public final class Channel extends AbstractHashable implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private final String code;
 
     private final String label;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageFileInfo.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageFileInfo.java
index 891ea1e259f..85c50c1d893 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageFileInfo.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageFileInfo.java
@@ -1,5 +1,7 @@
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1;
 
+import java.io.Serializable;
+
 import ch.systemsx.cisd.bds.hcs.Location;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
 
@@ -8,8 +10,10 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
  * 
  * @author Tomasz Pylak
  */
-public final class ImageFileInfo
+public final class ImageFileInfo implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private WellLocation wellLocationOrNull;
 
     private Location tileLocation;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageIdentifier.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageIdentifier.java
index 126b83ddbe3..8699b2189ff 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageIdentifier.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageIdentifier.java
@@ -16,6 +16,8 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1;
 
+import java.io.Serializable;
+
 import ch.systemsx.cisd.imagereaders.ImageID;
 
 /**
@@ -25,8 +27,10 @@ import ch.systemsx.cisd.imagereaders.ImageID;
  * 
  * @author Franz-Josef Elmer
  */
-public class ImageIdentifier implements Comparable<ImageIdentifier>
+public class ImageIdentifier implements Comparable<ImageIdentifier>, Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     public static final ImageIdentifier NULL = new ImageIdentifier(0, 0, 0, 0);
 
     private final int seriesIndex;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java
index 2b964329b07..2945eea4553 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ImageStorageConfiguraton.java
@@ -16,6 +16,7 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -32,8 +33,10 @@ import ch.systemsx.cisd.openbis.dss.etl.dto.ImageLibraryInfo;
  * 
  * @author Tomasz Pylak
  */
-public class ImageStorageConfiguraton extends AbstractHashable
+public class ImageStorageConfiguraton extends AbstractHashable implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     /** Returns the default configuration. */
     public static ImageStorageConfiguraton createDefault()
     {
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java
index feb1357bd5f..df581ffa11d 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/ThumbnailsStorageFormat.java
@@ -18,6 +18,7 @@ package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1;
 
 import java.awt.image.BufferedImage;
 import java.io.OutputStream;
+import java.io.Serializable;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -32,9 +33,11 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.utils.ImageUtil;
  * 
  * @author Tomasz Pylak
  */
-public class ThumbnailsStorageFormat extends AbstractHashable
+public class ThumbnailsStorageFormat extends AbstractHashable implements Serializable
 {
 
+    private static final long serialVersionUID = 1L;
+
     public enum FileFormat
     {
         PNG
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/transformations/ImageTransformation.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/transformations/ImageTransformation.java
index 972b6bd27a5..6c67458d0e8 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/transformations/ImageTransformation.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/dto/api/v1/transformations/ImageTransformation.java
@@ -16,6 +16,8 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.transformations;
 
+import java.io.Serializable;
+
 import ch.systemsx.cisd.base.image.IImageTransformerFactory;
 import ch.systemsx.cisd.openbis.generic.shared.basic.CodeNormalizer;
 
@@ -24,8 +26,11 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.CodeNormalizer;
  * 
  * @author Tomasz Pylak
  */
-public class ImageTransformation
+public class ImageTransformation implements Serializable
 {
+    
+    private static final long serialVersionUID = 1L;
+
     private String code;
 
     private String label;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
index 103b8aaca69..2074090f6bb 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
@@ -16,6 +16,7 @@
 
 package ch.systemsx.cisd.openbis.dss.etl.featurevector;
 
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -31,8 +32,10 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation;
  * 
  * @author Tomasz Pylak
  */
-public class FeatureValuesMap
+public class FeatureValuesMap implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private final Map<WellLocation, String> valuesMap;
 
     private final Double depthOrNull;
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java
index 29831f4768f..b430b229853 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java
@@ -16,6 +16,8 @@
 
 package ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess;
 
+import java.io.Serializable;
+
 import net.lemnik.eodsql.ResultColumn;
 
 /**
@@ -24,8 +26,10 @@ import net.lemnik.eodsql.ResultColumn;
  * 
  * @author Chandrasekhar Ramakrishnan
  */
-public class ImgFeatureDefDTO extends AbstractImgIdentifiable
+public class ImgFeatureDefDTO extends AbstractImgIdentifiable implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     @ResultColumn("LABEL")
     private String label;
 
-- 
GitLab