Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when connecting to multiple servers #86

Merged
merged 44 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0bcb07a
Use generic return types
dominikl Nov 16, 2022
15cdbaf
Add facility for faster 'shallow' loading of objects
dominikl Nov 16, 2022
5b26123
Fix the hql queries
dominikl Mar 14, 2023
ecb8157
Update src/main/java/omero/gateway/facility/LoadFacility.java
dominikl Mar 15, 2023
606077f
Update src/main/java/omero/gateway/facility/LoadFacility.java
dominikl Mar 15, 2023
c2b6ebe
Return null if no wells
dominikl Mar 15, 2023
4cd89b2
add entry for 5.8.0
jburel Mar 17, 2023
462b230
drop snapshot
jburel Mar 17, 2023
0d101cf
revert to snapshot
jburel Mar 17, 2023
c520f92
Set StringColumn to the correct size
dominikl Jun 9, 2023
3f7f731
Fix bug on download images based on omero-insight#264
Rdornier Jul 7, 2023
0ec66e6
remove unused imports
Rdornier Jul 10, 2023
112da2b
Remove gradle files
Rdornier Jul 10, 2023
77e6803
Delete gradlew
Rdornier Jul 10, 2023
21b2b5a
Delete gradle/wrapper directory
Rdornier Jul 10, 2023
8993e91
Delete gradlew.bat
Rdornier Jul 10, 2023
ff0d7a4
remove commented lines
Rdornier Jul 10, 2023
df2602a
Remove log files from git
Rdornier Jul 10, 2023
85968ea
Delete hs_err_pid13244.log
Rdornier Jul 10, 2023
5939536
bump org.openmicroscopy:omero-blitz to 5.6.3
jburel Jul 19, 2023
64f0c6f
add entry for 5.8.1
jburel Jul 19, 2023
001b7f8
drop snapshot
jburel Jul 19, 2023
b4a6a63
revert to snapshot
jburel Jul 19, 2023
5b1be65
Add top-level Git mailmap
sbesson Aug 21, 2023
3577d2f
bump org.openmicroscopy:omero-blitz to 5.7.1
jburel Sep 7, 2023
230f6a7
add entry for 5.8.2
jburel Sep 7, 2023
49c2555
drop snapshot
jburel Sep 7, 2023
bddd2a6
revert to snapshot
jburel Sep 7, 2023
cfbcc59
Simply return empty string if middlename is null
dominikl Nov 23, 2023
a04b0b8
Download into Fileset_xyz directory
dominikl Nov 24, 2023
b7da7a6
Add method to load multiple objects at once
dominikl Aug 25, 2023
e4ac9fe
Removed code duplication; added more methods
dominikl Aug 29, 2023
cc1e0d1
Fix loading wells
dominikl Sep 1, 2023
17180fd
Add method to load original metadata
dominikl Feb 2, 2023
cd6e7e9
Removed duplicated code
dominikl Feb 3, 2023
33c2047
Simplified read method using try-with-resources
dominikl Feb 3, 2023
ad523e4
Just a bit clean up
dominikl Feb 3, 2023
b20b45c
Use StringBuffer and fix date/author
dominikl Aug 8, 2023
342fef6
add entry for 5.9.0
jburel Dec 14, 2023
ba20789
bump org.openmicroscopy:omero-blitz to 5.7.2
jburel Dec 14, 2023
014c705
drop snapshot
jburel Dec 14, 2023
a8174bf
revert to snapshot
jburel Dec 14, 2023
ff97622
Fix bug when connecting to multiple servers
Rdornier Jan 26, 2024
ca83790
Update error message
Rdornier Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

