Removed an unnecessary method that cheched the existance of a user's full name in...
[pithos] / src / gr / ebs / gss / mbeans / Solr.java
index a6a2003..bc4dce5 100644 (file)
@@ -37,16 +37,30 @@ import org.jboss.system.ServiceMBeanSupport;
 public class Solr extends ServiceMBeanSupport implements SolrMBean {
 
        @Override
-       public void rebuildIndex() {
+       public String rebuildIndex() {
                try {
                        InitialContext ctx = new InitialContext();
                        Object ref = ctx.lookup(getConfiguration().getString("externalApiPath"));
                        ExternalAPI service = (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class);
-                       service.rebuildSolrIndex();
+                       return service.rebuildSolrIndex();
                } catch (ClassCastException e) {
                        throw new JMRuntimeException(e.getMessage());
                } catch (NamingException e) {
                        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());
+        }
+    }
 }