use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class SystemMonitor method scheduleSystemMonitoring.
/**
* Schedule some system monitors.
* <br>No statistics collection will be triggered until the startMonitor method is called.
*
* @param monitoredHost the host to monitor
* @param systemReadingTypes what kind of data to collect. Use some of the following constants:
* <ul>
* <li>SystemMonitor.MONITOR_CPU.*
* <li>SystemMonitor.MONITOR_MEMORY.*
* <li>SystemMonitor.MONITOR_VIRTUAL_MEMORY.*
* <li>SystemMonitor.MONITOR_IO.*
* <li>SystemMonitor.MONITOR_NETWORK_INTERFACES.*
* <li>SystemMonitor.MONITOR_NETSTAT.*
* <li>SystemMonitor.MONITOR_TCP.*
* </ul>
*/
@PublicAtsApi
public void scheduleSystemMonitoring(@Validate(name = "monitoredHost", type = ValidationType.STRING_SERVER_WITH_PORT) String monitoredHost, @Validate(name = "systemReadingTypes", type = ValidationType.NOT_NULL) String[] systemReadingTypes) {
// validate input parameters
monitoredHost = HostUtils.getAtsAgentIpAndPort(monitoredHost);
new Validator().validateMethodParameters("Could not schedule monitoring system statistics on '" + monitoredHost + "'", new Object[] { monitoredHost, systemReadingTypes });
Set<FullReadingBean> readingTypes = requestedReadingTypesPerHosts.get(monitoredHost);
if (readingTypes == null) {
readingTypes = new HashSet<FullReadingBean>();
}
readingTypes.addAll(ReadingTypes.expandSystemReadings(systemReadingTypes));
requestedReadingTypesPerHosts.put(monitoredHost, readingTypes);
monitoredHosts.add(monitoredHost);
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class SystemOperations method isListening.
/**
* Check if some process is listening on some port on some host.
* Note that we cannot give the name of the listening process.
*
* @param host host address
* @param port port number
* @param timeout timeout value in milliseconds
* @return <code>true</code> if the address is listening on this port
* @throws SystemOperationException when the target host is unknown
*/
@PublicAtsApi
public boolean isListening(@Validate(name = "host", type = ValidationType.STRING_NOT_EMPTY) String host, @Validate(name = "port", type = ValidationType.NUMBER_PORT_NUMBER) int port, @Validate(name = "timeout", type = ValidationType.NUMBER_POSITIVE) int timeout) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { host, port, timeout });
// execute action
ISystemOperations operations = getOperationsImplementationFor(atsAgent);
return operations.isListening(host, port, timeout);
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class RegistryOperations method setLongValue.
/**
* Applies a Long(REG_QWORD) value on the specified key.
*
* The key will be created if does not exist.
* The key type will be changed if needed.
*
* @param keyPath path to the key
* @param keyName name of the key
* @param keyValue the new key value
*/
@PublicAtsApi
public void setLongValue(@Validate(name = "keyPath", type = ValidationType.STRING_NOT_EMPTY) String keyPath, @Validate(name = "keyName", type = ValidationType.STRING_NOT_EMPTY) String keyName, @Validate(name = "keyValue", type = ValidationType.NONE) long keyValue) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { keyPath, keyName, keyValue });
registryOperationsImpl.setLongValue(rootKey, keyPath, keyName, keyValue);
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class RegistryOperations method setBinaryValue.
/**
* Applies a Binary(REG_BINARY) value on the specified key.
*
* The key will be created if does not exist.
* The key type will be changed if needed.
*
* @param keyPath path to the key
* @param keyName name of the key
* @param keyValue the new key value
*/
@PublicAtsApi
public void setBinaryValue(@Validate(name = "keyPath", type = ValidationType.STRING_NOT_EMPTY) String keyPath, @Validate(name = "keyName", type = ValidationType.STRING_NOT_EMPTY) String keyName, @Validate(name = "keyValue", type = ValidationType.NOT_NULL) byte[] keyValue) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { keyPath, keyName, keyValue });
registryOperationsImpl.setBinaryValue(rootKey, keyPath, keyName, keyValue);
}
use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.
the class RegistryOperations method setStringValue.
/**
* Applies a String(REG_SZ) value on the specified key.
*
* The key will be created if does not exist.
* The key type will be changed if needed.
*
* @param keyPath path to the key
* @param keyName name of the key
* @param keyValue the new key value
*/
@PublicAtsApi
public void setStringValue(@Validate(name = "keyPath", type = ValidationType.STRING_NOT_EMPTY) String keyPath, @Validate(name = "keyName", type = ValidationType.STRING_NOT_EMPTY) String keyName, @Validate(name = "keyValue", type = ValidationType.NOT_NULL) String keyValue) {
// validate input parameters
new Validator().validateMethodParameters(new Object[] { keyPath, keyName, keyValue });
registryOperationsImpl.setStringValue(rootKey, keyPath, keyName, keyValue);
}
Aggregations