mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added exception propagation and removed unused code
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29335 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -186,40 +186,8 @@ public class SOLRAdminClient implements ApplicationEventPublisherAware
|
|||||||
cores = new ArrayList<String>(5);
|
cores = new ArrayList<String>(5);
|
||||||
|
|
||||||
setupTimer();
|
setupTimer();
|
||||||
//
|
|
||||||
// pingSolr();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected List<String> getCores()
|
|
||||||
// {
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// List<String> cores = new ArrayList<String>(2);
|
|
||||||
//
|
|
||||||
// ModifiableSolrParams params = new ModifiableSolrParams();
|
|
||||||
// params.set("qt", "/admin/cores");
|
|
||||||
// params.set("action", "STATUS");
|
|
||||||
//
|
|
||||||
// QueryResponse response = query(params);
|
|
||||||
//
|
|
||||||
// NamedList<Object> results = response.getResponse();
|
|
||||||
// NamedList<Object> report = (NamedList<Object>)results.get("status");
|
|
||||||
// Iterator<Map.Entry<String, Object>> coreIterator = report.iterator();
|
|
||||||
// while(coreIterator.hasNext())
|
|
||||||
// {
|
|
||||||
// Map.Entry<String, Object> core = coreIterator.next();
|
|
||||||
// cores.add(core.getKey());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return cores;
|
|
||||||
// }
|
|
||||||
// catch(SolrServerException e)
|
|
||||||
// {
|
|
||||||
// setSolrActive(false);
|
|
||||||
// return Collections.emptyList();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
protected void pingSolr()
|
protected void pingSolr()
|
||||||
{
|
{
|
||||||
ModifiableSolrParams params = new ModifiableSolrParams();
|
ModifiableSolrParams params = new ModifiableSolrParams();
|
||||||
@@ -230,7 +198,8 @@ public class SOLRAdminClient implements ApplicationEventPublisherAware
|
|||||||
if(response != null && response.getStatus() == 0)
|
if(response != null && response.getStatus() == 0)
|
||||||
{
|
{
|
||||||
NamedList<Object> results = response.getResponse();
|
NamedList<Object> results = response.getResponse();
|
||||||
NamedList<Object> report = (NamedList<Object>)results.get("status");
|
@SuppressWarnings("unchecked")
|
||||||
|
NamedList<Object> report = (NamedList<Object>)results.get("status");
|
||||||
Iterator<Map.Entry<String, Object>> coreIterator = report.iterator();
|
Iterator<Map.Entry<String, Object>> coreIterator = report.iterator();
|
||||||
List<String> cores = new ArrayList<String>(report.size());
|
List<String> cores = new ArrayList<String>(report.size());
|
||||||
while(coreIterator.hasNext())
|
while(coreIterator.hasNext())
|
||||||
@@ -321,7 +290,7 @@ public class SOLRAdminClient implements ApplicationEventPublisherAware
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Unable to set up SOLRTracker timer");
|
throw new AlfrescoRuntimeException("Unable to set up SOLRTracker timer", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user