Search in sources :

Example 1 with Validator

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);
}
Also used : ISystemOperations(com.axway.ats.core.system.model.ISystemOperations) Validator(com.axway.ats.core.validation.Validator) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 2 with Validator

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);
}
Also used : Validator(com.axway.ats.core.validation.Validator) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 3 with Validator

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);
}
Also used : Validator(com.axway.ats.core.validation.Validator) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 4 with Validator

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);
}
Also used : Validator(com.axway.ats.core.validation.Validator) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 5 with Validator

use of com.axway.ats.core.validation.Validator in project ats-framework by Axway.

the class RegistryOperations method setIntValue.

/**
     * Applies a Integer(REG_DWORD) 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 setIntValue(@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) int keyValue) {
    // validate input parameters
    new Validator().validateMethodParameters(new Object[] { keyPath, keyName, keyValue });
    registryOperationsImpl.setIntValue(rootKey, keyPath, keyName, keyValue);
}
Also used : Validator(com.axway.ats.core.validation.Validator) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

Validator (com.axway.ats.core.validation.Validator)67 PublicAtsApi (com.axway.ats.common.PublicAtsApi)66 IFileSystemOperations (com.axway.ats.core.filesystem.model.IFileSystemOperations)45 LocalFileSystemOperations (com.axway.ats.core.filesystem.LocalFileSystemOperations)6 ISystemOperations (com.axway.ats.core.system.model.ISystemOperations)4 FullReadingBean (com.axway.ats.common.performance.monitor.beans.FullReadingBean)3 MachineDescriptionOperations (com.axway.ats.agent.components.monitoring.operations.clients.MachineDescriptionOperations)1 InternalProcessOperations (com.axway.ats.agent.components.system.operations.clients.InternalProcessOperations)1 AgentException (com.axway.ats.agent.core.exceptions.AgentException)1 FileMatchInfo (com.axway.ats.common.filesystem.FileMatchInfo)1 ProcessExecutorException (com.axway.ats.common.process.ProcessExecutorException)1 DbAccessFactory (com.axway.ats.log.autodb.DbAccessFactory)1 DbWriteAccess (com.axway.ats.log.autodb.DbWriteAccess)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1