Skip to content

Commit

Permalink
Merge pull request DSpace#1279 from helix84/DS-3040-version-discovery
Browse files Browse the repository at this point in the history
DS-3040 fix discovery detection in "dspace version"
+1 looks right, simple fix.
  • Loading branch information
mwoodiupui committed Feb 5, 2016
2 parents d2f5249 + 79a92ea commit b1fe041
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions dspace-api/src/main/java/org/dspace/app/util/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ public static void main(String[] argv)

// Is Discovery available?
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
String consumers = config.getPropertyAsType("event.dispatcher.default.consumers", ""); // Avoid null pointer
List<String> consumerList = Arrays.asList(consumers.split("\\s*,\\s*"));
if (consumerList.contains("discovery"))
{
System.out.println(" Discovery: enabled.");
}

// Is Lucene search enabled?
if (consumerList.contains("search"))
{
System.out.println(" Lucene search: enabled.");
String[] consumers = config.getArrayProperty("event.dispatcher.default.consumers");
String discoveryStatus = "not enabled.";
for (String consumer : consumers) {
if (consumer.equals("discovery"))
{
discoveryStatus = "enabled.";
break;
}
}
System.out.println(" Discovery: " + discoveryStatus);

// Java version
System.out.printf(" JRE: %s version %s\n",
Expand Down

0 comments on commit b1fe041

Please sign in to comment.