use of org.wso2.ei.dashboard.core.rest.delegates.ArtifactsManager in project product-mi-tooling by wso2.
the class HeartBeatDelegate method deleteAllNodeData.
private void deleteAllNodeData(String productName, HeartbeatObject heartbeat) {
logger.info("Deleting all artifacts and server information in node : " + heartbeat.getNodeId() + " in group: " + heartbeat.getGroupId());
ArtifactsManager artifactsManager = getArtifactManager(productName, heartbeat);
artifactsManager.runDeleteAllExecutorService();
}
use of org.wso2.ei.dashboard.core.rest.delegates.ArtifactsManager in project product-mi-tooling by wso2.
the class HeartBeatDelegate method processHeartbeat.
public Ack processHeartbeat(HeartbeatRequest heartbeatRequest) throws ManagementApiException {
long currentTimestamp = System.currentTimeMillis();
Ack ack = new Ack(Constants.FAIL_STATUS);
HeartbeatObject heartbeat = new HeartbeatObject(heartbeatRequest.getProduct(), heartbeatRequest.getGroupId(), heartbeatRequest.getNodeId(), heartbeatRequest.getInterval(), heartbeatRequest.getMgtApiUrl(), currentTimestamp, heartbeatRequest.getChangeNotification().getDeployedArtifacts(), heartbeatRequest.getChangeNotification().getUndeployedArtifacts());
boolean isSuccess;
String productName = heartbeat.getProduct();
ArtifactsManager artifactsManager = getArtifactManager(productName, heartbeat);
if (isNodeRegistered(heartbeat)) {
isSuccess = updateHeartbeat(heartbeat);
artifactsManager.runUpdateExecutorService();
} else {
isSuccess = registerNode(heartbeat);
if (isSuccess) {
artifactsManager.runFetchAllExecutorService();
}
}
runHeartbeatExecutorService(productName, heartbeat);
if (isSuccess) {
ack.setStatus(Constants.SUCCESS_STATUS);
}
return ack;
}
Aggregations