use of org.alfresco.solr.NodeReport in project SearchServices by Alfresco.
the class MetadataTracker method checkNode.
public NodeReport checkNode(Node node) {
NodeReport nodeReport = new NodeReport();
nodeReport.setDbid(node.getId());
nodeReport.setDbNodeStatus(node.getStatus());
nodeReport.setDbTx(node.getTxnId());
this.infoSrv.addCommonNodeReportInfo(nodeReport);
return nodeReport;
}
use of org.alfresco.solr.NodeReport in project SearchServices by Alfresco.
the class MetadataTrackerTest method testCheckNodeLong.
@Test
@Ignore("Superseded by AlfrescoSolrTrackerTest")
public void testCheckNodeLong() throws AuthenticationException, IOException, JSONException {
List<Node> nodes = getNodes();
when(repositoryClient.getNodes(any(GetNodesParameters.class), eq(1))).thenReturn(nodes);
NodeReport nodeReport = this.metadataTracker.checkNode(DB_ID);
assertNotNull(nodeReport);
assertEquals(DB_ID, nodeReport.getDbid());
assertEquals(TX_ID, nodeReport.getDbTx());
}
use of org.alfresco.solr.NodeReport in project SearchServices by Alfresco.
the class MetadataTrackerTest method testCheckNodeNode.
@Test
@Ignore("Superseded by AlfrescoSolrTrackerTest")
public void testCheckNodeNode() {
Node node = getNode();
NodeReport nodeReport = this.metadataTracker.checkNode(node);
assertNotNull(nodeReport);
assertEquals(DB_ID, nodeReport.getDbid());
assertEquals(TX_ID, nodeReport.getDbTx());
}
use of org.alfresco.solr.NodeReport in project SearchServices by Alfresco.
the class MetadataTracker method checkNode.
public NodeReport checkNode(Long dbid) {
NodeReport nodeReport = new NodeReport();
nodeReport.setDbid(dbid);
// In DB
GetNodesParameters parameters = new GetNodesParameters();
parameters.setFromNodeId(dbid);
parameters.setToNodeId(dbid);
List<Node> dbnodes;
try {
dbnodes = client.getNodes(parameters, 1);
if (dbnodes.size() == 1) {
Node dbnode = dbnodes.get(0);
nodeReport.setDbNodeStatus(dbnode.getStatus());
nodeReport.setDbTx(dbnode.getTxnId());
} else {
nodeReport.setDbNodeStatus(SolrApiNodeStatus.UNKNOWN);
nodeReport.setDbTx(-1l);
}
} catch (IOException e) {
nodeReport.setDbNodeStatus(SolrApiNodeStatus.UNKNOWN);
nodeReport.setDbTx(-2l);
} catch (JSONException e) {
nodeReport.setDbNodeStatus(SolrApiNodeStatus.UNKNOWN);
nodeReport.setDbTx(-3l);
} catch (AuthenticationException e1) {
nodeReport.setDbNodeStatus(SolrApiNodeStatus.UNKNOWN);
nodeReport.setDbTx(-4l);
}
this.infoSrv.addCommonNodeReportInfo(nodeReport);
return nodeReport;
}
Aggregations