use of com.cognizant.devops.platformdal.agentConfig.AgentConfig in project Insights by CognizantOneDevOps.
the class GraphdbCorrelationConfiguration method testRegisterAgentInDatabase.
public boolean testRegisterAgentInDatabase() throws InsightsCustomException {
List<AgentConfig> registeredAgents = getRegisteredAgents();
log.info("agent size {}", registeredAgents.size());
for (AgentConfig agentConfig : registeredAgents) {
log.info("Tool name: {}", agentConfig.getToolName());
}
if (!registeredAgents.isEmpty()) {
return true;
}
return false;
}
use of com.cognizant.devops.platformdal.agentConfig.AgentConfig in project Insights by CognizantOneDevOps.
the class GraphdbCorrelationConfiguration method testAgentIdInDatabase.
public boolean testAgentIdInDatabase(String agentId) throws InsightsCustomException {
List<AgentConfig> registeredAgents = getRegisteredAgents();
log.info("agent size {}", registeredAgents.size());
for (AgentConfig agentConfig : registeredAgents) {
if ((agentConfig.getAgentKey()).contains(agentId))
return true;
else
continue;
}
return false;
}
use of com.cognizant.devops.platformdal.agentConfig.AgentConfig in project Insights by CognizantOneDevOps.
the class AgentManagementTest method getAgentDetailsForException.
@Test(priority = 18)
public void getAgentDetailsForException() throws InsightsCustomException {
AgentConfig agentConfig = new AgentConfig();
AgentConfigDAL agentConfigDAL = new AgentConfigDAL();
AgentConfigTO agentConfigDetails = agentManagementServiceImpl.getAgentDetails(agentId);
}
use of com.cognizant.devops.platformdal.agentConfig.AgentConfig in project Insights by CognizantOneDevOps.
the class AgentManagementTest method getAgentDetails.
@Test(priority = 17)
public void getAgentDetails() throws InsightsCustomException {
AgentConfig agentConfig = new AgentConfig();
AgentConfigDAL agentConfigDAL = new AgentConfigDAL();
agentConfig = agentConfigDAL.getAgentConfigurations(agentId);
AgentConfigTO agentConfigDetails = new AgentConfigTO();
agentConfigDetails = agentManagementServiceImpl.getAgentDetails(agentId);
Assert.assertNotNull(agentConfigDetails.getAgentId());
Assert.assertEquals(agentConfigDetails.getToolCategory(), "SCM");
}
use of com.cognizant.devops.platformdal.agentConfig.AgentConfig in project Insights by CognizantOneDevOps.
the class HealthUtil method getAgentHealthQueueName.
/**
* Method to get Agent Health Queue name
*
* @param agentId
* @return String
*/
public String getAgentHealthQueueName(String agentId) {
String healthRoutingKey = null;
try {
AgentConfigDAL agentConfigDal = new AgentConfigDAL();
AgentConfig agentConfig = agentConfigDal.getAgentConfigurations(agentId);
JsonObject config = JsonUtils.parseStringAsJsonObject(agentConfig.getAgentJson());
JsonObject json = config.get("publish").getAsJsonObject();
healthRoutingKey = json.get("health").getAsString().replace(".", ":");
} catch (Exception e) {
log.error(" No DB record found for agentId {} ", agentId);
}
return healthRoutingKey;
}
Aggregations