diff --git a/src/main/java/fr/igred/omero/Annotatable.java b/src/main/java/fr/igred/omero/Annotatable.java
index 4e528202..ed725bac 100644
--- a/src/main/java/fr/igred/omero/Annotatable.java
+++ b/src/main/java/fr/igred/omero/Annotatable.java
@@ -24,9 +24,9 @@
import fr.igred.omero.annotations.RatingAnnotation;
import fr.igred.omero.annotations.TableWrapper;
import fr.igred.omero.annotations.TagAnnotation;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.client.Client;
-import fr.igred.omero.client.DataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.util.ReplacePolicy;
@@ -68,7 +68,7 @@ public interface Annotatable extends RemoteObject {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default boolean isLinked(Browser browser, A annotation)
+ default boolean isLinked(BasicBrowser browser, A annotation)
throws ServiceException, AccessException, ExecutionException {
return getAnnotations(browser).stream().anyMatch(a -> a.getId() == annotation.getId());
}
@@ -85,7 +85,7 @@ default boolean isLinked(Browser browser, A annotation)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void link(DataManager dm, A annotation)
+ default void link(BasicDataManager dm, A annotation)
throws ServiceException, AccessException, ExecutionException {
String error = String.format("Cannot add %s to %s", annotation, this);
call(dm.getDMFacility(),
@@ -105,7 +105,7 @@ default void link(DataManager dm, A annotation)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void link(DataManager dm, A annotation)
+ default void link(BasicDataManager dm, A annotation)
throws ServiceException, AccessException, ExecutionException {
if (!(annotation instanceof TagAnnotation) || !((TagAnnotation) annotation).isTagSet()) {
link(dm, annotation.asDataObject());
@@ -126,7 +126,7 @@ default void link(DataManager dm, A annotation)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void link(DataManager dm, Annotation... annotations)
+ default void link(BasicDataManager dm, Annotation... annotations)
throws ServiceException, AccessException, ExecutionException {
for (Annotation annotation : annotations) {
link(dm, annotation);
@@ -166,7 +166,7 @@ default void linkIfNotLinked(Client client, Annotation... annotations)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void addTag(DataManager dm, String name, String description)
+ void addTag(BasicDataManager dm, String name, String description)
throws ServiceException, AccessException, ExecutionException;
@@ -180,7 +180,7 @@ void addTag(DataManager dm, String name, String description)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void addTag(DataManager dm, Long id)
+ void addTag(BasicDataManager dm, Long id)
throws ServiceException, AccessException, ExecutionException;
@@ -194,7 +194,7 @@ void addTag(DataManager dm, Long id)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void addTags(DataManager dm, Long... ids)
+ default void addTags(BasicDataManager dm, Long... ids)
throws ServiceException, AccessException, ExecutionException {
for (Long id : ids) {
addTag(dm, id);
@@ -213,7 +213,7 @@ default void addTags(DataManager dm, Long... ids)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getTags(Browser browser)
+ List getTags(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -228,7 +228,7 @@ List getTags(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getMapAnnotations(Browser browser)
+ List getMapAnnotations(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -243,7 +243,7 @@ List getMapAnnotations(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void addKeyValuePair(DataManager dm, String key, String value)
+ void addKeyValuePair(BasicDataManager dm, String key, String value)
throws ServiceException, AccessException, ExecutionException;
@@ -258,7 +258,7 @@ void addKeyValuePair(DataManager dm, String key, String value)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List> getKeyValuePairs(Browser browser)
+ default List> getKeyValuePairs(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
return getMapAnnotations(browser).stream()
.map(MapAnnotation::getContent)
@@ -280,7 +280,7 @@ default List> getKeyValuePairs(Browser browser)
* @throws NoSuchElementException Key not found.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getValues(Browser browser, String key)
+ default List getValues(BasicBrowser browser, String key)
throws ServiceException, AccessException, ExecutionException {
return getMapAnnotations(browser).stream()
.map(MapAnnotation::getContentAsMap)
@@ -303,7 +303,7 @@ default List getValues(Browser browser, String key)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getRatings(Browser browser, List userIds)
+ List getRatings(BasicBrowser browser, List userIds)
throws ServiceException, AccessException, ExecutionException;
@@ -318,7 +318,7 @@ List getRatings(Browser browser, List userIds)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getRatings(Browser browser)
+ default List getRatings(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
return getRatings(browser, null);
}
@@ -351,7 +351,7 @@ void rate(Client client, int rating)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- int getMyRating(Browser browser)
+ int getMyRating(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -365,7 +365,7 @@ int getMyRating(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void addTable(DataManager dm, TableWrapper table)
+ default void addTable(BasicDataManager dm, TableWrapper table)
throws ServiceException, AccessException, ExecutionException {
String error = "Cannot add table to " + this;
@@ -439,7 +439,7 @@ default void addAndReplaceTable(Client client, TableWrapper table)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- TableWrapper getTable(DataManager dm, Long fileId)
+ TableWrapper getTable(BasicDataManager dm, Long fileId)
throws ServiceException, AccessException, ExecutionException;
@@ -454,7 +454,7 @@ TableWrapper getTable(DataManager dm, Long fileId)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getTables(DataManager dm)
+ default List getTables(BasicDataManager dm)
throws ServiceException, AccessException, ExecutionException {
Collection tables = call(dm.getTablesFacility(),
tf -> tf.getAvailableTables(dm.getCtx(), asDataObject()),
@@ -482,7 +482,7 @@ default List getTables(DataManager dm)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException The thread was interrupted.
*/
- default long addFile(DataManager dm, File file)
+ default long addFile(BasicDataManager dm, File file)
throws ExecutionException, InterruptedException {
String name = file.getName();
return dm.getDMFacility()
@@ -541,7 +541,7 @@ default long addAndReplaceFile(Client client, File file)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getFileAnnotations(Browser browser)
+ List getFileAnnotations(BasicBrowser browser)
throws ExecutionException, ServiceException, AccessException;
@@ -588,7 +588,7 @@ void unlink(Client client, Collection annotations)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getAnnotationData(Browser browser)
+ default List getAnnotationData(BasicBrowser browser)
throws AccessException, ServiceException, ExecutionException {
return call(browser.getMetadataFacility(),
m -> m.getAnnotations(browser.getCtx(), asDataObject()),
@@ -607,7 +607,7 @@ default List getAnnotationData(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getAnnotations(Browser browser)
+ List getAnnotations(BasicBrowser browser)
throws AccessException, ServiceException, ExecutionException;
diff --git a/src/main/java/fr/igred/omero/AnnotatableWrapper.java b/src/main/java/fr/igred/omero/AnnotatableWrapper.java
index 2b5612bb..686f6551 100644
--- a/src/main/java/fr/igred/omero/AnnotatableWrapper.java
+++ b/src/main/java/fr/igred/omero/AnnotatableWrapper.java
@@ -28,9 +28,9 @@
import fr.igred.omero.annotations.TableWrapper;
import fr.igred.omero.annotations.TagAnnotation;
import fr.igred.omero.annotations.TagAnnotationWrapper;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.client.Client;
-import fr.igred.omero.client.DataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.util.ReplacePolicy;
@@ -96,7 +96,7 @@ protected AnnotatableWrapper(T o) {
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void addTag(DataManager dm, String name, String description)
+ public void addTag(BasicDataManager dm, String name, String description)
throws ServiceException, AccessException, ExecutionException {
TagAnnotation tag = new TagAnnotationWrapper(new TagAnnotationData(name));
tag.setDescription(description);
@@ -115,7 +115,7 @@ public void addTag(DataManager dm, String name, String description)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void addTag(DataManager dm, Long id)
+ public void addTag(BasicDataManager dm, Long id)
throws ServiceException, AccessException, ExecutionException {
TagAnnotationI tag = new TagAnnotationI(id, false);
TagAnnotationData tagData = new TagAnnotationData(tag);
@@ -135,7 +135,7 @@ public void addTag(DataManager dm, Long id)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getTags(Browser browser)
+ public List getTags(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List> types = singletonList(TagAnnotationData.class);
@@ -167,7 +167,7 @@ public List getTags(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getMapAnnotations(Browser browser)
+ public List getMapAnnotations(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List> types = singletonList(MapAnnotationData.class);
List annotations = call(browser.getMetadataFacility(),
@@ -199,7 +199,7 @@ public List getMapAnnotations(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void addKeyValuePair(DataManager dm, String key, String value)
+ public void addKeyValuePair(BasicDataManager dm, String key, String value)
throws ServiceException, AccessException, ExecutionException {
MapAnnotation pkv = new MapAnnotationWrapper(key, value);
link(dm, pkv);
@@ -218,7 +218,7 @@ public void addKeyValuePair(DataManager dm, String key, String value)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- public List getRatings(Browser browser, List userIds)
+ public List getRatings(BasicBrowser browser, List userIds)
throws ServiceException, AccessException, ExecutionException {
String error = "Cannot retrieve rating annotations from " + this;
@@ -285,7 +285,7 @@ public void rate(Client client, int rating)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public int getMyRating(Browser browser)
+ public int getMyRating(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List userIds = singletonList(browser.getCtx().getExperimenter());
@@ -345,7 +345,7 @@ public void addAndReplaceTable(Client client, TableWrapper table, ReplacePolicy
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public TableWrapper getTable(DataManager dm, Long fileId)
+ public TableWrapper getTable(BasicDataManager dm, Long fileId)
throws ServiceException, AccessException, ExecutionException {
TableData info = call(dm.getTablesFacility(),
tf -> tf.getTableInfo(dm.getCtx(), fileId),
@@ -423,7 +423,7 @@ public long addAndReplaceFile(Client client, File file, ReplacePolicy policy)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getFileAnnotations(Browser browser)
+ public List getFileAnnotations(BasicBrowser browser)
throws ExecutionException, ServiceException, AccessException {
String error = "Cannot retrieve file annotations from " + this;
@@ -544,7 +544,7 @@ protected void removeLink(Client client, String linkType, long childId)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getAnnotations(Browser browser)
+ public List getAnnotations(BasicBrowser browser)
throws AccessException, ServiceException, ExecutionException {
return wrap(getAnnotationData(browser), Wrapper::wrap);
}
diff --git a/src/main/java/fr/igred/omero/ObjectWrapper.java b/src/main/java/fr/igred/omero/ObjectWrapper.java
index 8922c260..5cb96c20 100644
--- a/src/main/java/fr/igred/omero/ObjectWrapper.java
+++ b/src/main/java/fr/igred/omero/ObjectWrapper.java
@@ -18,7 +18,7 @@
package fr.igred.omero;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.Experimenter;
@@ -181,7 +181,7 @@ public String toString() {
*/
@Override
@SuppressWarnings("unchecked")
- public void saveAndUpdate(DataManager dm)
+ public void saveAndUpdate(BasicDataManager dm)
throws ExecutionException, ServiceException, AccessException {
data = (T) call(dm.getDMFacility(),
d -> d.saveAndReturnObject(dm.getCtx(), data),
diff --git a/src/main/java/fr/igred/omero/RemoteObject.java b/src/main/java/fr/igred/omero/RemoteObject.java
index 20ce5f8b..51731a05 100644
--- a/src/main/java/fr/igred/omero/RemoteObject.java
+++ b/src/main/java/fr/igred/omero/RemoteObject.java
@@ -18,7 +18,7 @@
package fr.igred.omero;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.Experimenter;
@@ -155,7 +155,7 @@ List flatten(Collection extends Collection extends U>> lists) {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void saveAndUpdate(DataManager dm)
+ void saveAndUpdate(BasicDataManager dm)
throws ExecutionException, ServiceException, AccessException;
diff --git a/src/main/java/fr/igred/omero/RepositoryObject.java b/src/main/java/fr/igred/omero/RepositoryObject.java
index 966c90ec..7643443e 100644
--- a/src/main/java/fr/igred/omero/RepositoryObject.java
+++ b/src/main/java/fr/igred/omero/RepositoryObject.java
@@ -18,7 +18,7 @@
package fr.igred.omero;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
@@ -55,7 +55,7 @@ public interface RepositoryObject extends Annotatable {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void reload(Browser browser)
+ void reload(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
}
diff --git a/src/main/java/fr/igred/omero/annotations/Annotation.java b/src/main/java/fr/igred/omero/annotations/Annotation.java
index 2cb1adbe..10d9804b 100644
--- a/src/main/java/fr/igred/omero/annotations/Annotation.java
+++ b/src/main/java/fr/igred/omero/annotations/Annotation.java
@@ -19,16 +19,19 @@
import fr.igred.omero.RemoteObject;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.containers.ContainersBrowser;
import fr.igred.omero.containers.Dataset;
import fr.igred.omero.containers.Folder;
import fr.igred.omero.containers.Project;
import fr.igred.omero.core.Image;
+import fr.igred.omero.core.ImageBrowser;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.screen.Plate;
import fr.igred.omero.screen.PlateAcquisition;
import fr.igred.omero.screen.Screen;
+import fr.igred.omero.screen.ScreenBrowser;
import fr.igred.omero.screen.Well;
import omero.gateway.model.AnnotationData;
@@ -102,7 +105,7 @@ public interface Annotation extends RemoteObject {
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
*/
- default int countAnnotationLinks(Browser browser)
+ default int countAnnotationLinks(BasicBrowser browser)
throws ServiceException, AccessException {
String q = "select link.parent from ome.model.IAnnotationLink link" +
" where link.child.id=" + getId();
@@ -121,7 +124,7 @@ default int countAnnotationLinks(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getProjects(Browser browser)
+ List getProjects(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -136,7 +139,7 @@ List getProjects(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getDatasets(Browser browser)
+ List getDatasets(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -151,7 +154,7 @@ List getDatasets(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getImages(Browser browser)
+ List getImages(ImageBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -166,7 +169,7 @@ List getImages(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getScreens(Browser browser)
+ List getScreens(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -181,7 +184,7 @@ List getScreens(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getPlates(Browser browser)
+ List getPlates(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -195,7 +198,7 @@ List getPlates(Browser browser)
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
*/
- List getPlateAcquisitions(Browser browser)
+ List getPlateAcquisitions(BasicBrowser browser)
throws ServiceException, AccessException;
@@ -210,7 +213,7 @@ List getPlateAcquisitions(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getWells(Browser browser)
+ List getWells(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -225,7 +228,7 @@ List getWells(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getFolders(Browser browser)
+ List getFolders(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException;
}
diff --git a/src/main/java/fr/igred/omero/annotations/AnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/AnnotationWrapper.java
index 1841c51b..bdd8c65d 100644
--- a/src/main/java/fr/igred/omero/annotations/AnnotationWrapper.java
+++ b/src/main/java/fr/igred/omero/annotations/AnnotationWrapper.java
@@ -19,17 +19,20 @@
import fr.igred.omero.ObjectWrapper;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.containers.ContainersBrowser;
import fr.igred.omero.containers.Dataset;
import fr.igred.omero.containers.Folder;
import fr.igred.omero.containers.Project;
import fr.igred.omero.core.Image;
+import fr.igred.omero.core.ImageBrowser;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.screen.Plate;
import fr.igred.omero.screen.PlateAcquisition;
import fr.igred.omero.screen.PlateAcquisitionWrapper;
import fr.igred.omero.screen.Screen;
+import fr.igred.omero.screen.ScreenBrowser;
import fr.igred.omero.screen.Well;
import omero.RLong;
import omero.gateway.model.AnnotationData;
@@ -128,7 +131,7 @@ public void setDescription(String description) {
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getProjects(Browser browser)
+ public List getProjects(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Project.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -152,7 +155,7 @@ public List getProjects(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getDatasets(Browser browser)
+ public List getDatasets(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Dataset.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -176,7 +179,7 @@ public List getDatasets(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getImages(Browser browser)
+ public List getImages(ImageBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Image.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -200,7 +203,7 @@ public List getImages(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getScreens(Browser browser)
+ public List getScreens(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Screen.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -224,7 +227,7 @@ public List getScreens(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getPlates(Browser browser)
+ public List getPlates(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Plate.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -247,7 +250,7 @@ public List getPlates(Browser browser)
* @throws AccessException Cannot access data.
*/
@Override
- public List getPlateAcquisitions(Browser browser)
+ public List getPlateAcquisitions(BasicBrowser browser)
throws ServiceException, AccessException {
List os = getLinks(browser,
PlateAcquisition.ANNOTATION_LINK);
@@ -271,7 +274,7 @@ public List getPlateAcquisitions(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getWells(Browser browser)
+ public List getWells(ScreenBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Well.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -295,7 +298,7 @@ public List getWells(Browser browser)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getFolders(Browser browser)
+ public List getFolders(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException {
List os = getLinks(browser, Folder.ANNOTATION_LINK);
Long[] ids = os.stream()
@@ -318,7 +321,7 @@ public List getFolders(Browser browser)
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
*/
- private List getLinks(Browser browser, String linkType)
+ private List getLinks(BasicBrowser browser, String linkType)
throws ServiceException, AccessException {
return browser.findByQuery("select link.parent from " + linkType +
" link where link.child = " + getId());
diff --git a/src/main/java/fr/igred/omero/annotations/AnnotationsBrowser.java b/src/main/java/fr/igred/omero/annotations/AnnotationsBrowser.java
new file mode 100644
index 00000000..78a5f4f6
--- /dev/null
+++ b/src/main/java/fr/igred/omero/annotations/AnnotationsBrowser.java
@@ -0,0 +1,118 @@
+package fr.igred.omero.annotations;
+
+
+import fr.igred.omero.RemoteObject;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.exception.AccessException;
+import fr.igred.omero.exception.ServiceException;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.concurrent.ExecutionException;
+
+
+public interface AnnotationsBrowser extends BasicBrowser {
+
+ /**
+ * Gets the list of tag annotations available to the user.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ */
+ List getTags()
+ throws AccessException, ServiceException;
+
+
+ /**
+ * Gets the list of tag annotations with the specified name available to the user.
+ *
+ * @param name Name of the tag searched.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ */
+ default List getTags(String name)
+ throws AccessException, ServiceException {
+ List tags = getTags();
+ tags.removeIf(tag -> !tag.getName().equals(name));
+ tags.sort(Comparator.comparing(RemoteObject::getId));
+ return tags;
+ }
+
+
+ /**
+ * Gets a specific tag from the OMERO database.
+ *
+ * @param id ID of the tag.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws NoSuchElementException No element with this ID.
+ */
+ TagAnnotationWrapper getTag(Long id)
+ throws AccessException, ServiceException;
+
+
+ /**
+ * Gets the list of map annotations available to the user.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ */
+ List getMapAnnotations()
+ throws AccessException, ServiceException;
+
+
+ /**
+ * Gets the list of map annotations with the specified key available to the user.
+ *
+ * @param key Name of the tag searched.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ */
+ List getMapAnnotations(String key)
+ throws AccessException, ServiceException;
+
+
+ /**
+ * Gets the list of map annotations with the specified key and value available to the user.
+ *
+ * @param key The required key.
+ * @param value The required value.
+ *
+ * @return See above.
+ *
+ * @throws AccessException Cannot access data.
+ * @throws ServiceException Cannot connect to OMERO.
+ */
+ List getMapAnnotations(String key, String value)
+ throws AccessException, ServiceException;
+
+
+ /**
+ * Gets a specific map annotation (key/value pairs) from the OMERO database.
+ *
+ * @param id ID of the map annotation.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ MapAnnotation getMapAnnotation(Long id)
+ throws ServiceException, ExecutionException, AccessException;
+
+}
diff --git a/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java
index 53aa8b50..71475252 100644
--- a/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java
+++ b/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java
@@ -18,7 +18,7 @@
package fr.igred.omero.annotations;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.TagAnnotationData;
@@ -53,7 +53,7 @@ public TagAnnotationWrapper(TagAnnotationData tag) {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- public TagAnnotationWrapper(DataManager dm, String name, String description)
+ public TagAnnotationWrapper(BasicDataManager dm, String name, String description)
throws ServiceException, AccessException, ExecutionException {
super(new TagAnnotationData(name, description));
super.saveAndUpdate(dm);
diff --git a/src/main/java/fr/igred/omero/annotations/TagSet.java b/src/main/java/fr/igred/omero/annotations/TagSet.java
index 156a1eea..483b599a 100644
--- a/src/main/java/fr/igred/omero/annotations/TagSet.java
+++ b/src/main/java/fr/igred/omero/annotations/TagSet.java
@@ -19,8 +19,8 @@
import fr.igred.omero.RemoteObject;
-import fr.igred.omero.client.Browser;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.TagAnnotationData;
@@ -100,7 +100,7 @@ public interface TagSet extends RemoteObject {
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
*/
- default List getTags(Browser browser)
+ default List getTags(BasicBrowser browser)
throws AccessException, ServiceException {
reload(browser);
return getTags();
@@ -117,7 +117,7 @@ default List getTags(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void link(DataManager dm, TagAnnotation tag)
+ default void link(BasicDataManager dm, TagAnnotation tag)
throws AccessException, ServiceException, ExecutionException {
AnnotationAnnotationLink link = new AnnotationAnnotationLinkI();
link.setParent(new TagAnnotationI(getId(), false));
@@ -136,7 +136,7 @@ default void link(DataManager dm, TagAnnotation tag)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void link(DataManager dm, TagAnnotation... tags)
+ default void link(BasicDataManager dm, TagAnnotation... tags)
throws AccessException, ServiceException, ExecutionException {
for (TagAnnotation tag : tags) {
link(dm, tag);
@@ -152,7 +152,7 @@ default void link(DataManager dm, TagAnnotation... tags)
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
*/
- void reload(Browser browser)
+ void reload(BasicBrowser browser)
throws ServiceException, AccessException;
}
diff --git a/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java b/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java
index 10c8458d..141621bb 100644
--- a/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java
+++ b/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java
@@ -18,8 +18,8 @@
package fr.igred.omero.annotations;
-import fr.igred.omero.client.Browser;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.TagAnnotationData;
@@ -57,7 +57,7 @@ public TagSetWrapper(TagAnnotationData tag) {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- public TagSetWrapper(DataManager dm, String name, String description)
+ public TagSetWrapper(BasicDataManager dm, String name, String description)
throws ServiceException, AccessException, ExecutionException {
this(new TagAnnotationData(name, description));
super.saveAndUpdate(dm);
@@ -84,7 +84,7 @@ public List getTags() {
* @throws AccessException Cannot access data.
*/
@Override
- public void reload(Browser browser)
+ public void reload(BasicBrowser browser)
throws ServiceException, AccessException {
String query = "select t from TagAnnotation as t" +
" left outer join fetch t.annotationLinks as l" +
diff --git a/src/main/java/fr/igred/omero/client/AdminManager.java b/src/main/java/fr/igred/omero/client/AdminManager.java
index 62bfd59a..355923f8 100644
--- a/src/main/java/fr/igred/omero/client/AdminManager.java
+++ b/src/main/java/fr/igred/omero/client/AdminManager.java
@@ -27,7 +27,6 @@
import omero.ApiUsageException;
import omero.api.IAdminPrx;
import omero.gateway.SecurityContext;
-import omero.gateway.facility.AdminFacility;
import omero.gateway.model.ExperimenterData;
import omero.gateway.model.GroupData;
import omero.model.Experimenter;
@@ -45,35 +44,7 @@
/**
* Interface to handle admin functions on an OMERO server in a given {@link SecurityContext}.
*/
-public interface AdminManager {
-
- /**
- * Returns the current {@link SecurityContext}.
- *
- * @return See above
- */
- SecurityContext getCtx();
-
-
- /**
- * Gets the {@link AdminFacility} to use admin specific function.
- *
- * @return See above.
- *
- * @throws ExecutionException If the AdminFacility can't be retrieved or instantiated.
- */
- AdminFacility getAdminFacility() throws ExecutionException;
-
-
- /**
- * Returns the {@link IAdminPrx} to use admin specific function.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- IAdminPrx getAdminService() throws AccessException, ServiceException;
+public interface AdminManager extends fr.igred.omero.meta.BasicAdmin {
/**
diff --git a/src/main/java/fr/igred/omero/client/BasicBrowser.java b/src/main/java/fr/igred/omero/client/BasicBrowser.java
new file mode 100644
index 00000000..e2f2de11
--- /dev/null
+++ b/src/main/java/fr/igred/omero/client/BasicBrowser.java
@@ -0,0 +1,76 @@
+package fr.igred.omero.client;
+
+
+import fr.igred.omero.exception.AccessException;
+import fr.igred.omero.exception.ServiceException;
+import omero.api.IQueryPrx;
+import omero.gateway.SecurityContext;
+import omero.gateway.facility.BrowseFacility;
+import omero.gateway.facility.MetadataFacility;
+import omero.model.IObject;
+
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+import static fr.igred.omero.exception.ExceptionHandler.call;
+
+
+public interface BasicBrowser {
+
+ /**
+ * Returns the current {@link SecurityContext}.
+ *
+ * @return See above
+ */
+ SecurityContext getCtx();
+
+
+ /**
+ * Gets the {@link BrowseFacility} used to access the data from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ BrowseFacility getBrowseFacility() throws ExecutionException;
+
+
+ /**
+ * Returns the {@link IQueryPrx} used to find objects on OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ */
+ IQueryPrx getQueryService() throws ServiceException, AccessException;
+
+
+ /**
+ * Gets the {@link MetadataFacility} used to retrieve annotations from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ExecutionException If the MetadataFacility can't be retrieved or instantiated.
+ */
+ MetadataFacility getMetadataFacility() throws ExecutionException;
+
+
+ /**
+ * Finds objects on OMERO through a database query.
+ *
+ * @param query The database query.
+ *
+ * @return A list of OMERO objects.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ */
+ default List findByQuery(String query)
+ throws ServiceException, AccessException {
+ return call(getQueryService(),
+ qs -> qs.findAllByQuery(query, null),
+ "Query failed: " + query);
+ }
+
+}
diff --git a/src/main/java/fr/igred/omero/client/BasicDataManager.java b/src/main/java/fr/igred/omero/client/BasicDataManager.java
new file mode 100644
index 00000000..941ddddc
--- /dev/null
+++ b/src/main/java/fr/igred/omero/client/BasicDataManager.java
@@ -0,0 +1,126 @@
+package fr.igred.omero.client;
+
+
+import fr.igred.omero.exception.AccessException;
+import fr.igred.omero.exception.ServiceException;
+import omero.gateway.SecurityContext;
+import omero.gateway.facility.DataManagerFacility;
+import omero.gateway.facility.ROIFacility;
+import omero.gateway.facility.TablesFacility;
+import omero.model.IObject;
+
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+
+public interface BasicDataManager {
+
+ /**
+ * Returns the current {@link SecurityContext}.
+ *
+ * @return See above
+ */
+ SecurityContext getCtx();
+
+
+ /**
+ * Gets the {@link DataManagerFacility} to handle/write data on OMERO. A
+ *
+ * @return See above.
+ *
+ * @throws ExecutionException If the DataManagerFacility can't be retrieved or instantiated.
+ */
+ DataManagerFacility getDMFacility() throws ExecutionException;
+
+
+ /**
+ * Gets the {@link ROIFacility} used to manipulate ROIs from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ExecutionException If the ROIFacility can't be retrieved or instantiated.
+ */
+ ROIFacility getRoiFacility() throws ExecutionException;
+
+
+ /**
+ * Gets the {@link TablesFacility} used to manipulate tables on OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ExecutionException If the TablesFacility can't be retrieved or instantiated.
+ */
+ TablesFacility getTablesFacility() throws ExecutionException;
+
+
+ /**
+ * Saves an object on OMERO.
+ *
+ * @param object The OMERO object.
+ *
+ * @return The saved OMERO object
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ IObject save(IObject object)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Deletes an object from OMERO.
+ *
+ * @param object The OMERO object.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ * @throws InterruptedException If block(long) does not return.
+ */
+ void delete(IObject object)
+ throws ServiceException, AccessException, ExecutionException, InterruptedException;
+
+
+ /**
+ * Deletes multiple objects from OMERO.
+ *
+ * @param objects The OMERO objects.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ * @throws InterruptedException If block(long) does not return.
+ */
+ void delete(List objects)
+ throws ServiceException, AccessException, ExecutionException, InterruptedException;
+
+
+ /**
+ * Deletes a file from OMERO
+ *
+ * @param id ID of the file to delete.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ * @throws InterruptedException If block(long) does not return.
+ */
+ void deleteFile(Long id)
+ throws ServiceException, AccessException, ExecutionException, InterruptedException;
+
+
+ /**
+ * Deletes files from OMERO.
+ *
+ * @param ids List of files IDs to delete.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ * @throws InterruptedException If block(long) does not return.
+ */
+ void deleteFiles(Long... ids)
+ throws ServiceException, AccessException, ExecutionException, InterruptedException;
+
+}
diff --git a/src/main/java/fr/igred/omero/client/Browser.java b/src/main/java/fr/igred/omero/client/Browser.java
index 1f4304b7..c221f8b0 100644
--- a/src/main/java/fr/igred/omero/client/Browser.java
+++ b/src/main/java/fr/igred/omero/client/Browser.java
@@ -18,84 +18,31 @@
package fr.igred.omero.client;
-import fr.igred.omero.RemoteObject;
-import fr.igred.omero.annotations.Annotation;
import fr.igred.omero.annotations.MapAnnotation;
-import fr.igred.omero.annotations.TagAnnotation;
-import fr.igred.omero.annotations.TagAnnotationWrapper;
import fr.igred.omero.containers.Dataset;
-import fr.igred.omero.containers.Folder;
import fr.igred.omero.containers.Project;
import fr.igred.omero.core.Image;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import fr.igred.omero.meta.Experimenter;
import fr.igred.omero.screen.Plate;
-import fr.igred.omero.screen.Screen;
-import fr.igred.omero.screen.Well;
-import omero.RLong;
-import omero.api.IQueryPrx;
import omero.gateway.SecurityContext;
-import omero.gateway.facility.BrowseFacility;
-import omero.gateway.facility.MetadataFacility;
-import omero.model.IObject;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Comparator;
import java.util.List;
-import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import static fr.igred.omero.RemoteObject.flatten;
-import static fr.igred.omero.exception.ExceptionHandler.call;
-import static java.lang.String.format;
/**
* Interface to browse data on an OMERO server in a given {@link SecurityContext}.
*/
-@SuppressWarnings("ClassWithTooManyMethods")
-//Fewer methods than counted because of polymorphism.
-public interface Browser {
-
- /**
- * Returns the current {@link SecurityContext}.
- *
- * @return See above
- */
- SecurityContext getCtx();
-
-
- /**
- * Gets the {@link BrowseFacility} used to access the data from OMERO.
- *
- * @return See above.
- *
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- BrowseFacility getBrowseFacility() throws ExecutionException;
-
-
- /**
- * Returns the {@link IQueryPrx} used to find objects on OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- */
- IQueryPrx getQueryService() throws ServiceException, AccessException;
-
-
- /**
- * Gets the {@link MetadataFacility} used to retrieve annotations from OMERO.
- *
- * @return See above.
- *
- * @throws ExecutionException If the MetadataFacility can't be retrieved or instantiated.
- */
- MetadataFacility getMetadataFacility() throws ExecutionException;
+public interface Browser extends fr.igred.omero.containers.ContainersBrowser,
+ fr.igred.omero.core.ImageBrowser,
+ fr.igred.omero.screen.ScreenBrowser,
+ fr.igred.omero.annotations.AnnotationsBrowser {
/**
@@ -106,231 +53,6 @@ public interface Browser {
Experimenter getUser();
- /**
- * Finds objects on OMERO through a database query.
- *
- * @param query The database query.
- *
- * @return A list of OMERO objects.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- */
- default List findByQuery(String query)
- throws ServiceException, AccessException {
- return call(getQueryService(),
- qs -> qs.findAllByQuery(query, null),
- "Query failed: " + query);
- }
-
-
- /**
- * Gets the project with the specified id from OMERO.
- *
- * @param id ID of the project.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Project getProject(Long id)
- throws ServiceException, AccessException, ExecutionException {
- List projects = getProjects(id);
- if (projects.isEmpty()) {
- String msg = format("Project %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return projects.iterator().next();
- }
-
-
- /**
- * Gets the projects with the specified ids from OMERO.
- *
- * @param ids Project IDs
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getProjects(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all projects available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getProjects()
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all projects available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getProjects(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all projects with a certain name from OMERO.
- *
- * @param name Name searched.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getProjects(String name)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets the dataset with the specified id from OMERO.
- *
- * @param id ID of the dataset.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Dataset getDataset(Long id)
- throws ServiceException, AccessException, ExecutionException {
- List datasets = getDatasets(id);
- if (datasets.isEmpty()) {
- String msg = format("Dataset %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return datasets.iterator().next();
- }
-
-
- /**
- * Gets the datasets with the specified ids from OMERO.
- *
- * @param ids Dataset IDs
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getDatasets(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all datasets available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getDatasets()
- throws ServiceException, AccessException, ExecutionException {
- Long[] ids = this.findByQuery("select d from Dataset d")
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getDatasets(ids);
- }
-
-
- /**
- * Gets all datasets available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getDatasets(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException {
- String template = "select d from Dataset d where d.details.owner.id=%d";
- String query = format(template, experimenter.getId());
- Long[] ids = this.findByQuery(query)
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getDatasets(ids);
- }
-
-
- /**
- * Gets all datasets with a certain name from OMERO.
- *
- * @param name Name searched.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getDatasets(String name)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all orphaned datasets available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getOrphanedDatasets(Experimenter experimenter)
- throws ServiceException, ExecutionException, AccessException {
- String template = "select dataset from Dataset as dataset" +
- " join fetch dataset.details.owner as o" +
- " where o.id = %d" +
- " and not exists" +
- " (select obl from ProjectDatasetLink as obl" +
- " where obl.child = dataset.id)";
- String query = format(template, experimenter.getId());
- Long[] ids = this.findByQuery(query)
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getDatasets(ids);
- }
-
-
/**
* Gets all orphaned datasets available from OMERO owned by the current user.
*
@@ -340,101 +62,13 @@ default List getOrphanedDatasets(Experimenter experimenter)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
+ @Override
default List getOrphanedDatasets()
throws ServiceException, ExecutionException, AccessException {
return getOrphanedDatasets(getUser());
}
- /**
- * Returns the image with the specified ID from OMERO.
- *
- * @param id ID of the image.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- Image getImage(Long id)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets the images with the specified ids from OMERO
- *
- * @param ids Image IDs
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getImages(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all images owned by the current user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getImages()
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all images with a certain name from OMERO.
- *
- * @param name Name searched.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getImages(String name)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all orphaned images owned by the specified user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getOrphanedImages(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all orphaned images owned by the current user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getOrphanedImages()
- throws ServiceException, AccessException, ExecutionException {
- return getOrphanedImages(getUser());
- }
-
-
/**
* Gets all images with the name specified inside projects and datasets with the given names.
*
@@ -448,6 +82,7 @@ default List getOrphanedImages()
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
+ @Override
default List getImages(String projectName, String datasetName, String imageName)
throws ServiceException, AccessException, ExecutionException {
List projects = getProjects(projectName);
@@ -461,43 +96,6 @@ default List getImages(String projectName, String datasetName, String ima
}
- /**
- * Gets all images with the specified annotation from OMERO.
- *
- * @param annotation TagAnnotation containing the tag researched.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getImages(Annotation annotation)
- throws ServiceException, AccessException, ExecutionException {
- return annotation.getImages(this);
- }
-
-
- /**
- * Gets all images with a certain motif in their name from OMERO.
- *
- * @param motif Motif searched in an image name.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getImagesLike(String motif)
- throws ServiceException, AccessException, ExecutionException {
- List images = getImages();
- String regexp = ".*" + motif + ".*";
- images.removeIf(image -> !image.getName().matches(regexp));
- return images;
- }
-
-
/**
* Gets all images with a certain key.
*
@@ -509,6 +107,7 @@ default List getImagesLike(String motif)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
+ @Override
default List getImagesWithKey(String key)
throws ServiceException, AccessException, ExecutionException {
List maps = getMapAnnotations(key);
@@ -534,6 +133,7 @@ default List getImagesWithKey(String key)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
+ @Override
default List getImagesWithKeyValuePair(String key, String value)
throws ServiceException, AccessException, ExecutionException {
List maps = getMapAnnotations(key, value);
@@ -548,60 +148,7 @@ default List getImagesWithKeyValuePair(String key, String value)
/**
- * Gets the screen with the specified id from OMERO.
- *
- * @param id ID of the screen.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Screen getScreen(Long id)
- throws ServiceException, AccessException, ExecutionException {
- List screens = getScreens(id);
- if (screens.isEmpty()) {
- String msg = format("Screen %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return screens.iterator().next();
- }
-
-
- /**
- * Gets the screens with the specified ids from OMERO.
- *
- * @param ids A list of screen ids
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getScreens(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all screens available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getScreens()
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all screens available from OMERO owned by a given user.
- *
- * @param experimenter The user.
+ * Gets all orphaned images owned by the current user.
*
* @return See above.
*
@@ -609,102 +156,10 @@ List getScreens()
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getScreens(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets the plate with the specified id from OMERO.
- *
- * @param id ID of the plate.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Plate getPlate(Long id)
+ @Override
+ default List getOrphanedImages()
throws ServiceException, AccessException, ExecutionException {
- List plates = getPlates(id);
- if (plates.isEmpty()) {
- String msg = format("Plate %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return plates.iterator().next();
- }
-
-
- /**
- * Gets the plates with the specified ids from OMERO.
- *
- * @param ids A list of plate ids
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getPlates(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all plates available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getPlates()
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all plates available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getPlates(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all orphaned plates available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getOrphanedPlates(Experimenter experimenter)
- throws ServiceException, ExecutionException, AccessException {
- String template = "select plate from Plate as plate" +
- " join fetch plate.details.owner as o" +
- " where o.id = %d" +
- " and not exists" +
- " (select obl from ScreenPlateLink as obl" +
- " where obl.child = plate.id)";
- String query = format(template, experimenter.getId());
- Long[] ids = this.findByQuery(query)
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getPlates(ids);
+ return getOrphanedImages(getUser());
}
@@ -723,253 +178,4 @@ default List getOrphanedPlates()
}
- /**
- * Gets the well with the specified id from OMERO.
- *
- * @param id ID of the well.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Well getWell(Long id)
- throws ServiceException, AccessException, ExecutionException {
- List wells = getWells(id);
- if (wells.isEmpty()) {
- String msg = format("Plate %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return wells.iterator().next();
- }
-
-
- /**
- * Gets the wells with the specified ids from OMERO.
- *
- * @param ids A list of well ids
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getWells(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets all wells available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getWells()
- throws ServiceException, AccessException, ExecutionException {
- Long[] ids = this.findByQuery("select w from Well w")
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getWells(ids);
- }
-
-
- /**
- * Gets all wells available from OMERO owned by a given user.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default List getWells(Experimenter experimenter)
- throws ServiceException, AccessException, ExecutionException {
- String template = "select w from Well w where w.details.owner.id=%d";
- String query = format(template, experimenter.getId());
- Long[] ids = this.findByQuery(query)
- .stream()
- .map(IObject::getId)
- .map(RLong::getValue)
- .toArray(Long[]::new);
- return getWells(ids);
- }
-
-
- /**
- * Gets the folder with the specified ID from OMERO, fully loaded.
- *
- * @param id ID of the folder.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws NoSuchElementException No element with this ID.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- default Folder getFolder(long id)
- throws ServiceException, AccessException, ExecutionException {
- List folders = getFolders(id);
- if (folders.isEmpty()) {
- String msg = format("Folder %d doesn't exist in this context", id);
- throw new NoSuchElementException(msg);
- }
- return folders.iterator().next();
- }
-
-
- /**
- * Gets all folders available from OMERO.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getFolders()
- throws ExecutionException, AccessException, ServiceException;
-
-
- /**
- * Gets all the folders owned by a given user from OMERO.
- *
- * @param experimenter The user.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getFolders(Experimenter experimenter)
- throws ExecutionException, AccessException, ServiceException;
-
-
- /**
- * Gets the folders with the specified IDs from OMERO (fully loaded).
- *
- * @param ids Project IDs
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- List getFolders(Long... ids)
- throws ServiceException, AccessException, ExecutionException;
-
-
- /**
- * Gets the list of tag annotations available to the user.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- List getTags()
- throws AccessException, ServiceException;
-
-
- /**
- * Gets the list of tag annotations with the specified name available to the user.
- *
- * @param name Name of the tag searched.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- default List getTags(String name)
- throws AccessException, ServiceException {
- List tags = getTags();
- tags.removeIf(tag -> !tag.getName().equals(name));
- tags.sort(Comparator.comparing(RemoteObject::getId));
- return tags;
- }
-
-
- /**
- * Gets a specific tag from the OMERO database.
- *
- * @param id ID of the tag.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- * @throws NoSuchElementException No element with this ID.
- */
- TagAnnotationWrapper getTag(Long id)
- throws AccessException, ServiceException;
-
-
- /**
- * Gets the list of map annotations available to the user.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- List getMapAnnotations()
- throws AccessException, ServiceException;
-
-
- /**
- * Gets the list of map annotations with the specified key available to the user.
- *
- * @param key Name of the tag searched.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- List getMapAnnotations(String key)
- throws AccessException, ServiceException;
-
-
- /**
- * Gets the list of map annotations with the specified key and value available to the user.
- *
- * @param key The required key.
- * @param value The required value.
- *
- * @return See above.
- *
- * @throws AccessException Cannot access data.
- * @throws ServiceException Cannot connect to OMERO.
- */
- List getMapAnnotations(String key, String value)
- throws AccessException, ServiceException;
-
-
- /**
- * Gets a specific map annotation (key/value pairs) from the OMERO database.
- *
- * @param id ID of the map annotation.
- *
- * @return See above.
- *
- * @throws ServiceException Cannot connect to OMERO.
- * @throws AccessException Cannot access data.
- * @throws ExecutionException A Facility can't be retrieved or instantiated.
- */
- MapAnnotation getMapAnnotation(Long id)
- throws ServiceException, ExecutionException, AccessException;
-
}
diff --git a/src/main/java/fr/igred/omero/client/DataManager.java b/src/main/java/fr/igred/omero/client/DataManager.java
index ef9de8bb..ae013c2a 100644
--- a/src/main/java/fr/igred/omero/client/DataManager.java
+++ b/src/main/java/fr/igred/omero/client/DataManager.java
@@ -25,9 +25,6 @@
import fr.igred.omero.exception.ExceptionHandler;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.SecurityContext;
-import omero.gateway.facility.DataManagerFacility;
-import omero.gateway.facility.ROIFacility;
-import omero.gateway.facility.TablesFacility;
import omero.model.FileAnnotationI;
import omero.model.IObject;
@@ -43,44 +40,7 @@
/**
* Interface to add or remove data on an OMERO server in a given {@link SecurityContext}.
*/
-public interface DataManager {
-
- /**
- * Returns the current {@link SecurityContext}.
- *
- * @return See above
- */
- SecurityContext getCtx();
-
-
- /**
- * Gets the {@link DataManagerFacility} to handle/write data on OMERO. A
- *
- * @return See above.
- *
- * @throws ExecutionException If the DataManagerFacility can't be retrieved or instantiated.
- */
- DataManagerFacility getDMFacility() throws ExecutionException;
-
-
- /**
- * Gets the {@link ROIFacility} used to manipulate ROIs from OMERO.
- *
- * @return See above.
- *
- * @throws ExecutionException If the ROIFacility can't be retrieved or instantiated.
- */
- ROIFacility getRoiFacility() throws ExecutionException;
-
-
- /**
- * Gets the {@link TablesFacility} used to manipulate tables on OMERO.
- *
- * @return See above.
- *
- * @throws ExecutionException If the TablesFacility can't be retrieved or instantiated.
- */
- TablesFacility getTablesFacility() throws ExecutionException;
+public interface DataManager extends BasicDataManager {
/**
@@ -175,6 +135,7 @@ default void deleteTables(Collection extends TableWrapper> tables)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
+ @Override
default IObject save(IObject object)
throws ServiceException, AccessException, ExecutionException {
return call(getDMFacility(),
@@ -193,6 +154,7 @@ default IObject save(IObject object)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
+ @Override
default void delete(IObject object)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
final long wait = 500L;
@@ -214,6 +176,7 @@ default void delete(IObject object)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
+ @Override
default void delete(List objects)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
final long wait = 500L;
@@ -235,6 +198,7 @@ default void delete(List objects)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
+ @Override
default void deleteFile(Long id)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
deleteFiles(id);
@@ -251,6 +215,7 @@ default void deleteFile(Long id)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws InterruptedException If block(long) does not return.
*/
+ @Override
default void deleteFiles(Long... ids)
throws ServiceException, AccessException, ExecutionException, InterruptedException {
List files = Arrays.stream(ids)
diff --git a/src/main/java/fr/igred/omero/containers/ContainersBrowser.java b/src/main/java/fr/igred/omero/containers/ContainersBrowser.java
new file mode 100644
index 00000000..1347096d
--- /dev/null
+++ b/src/main/java/fr/igred/omero/containers/ContainersBrowser.java
@@ -0,0 +1,305 @@
+package fr.igred.omero.containers;
+
+
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.exception.AccessException;
+import fr.igred.omero.exception.ServiceException;
+import fr.igred.omero.meta.Experimenter;
+import omero.RLong;
+import omero.model.IObject;
+
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.concurrent.ExecutionException;
+
+import static java.lang.String.format;
+
+
+public interface ContainersBrowser extends BasicBrowser {
+
+ /**
+ * Gets the project with the specified id from OMERO.
+ *
+ * @param id ID of the project.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws NoSuchElementException No element with this ID.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default Project getProject(Long id)
+ throws ServiceException, AccessException, ExecutionException {
+ List projects = getProjects(id);
+ if (projects.isEmpty()) {
+ String msg = format("Project %d doesn't exist in this context", id);
+ throw new NoSuchElementException(msg);
+ }
+ return projects.iterator().next();
+ }
+
+
+ /**
+ * Gets the projects with the specified ids from OMERO.
+ *
+ * @param ids Project IDs
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getProjects(Long... ids)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets all projects available from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getProjects()
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets all projects available from OMERO owned by a given user.
+ *
+ * @param experimenter The user.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getProjects(Experimenter experimenter)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets all projects with a certain name from OMERO.
+ *
+ * @param name Name searched.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getProjects(String name)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets the dataset with the specified id from OMERO.
+ *
+ * @param id ID of the dataset.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws NoSuchElementException No element with this ID.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default Dataset getDataset(Long id)
+ throws ServiceException, AccessException, ExecutionException {
+ List datasets = getDatasets(id);
+ if (datasets.isEmpty()) {
+ String msg = format("Dataset %d doesn't exist in this context", id);
+ throw new NoSuchElementException(msg);
+ }
+ return datasets.iterator().next();
+ }
+
+
+ /**
+ * Gets the datasets with the specified ids from OMERO.
+ *
+ * @param ids Dataset IDs
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getDatasets(Long... ids)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets all datasets available from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default List getDatasets()
+ throws ServiceException, AccessException, ExecutionException {
+ Long[] ids = this.findByQuery("select d from Dataset d")
+ .stream()
+ .map(IObject::getId)
+ .map(RLong::getValue)
+ .toArray(Long[]::new);
+ return getDatasets(ids);
+ }
+
+
+ /**
+ * Gets all datasets available from OMERO owned by a given user.
+ *
+ * @param experimenter The user.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default List getDatasets(Experimenter experimenter)
+ throws ServiceException, AccessException, ExecutionException {
+ String template = "select d from Dataset d where d.details.owner.id=%d";
+ String query = format(template, experimenter.getId());
+ Long[] ids = this.findByQuery(query)
+ .stream()
+ .map(IObject::getId)
+ .map(RLong::getValue)
+ .toArray(Long[]::new);
+ return getDatasets(ids);
+ }
+
+
+ /**
+ * Gets all datasets with a certain name from OMERO.
+ *
+ * @param name Name searched.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getDatasets(String name)
+ throws ServiceException, AccessException, ExecutionException;
+
+
+ /**
+ * Gets all orphaned datasets available from OMERO owned by a given user.
+ *
+ * @param experimenter The user.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default List getOrphanedDatasets(Experimenter experimenter)
+ throws ServiceException, ExecutionException, AccessException {
+ String template = "select dataset from Dataset as dataset" +
+ " join fetch dataset.details.owner as o" +
+ " where o.id = %d" +
+ " and not exists" +
+ " (select obl from ProjectDatasetLink as obl" +
+ " where obl.child = dataset.id)";
+ String query = format(template, experimenter.getId());
+ Long[] ids = this.findByQuery(query)
+ .stream()
+ .map(IObject::getId)
+ .map(RLong::getValue)
+ .toArray(Long[]::new);
+ return getDatasets(ids);
+ }
+
+
+ /**
+ * Gets all orphaned datasets available from OMERO owned by the current user.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getOrphanedDatasets()
+ throws ServiceException, ExecutionException, AccessException;
+
+
+ /**
+ * Gets the folder with the specified ID from OMERO, fully loaded.
+ *
+ * @param id ID of the folder.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws NoSuchElementException No element with this ID.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ default Folder getFolder(long id)
+ throws ServiceException, AccessException, ExecutionException {
+ List folders = getFolders(id);
+ if (folders.isEmpty()) {
+ String msg = format("Folder %d doesn't exist in this context", id);
+ throw new NoSuchElementException(msg);
+ }
+ return folders.iterator().next();
+ }
+
+
+ /**
+ * Gets all folders available from OMERO.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getFolders()
+ throws ExecutionException, AccessException, ServiceException;
+
+
+ /**
+ * Gets all the folders owned by a given user from OMERO.
+ *
+ * @param experimenter The user.
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getFolders(Experimenter experimenter)
+ throws ExecutionException, AccessException, ServiceException;
+
+
+ /**
+ * Gets the folders with the specified IDs from OMERO (fully loaded).
+ *
+ * @param ids Project IDs
+ *
+ * @return See above.
+ *
+ * @throws ServiceException Cannot connect to OMERO.
+ * @throws AccessException Cannot access data.
+ * @throws ExecutionException A Facility can't be retrieved or instantiated.
+ */
+ List getFolders(Long... ids)
+ throws ServiceException, AccessException, ExecutionException;
+
+}
diff --git a/src/main/java/fr/igred/omero/containers/Dataset.java b/src/main/java/fr/igred/omero/containers/Dataset.java
index 16186871..3a0dd844 100644
--- a/src/main/java/fr/igred/omero/containers/Dataset.java
+++ b/src/main/java/fr/igred/omero/containers/Dataset.java
@@ -21,11 +21,12 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.RepositoryObject;
import fr.igred.omero.annotations.TagAnnotation;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.client.Client;
import fr.igred.omero.client.ConnectionHandler;
-import fr.igred.omero.client.DataManager;
import fr.igred.omero.core.Image;
+import fr.igred.omero.core.ImageBrowser;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
@@ -101,7 +102,7 @@ public interface Dataset extends RepositoryObject {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getProjects(Browser browser)
+ default List getProjects(ContainersBrowser browser)
throws ServiceException, AccessException, ExecutionException {
String query = "select link.parent from ProjectDatasetLink as link" +
" where link.child=" + getId();
@@ -133,7 +134,7 @@ default List getProjects(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getImages(Browser browser)
+ List getImages(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
@@ -149,7 +150,7 @@ List getImages(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImages(Browser browser, String name)
+ default List getImages(BasicBrowser browser, String name)
throws ServiceException, AccessException, ExecutionException {
List images = getImages(browser);
images.removeIf(image -> !image.getName().equals(name));
@@ -169,7 +170,7 @@ default List getImages(Browser browser, String name)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImagesLike(Browser browser, String motif)
+ default List getImagesLike(BasicBrowser browser, String motif)
throws ServiceException, AccessException, ExecutionException {
List images = getImages(browser);
@@ -191,7 +192,7 @@ default List getImagesLike(Browser browser, String motif)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImagesTagged(Browser browser, TagAnnotation tag)
+ default List getImagesTagged(ImageBrowser browser, TagAnnotation tag)
throws ServiceException, AccessException, ExecutionException {
return getImagesTagged(browser, tag.getId());
}
@@ -209,7 +210,7 @@ default List getImagesTagged(Browser browser, TagAnnotation tag)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImagesTagged(Browser browser, Long tagId)
+ default List getImagesTagged(ImageBrowser browser, Long tagId)
throws ServiceException, AccessException, ExecutionException {
Long[] ids = browser.findByQuery("select link.parent" +
" from ImageAnnotationLink link" +
@@ -240,7 +241,7 @@ default List getImagesTagged(Browser browser, Long tagId)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImagesWithKey(Browser browser, String key)
+ default List getImagesWithKey(BasicBrowser browser, String key)
throws ServiceException, AccessException, ExecutionException {
String error = "Cannot get images with key \"" + key + "\" from " + this;
Collection images = call(browser.getBrowseFacility(),
@@ -279,7 +280,7 @@ default List getImagesWithKey(Browser browser, String key)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImagesWithKeyValuePair(Browser browser, String key, String value)
+ default List getImagesWithKeyValuePair(BasicBrowser browser, String key, String value)
throws ServiceException, AccessException, ExecutionException {
Collection images = call(browser.getBrowseFacility(),
bf -> bf.getImagesForDatasets(browser.getCtx(),
@@ -314,7 +315,7 @@ default List getImagesWithKeyValuePair(Browser browser, String key, Strin
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void addImages(DataManager dm, Iterable extends Image> images)
+ default void addImages(BasicDataManager dm, Iterable extends Image> images)
throws ServiceException, AccessException, ExecutionException {
for (Image image : images) {
addImage(dm, image);
@@ -332,7 +333,7 @@ default void addImages(DataManager dm, Iterable extends Image> images)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void addImage(DataManager dm, Image image)
+ default void addImage(BasicDataManager dm, Image image)
throws ServiceException, AccessException, ExecutionException {
DatasetImageLink link = new DatasetImageLinkI();
link.setChild(image.asDataObject().asImage());
@@ -502,7 +503,7 @@ default List importAndReplaceImages(Client client, String path)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- void reload(Browser browser)
+ void reload(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException;
}
diff --git a/src/main/java/fr/igred/omero/containers/DatasetWrapper.java b/src/main/java/fr/igred/omero/containers/DatasetWrapper.java
index cdf8fd1c..5e27ba36 100644
--- a/src/main/java/fr/igred/omero/containers/DatasetWrapper.java
+++ b/src/main/java/fr/igred/omero/containers/DatasetWrapper.java
@@ -20,7 +20,7 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.RepositoryObjectWrapper;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
import fr.igred.omero.client.Client;
import fr.igred.omero.client.ConnectionHandler;
import fr.igred.omero.core.Image;
@@ -154,7 +154,7 @@ public List getImages() {
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getImages(Browser browser)
+ public List getImages(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
Collection images = call(browser.getBrowseFacility(),
bf -> bf.getImagesForDatasets(browser.getCtx(),
@@ -284,7 +284,7 @@ public List importAndReplaceImages(Client client, String path, ReplacePoli
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void reload(Browser browser)
+ public void reload(BasicBrowser browser)
throws ServiceException, AccessException, ExecutionException {
data = call(browser.getBrowseFacility(),
bf -> bf.getDatasets(browser.getCtx(),
diff --git a/src/main/java/fr/igred/omero/containers/Folder.java b/src/main/java/fr/igred/omero/containers/Folder.java
index 795abf13..bfb47da6 100644
--- a/src/main/java/fr/igred/omero/containers/Folder.java
+++ b/src/main/java/fr/igred/omero/containers/Folder.java
@@ -20,8 +20,8 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.RepositoryObject;
-import fr.igred.omero.client.Browser;
-import fr.igred.omero.client.DataManager;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.core.Image;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ExceptionHandler;
@@ -77,7 +77,7 @@ public interface Folder extends RepositoryObject {
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- default void link(DataManager dm, A annotation)
+ default void link(BasicDataManager dm, A annotation)
throws ServiceException, AccessException, ExecutionException {
FolderAnnotationLink link = new FolderAnnotationLinkI();
link.setChild(annotation.asAnnotation());
@@ -154,7 +154,7 @@ default void link(DataManager dm, A annotation)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void addImages(DataManager dm, Image... images)
+ default void addImages(BasicDataManager dm, Image... images)
throws ServiceException, AccessException, ExecutionException {
List links = new ArrayList<>(images.length);
List linkedIds = getImages().stream()
@@ -194,7 +194,7 @@ default void addImages(DataManager dm, Image... images)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getImages(Browser browser)
+ default List getImages(BasicBrowser browser)
throws AccessException, ServiceException, ExecutionException {
reload(browser);
return getImages();
@@ -212,7 +212,7 @@ default List getImages(Browser browser)
* @throws AccessException Cannot access data.
* @throws ExecutionException If the ROIFacility can't be retrieved or instantiated.
*/
- default void addROIs(DataManager dm, long imageId, ROI... rois)
+ default void addROIs(BasicDataManager dm, long imageId, ROI... rois)
throws ServiceException, AccessException, ExecutionException {
List roiData = Arrays.stream(rois)
.map(ROI::asDataObject)
@@ -239,7 +239,7 @@ default void addROIs(DataManager dm, long imageId, ROI... rois)
* @throws AccessException Cannot access data.
* @throws ExecutionException If the ROIFacility can't be retrieved or instantiated.
*/
- default void addROIs(DataManager dm, Image image, ROI... rois)
+ default void addROIs(BasicDataManager dm, Image image, ROI... rois)
throws ServiceException, AccessException, ExecutionException {
addROIs(dm, image.getId(), rois);
}
@@ -257,7 +257,7 @@ default void addROIs(DataManager dm, Image image, ROI... rois)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List getROIs(DataManager dm, long imageId)
+ List getROIs(BasicDataManager dm, long imageId)
throws ServiceException, AccessException, ExecutionException;
@@ -273,7 +273,7 @@ List getROIs(DataManager dm, long imageId)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default List getROIs(DataManager dm, Image image)
+ default List getROIs(BasicDataManager dm, Image image)
throws ServiceException, AccessException, ExecutionException {
return getROIs(dm, image.getId());
}
@@ -290,7 +290,7 @@ default List getROIs(DataManager dm, Image image)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void unlinkAllROIs(DataManager dm, long imageId)
+ default void unlinkAllROIs(BasicDataManager dm, long imageId)
throws ServiceException, AccessException, ExecutionException {
unlinkROIs(dm, getROIs(dm, imageId));
}
@@ -307,7 +307,7 @@ default void unlinkAllROIs(DataManager dm, long imageId)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void unlinkAllROIs(DataManager dm, Image image)
+ default void unlinkAllROIs(BasicDataManager dm, Image image)
throws ServiceException, AccessException, ExecutionException {
unlinkAllROIs(dm, image.getId());
}
@@ -324,7 +324,7 @@ default void unlinkAllROIs(DataManager dm, Image image)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- void unlinkAllROIs(DataManager dm)
+ void unlinkAllROIs(BasicDataManager dm)
throws ServiceException, AccessException, ExecutionException;
@@ -339,7 +339,7 @@ void unlinkAllROIs(DataManager dm)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void unlinkROIs(DataManager dm, ROI... rois)
+ default void unlinkROIs(BasicDataManager dm, ROI... rois)
throws ServiceException, AccessException, ExecutionException {
unlinkROIs(dm, Arrays.asList(rois));
}
@@ -356,7 +356,7 @@ default void unlinkROIs(DataManager dm, ROI... rois)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default void unlinkROIs(DataManager dm, Collection extends ROI> rois)
+ default void unlinkROIs(BasicDataManager dm, Collection extends ROI> rois)
throws ServiceException, AccessException, ExecutionException {
List roiData = rois.stream()
.map(ROI::asDataObject)
diff --git a/src/main/java/fr/igred/omero/containers/FolderWrapper.java b/src/main/java/fr/igred/omero/containers/FolderWrapper.java
index c3413ec6..b20c8572 100644
--- a/src/main/java/fr/igred/omero/containers/FolderWrapper.java
+++ b/src/main/java/fr/igred/omero/containers/FolderWrapper.java
@@ -20,9 +20,9 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.RepositoryObjectWrapper;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.client.ConnectionHandler;
-import fr.igred.omero.client.DataManager;
import fr.igred.omero.core.Image;
import fr.igred.omero.core.ImageWrapper;
import fr.igred.omero.exception.AccessException;
@@ -238,7 +238,7 @@ public List getImages() {
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public List getROIs(DataManager dm, long imageId)
+ public List getROIs(BasicDataManager dm, long imageId)
throws ServiceException, AccessException, ExecutionException {
Collection roiResults = call(dm.getRoiFacility(),
rf -> rf.loadROIsForFolder(dm.getCtx(),
@@ -269,7 +269,7 @@ public List getROIs(DataManager dm, long imageId)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void unlinkAllROIs(DataManager dm)
+ public void unlinkAllROIs(BasicDataManager dm)
throws ServiceException, AccessException, ExecutionException {
Collection rois = wrap(data.copyROILinks(), ROIWrapper::new);
unlinkROIs(dm, rois.toArray(EMPTY_ROI_ARRAY));
@@ -286,7 +286,7 @@ public void unlinkAllROIs(DataManager dm)
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
@Override
- public void reload(Browser browser)
+ public void reload(BasicBrowser browser)
throws AccessException, ServiceException, ExecutionException {
data = call(browser.getBrowseFacility(),
bf -> bf.loadFolders(browser.getCtx(),
diff --git a/src/main/java/fr/igred/omero/containers/Project.java b/src/main/java/fr/igred/omero/containers/Project.java
index 44f0a0be..7ef7dffe 100644
--- a/src/main/java/fr/igred/omero/containers/Project.java
+++ b/src/main/java/fr/igred/omero/containers/Project.java
@@ -21,10 +21,11 @@
import fr.igred.omero.RemoteObject;
import fr.igred.omero.RepositoryObject;
import fr.igred.omero.annotations.TagAnnotation;
-import fr.igred.omero.client.Browser;
+import fr.igred.omero.client.BasicBrowser;
+import fr.igred.omero.client.BasicDataManager;
import fr.igred.omero.client.Client;
-import fr.igred.omero.client.DataManager;
import fr.igred.omero.core.Image;
+import fr.igred.omero.core.ImageBrowser;
import fr.igred.omero.exception.AccessException;
import fr.igred.omero.exception.ServiceException;
import omero.gateway.model.ProjectData;
@@ -114,7 +115,7 @@ default List getDatasets(String name) {
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- Dataset addDataset(DataManager dm, String name, String description)
+ Dataset addDataset(BasicDataManager dm, String name, String description)
throws ServiceException, AccessException, ExecutionException;
@@ -130,7 +131,7 @@ Dataset addDataset(DataManager dm, String name, String description)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- default Dataset addDataset(DataManager dm, Dataset dataset)
+ default Dataset addDataset(BasicDataManager dm, Dataset dataset)
throws ServiceException, AccessException, ExecutionException {
dataset.saveAndUpdate(dm);
ProjectDatasetLink link = new ProjectDatasetLinkI();
@@ -168,7 +169,7 @@ void removeDataset(Client client, Dataset dataset)
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
*/
- List