Search in sources :

Example 1 with ArtifactsManager

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();
}
Also used : ArtifactsManager(org.wso2.ei.dashboard.core.rest.delegates.ArtifactsManager) MiArtifactsManager(org.wso2.ei.dashboard.micro.integrator.MiArtifactsManager)

Example 2 with ArtifactsManager

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;
}
Also used : ArtifactsManager(org.wso2.ei.dashboard.core.rest.delegates.ArtifactsManager) MiArtifactsManager(org.wso2.ei.dashboard.micro.integrator.MiArtifactsManager) Ack(org.wso2.ei.dashboard.core.rest.model.Ack)

Aggregations

ArtifactsManager (org.wso2.ei.dashboard.core.rest.delegates.ArtifactsManager)2 MiArtifactsManager (org.wso2.ei.dashboard.micro.integrator.MiArtifactsManager)2 Ack (org.wso2.ei.dashboard.core.rest.model.Ack)1