# generated files
/build
/gradle
/src/generated/*
gradlew
*.bat
*.log

# Local configuration file (sdk path, etc)
local.properties
Expand Down
18 changes: 18 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Aleksandra Tarkowska <[email protected]> <[email protected]>
Andrew Patterson <[email protected]> Andrew J Patterson <[email protected]>
Chris Allan <[email protected]> <[email protected]>
Colin Blackburn <[email protected]> <[email protected]>
Colin Blackburn <[email protected]> <[email protected]>
Dominik Lindner <[email protected]> <[email protected]>
Jean-Marie Burel <[email protected]> jburel <[email protected]>
Jean-Marie Burel <[email protected]> jean-marie burel <[email protected]>
Josh Moore <[email protected]> <[email protected]>
Josh Moore <[email protected]> <[email protected]>
Josh Moore <[email protected]> <[email protected]>
Josh Moore <[email protected]> <jmoore@05709c45-44f0-0310-885b-81a1db45b4a6>
Mark Carroll <[email protected]> <[email protected]>
Melissa Linkert <[email protected]> <[email protected]>
Rémy Dornier <[email protected]> Rdornier <[email protected]>
Roger Leigh <[email protected]> <[email protected]>
Sébastien Besson <[email protected]> <[email protected]>
Will Moore <[email protected]> <[email protected]>
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
5.9.0 (December 2023)
---------------------

- Simply return empty string if middlename is null ([#84](https://github.com/ome/omero-gateway-java/pull/84))
- Add method to load multiple objects at once ([#82](https://github.com/ome/omero-gateway-java/pull/82))
- Download into Fileset_xyz directory ([#85](https://github.com/ome/omero-gateway-java/pull/85))
- Add method to load original metadata ([#72](https://github.com/ome/omero-gateway-java/pull/72))
- Bump omero-blitz version to 5.7.2

5.8.2 (September 2023)
----------------------

- Bump omero-blitz version to 5.7.1
- Add top-level Git mailmap

5.8.1 (July 2023)
-----------------

- Fix bug on download images based on omero-insight#264 ([#78](https://github.com/ome/omero-gateway-java/pull/78)) Thanks to Rémy Dornier
- BugFix: Set StringColumn to the correct size ([#76](https://github.com/ome/omero-gateway-java/pull/76))
- Bump omero-blitz version to 5.6.3

5.8.0 (March 2023)
------------------

- Add Facility for shallow loading of objects ([#68](https://github.com/ome/omero-gateway-java/pull/68))

5.7.2 (March 2023)
------------------

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ plugins {
}

group = "org.openmicroscopy"
version = "5.7.3-SNAPSHOT"
version = "5.9.1-SNAPSHOT"

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
api("org.openmicroscopy:omero-blitz:5.6.2")
api("org.openmicroscopy:omero-blitz:5.7.2")

implementation("commons-beanutils:commons-beanutils:1.9.3")
implementation("com.zeroc:icegrid:3.6.5")
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/omero/gateway/Gateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ public class Gateway implements AutoCloseable {
/** Flag to indicate that executor threads should be shutdown on disconnect */
private boolean executorShutdownOnDisconnect = false;

private String serverHost;

/**
* Creates a new Gateway instance
* @param log A {@link Logger}
Expand Down Expand Up @@ -408,6 +410,20 @@ public String getServerVersion() throws DSOutOfServiceException {
return serverVersion;
}

/**
* Get the hostname of the server the Gateway is connected to
*
* @return See above
* @throws DSOutOfServiceException
* If the connection is broken, or not logged in
*/
public String getServerHost() throws DSOutOfServiceException{
if (serverHost == null) {
throw new DSOutOfServiceException("Not logged in.");
}
return serverHost;
}

/**
* Get a {@link Facility} to perform further operations with the server
*
Expand Down Expand Up @@ -1221,6 +1237,7 @@ private ExperimenterData login(SessionWrapper session, LoginCredentials cred)
}
// Connector now controls the secureClient for closing.
String host = session.client.getProperty("omero.host");
this.serverHost = host;
cred.getServer().setHostname(host);
String port = session.client.getProperty("omero.port");
cred.getServer().setPort(Integer.parseInt(port));
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/omero/gateway/facility/Facility.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ public static <T extends Facility> T getFacility(final Class<T> type,
+ type.getSimpleName(), e);
}
}

return (T) cache.get(type.getSimpleName(), new Callable<Facility>() {
String serverHost;
try{
serverHost = gateway.getServerHost();
}catch (DSOutOfServiceException e){
throw new ExecutionException("Not logged in; Can't instantiate "
+ type.getSimpleName(), e);
}
return (T) cache.get(type.getSimpleName() + ":" +serverHost, new Callable<Facility>() {

@Override
public Facility call() throws Exception {
Expand Down
Loading
Loading