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

Record error #46

Merged
merged 5 commits into from Jun 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -473,13 +473,11 @@ public void connect(UserCredentials uc)

if (uc == null)
throw new NullPointerException("No user credentials.");
LogMessage msg;
String name = (String)
container.getRegistry().lookup(LookupNames.MASTER);
if (CommonsLangUtils.isBlank(name)) {
if (CommonsLangUtils.isBlank(name)) {
name = LookupNames.MASTER_INSIGHT;
}
if (name.startsWith("OMERO.")) {
name = name.substring("OMERO.".length());
}
LoginCredentials cred = new LoginCredentials();
cred.getUser().setUsername(uc.getUserName());
Expand All @@ -490,8 +488,8 @@ public void connect(UserCredentials uc)
cred.setCheckNetwork(true);
cred.setCompression(determineCompression(uc.getSpeedLevel()));
cred.setEncryption(uc.isEncrypted());

ExperimenterData exp = omeroGateway.connect(cred);
ExperimenterData exp = omeroGateway.connect(cred);


//check client server version
compatible = true;
Expand All @@ -506,7 +504,6 @@ public void connect(UserCredentials uc)
//Check if client and server are compatible.
String version = omeroGateway.getServerVersion();


// TODO: Can be removed for >= 5.5.0 release
container.getRegistry().bind(LookupNames.SERVER_5_4_8_OR_LATER, VersionCompare.compare(version, "5.4.8") >= 0);

Expand All @@ -518,16 +515,17 @@ public void connect(UserCredentials uc)
val = cs.getConfigValue("omero.pixeldata.max_plane_height");
if (val != null)
container.getRegistry().bind(LookupNames.MAX_PLANE_HEIGHT, Integer.parseInt(val));
} catch (ServerError e2) {
registry.getLogger().warn(this, "Could not access ConfigService");
}

//Register insight
try {
UpgradeCheck check = new UpgradeCheck(cs.getConfigValue("omero.upgrades.url"), clientVersion, name);
String checkname = name;
if (name.startsWith("OMERO.")) {
checkname = name.substring("OMERO.".length());
}
//Register insight
UpgradeCheck check = new UpgradeCheck(cs.getConfigValue("omero.upgrades.url"), clientVersion, checkname);
check.run();
} catch (ServerError e2) {
registry.getLogger().warn(this, "Could not access ConfigService");
msg = new LogMessage("Could not access ConfigService", e2);
registry.getLogger().warn(this, msg);
}

//Post an event to indicate that the user is connected.
Expand All @@ -537,7 +535,7 @@ public void connect(UserCredentials uc)
compatible = true;
//Register into log file.
Map<String, String> info = ProxyUtil.collectOsInfoAndJavaVersion();
LogMessage msg = new LogMessage();
msg = new LogMessage();
msg.println("Server version: "+version);
msg.println("Client version: "+clientVersion);
Entry<String, String> entry;
Expand Down Expand Up @@ -567,7 +565,8 @@ public void connect(UserCredentials uc)
}
}
} catch (DSAccessException e1) {
registry.getLogger().warn(this, "Could not load omero client properties from the server");
msg = new LogMessage("Could not load omero client properties from the server", e1);
registry.getLogger().warn(this, msg);
}

Collection<GroupData> groups;
Expand Down Expand Up @@ -659,7 +658,8 @@ public void connect(UserCredentials uc)
registry.bind(LookupNames.PRIV_EDIT_GROUP, false);
registry.bind(LookupNames.PRIV_GROUP_ADD, false);
registry.bind(LookupNames.PRIV_MOVE_GROUP, false);
registry.getLogger().warn(this, "Could not retrieve admin priviledges.");
msg = new LogMessage("Could not retrieve admin privileges.", e1);
registry.getLogger().warn(this, msg);
}

} catch (DSAccessException e) {
Expand Down