Since WebDriver instance is common for both FileUtils and FolderUtils a new class...
[pithos] / src / gr / ebs / gss / mbeans / Solr.java
index 00f0ab3..bc4dce5 100644 (file)
@@ -49,4 +49,18 @@ public class Solr extends ServiceMBeanSupport implements SolrMBean {
                        throw new JMRuntimeException(e.getMessage());
                }
        }
+
+    @Override
+    public String refreshIndex() {
+        try {
+            InitialContext ctx = new InitialContext();
+            Object ref = ctx.lookup(getConfiguration().getString("externalApiPath"));
+            ExternalAPI service = (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class);
+            return service.refreshSolrIndex();
+        } catch (ClassCastException e) {
+            throw new JMRuntimeException(e.getMessage());
+        } catch (NamingException e) {
+            throw new JMRuntimeException(e.getMessage());
+        }
+    }
 }