use of com.axway.ats.agent.components.system.operations.clients.MachineDescriptionOperations in project ats-framework by Axway.
the class MachineInfoAgent method updateMachineInfo.
/**
* Retrieves static info about a machine and stores this info into the
* log DB
*
* @param atsAgent the address of the ATS Agent running on the machine of interest
* @param dbMachineName the name of the machine as it appears in the DB
* @throws Exception
*/
@PublicAtsApi
public void updateMachineInfo(@Validate(name = "atsAgent", type = ValidationType.STRING_SERVER_WITH_PORT) String atsAgent, @Validate(name = "dbMachineName", type = ValidationType.STRING_NOT_EMPTY) String dbMachineName) throws Exception {
// validate input parameters
atsAgent = HostUtils.getAtsAgentIpAndPort(atsAgent);
new Validator().validateMethodParameters(new Object[] { atsAgent, dbMachineName });
log.info("Retrieving info about " + dbMachineName + " from " + atsAgent);
MachineDescriptionOperations mm = new MachineDescriptionOperations(atsAgent);
String machineDescriptionString = mm.getDescription();
log.info("Saving retrieved info about " + dbMachineName + " into the Test Explorer database");
SQLServerDbWriteAccess dbAccess = new DbAccessFactory().getNewDbWriteAccessObject();
dbAccess.updateMachineInfo(dbMachineName, machineDescriptionString, true);
log.info("Successfully updated the info about " + dbMachineName);
}
Aggregations