本文整理汇总了Java中com.appdynamics.TaskInputArgs类的典型用法代码示例。如果您正苦于以下问题:Java TaskInputArgs类的具体用法?Java TaskInputArgs怎么用?Java TaskInputArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskInputArgs类属于com.appdynamics包,在下文中一共展示了TaskInputArgs类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHttpConfigMap
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private Map<String, String> createHttpConfigMap() {
Map<String,String> map = new HashMap<String, String>();
Proxy proxy = this.config.getProxy();
if(proxy != null) {
if (!Strings.isNullOrEmpty(proxy.getHost())) {
map.put(TaskInputArgs.PROXY_HOST, proxy.getHost());
}
if (!Strings.isNullOrEmpty(proxy.getPort())) {
map.put(TaskInputArgs.PROXY_PORT, proxy.getPort());
}
if (!Strings.isNullOrEmpty(proxy.getUri())) {
map.put(TaskInputArgs.PROXY_URI, proxy.getUri());
}
if (!Strings.isNullOrEmpty(proxy.getUsername())) {
map.put(TaskInputArgs.PROXY_USER, proxy.getUsername());
// Don't put any password if not specified
if (!Strings.isNullOrEmpty(proxy.getPassword())) {
map.put(TaskInputArgs.PROXY_PASSWORD, proxy.getPassword());
}
}
}
return map;
}
示例2: printStats
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private void printStats(Map<String, String> taskArguments, Map<Integer, String> proxiesToBeMonitored, Map<Integer, String> proxyTypes) {
List<String> excludedStats = new ArrayList<String>();
if (taskArguments.containsKey("excludeStats") && !Strings.isNullOrEmpty(taskArguments.get("excludeStats"))) {
excludedStats = Arrays.asList(taskArguments.get("excludeStats").split(","));
}
// Prints metrics to Controller Metric Browser
metricPrefix = taskArguments.get(TaskInputArgs.METRIC_PREFIX) + METRIC_SEPARATOR;
for (Map.Entry<Integer, String> proxy : proxiesToBeMonitored.entrySet()) {
if (!excludedStats.contains("status")) {
printMetric(proxy.getValue() + METRIC_SEPARATOR + proxyTypes.get(proxy.getKey()) + METRIC_SEPARATOR, "status", getStatus(proxy.getKey()));
}
String healthCheckStatus = getHealthCheckStatus(proxy.getKey());
if (!excludedStats.contains("check_status") && !"".equals(healthCheckStatus)) {
printMetric(proxy.getValue() + METRIC_SEPARATOR + proxyTypes.get(proxy.getKey()) + METRIC_SEPARATOR, "check_status", healthCheckStatus);
}
for (Entry<String, String> cols : colNameWithDesc.entrySet()) {
if (!excludedStats.contains(cols.getKey())) {
printMetric(proxy, proxyTypes, cols.getKey(), cols.getValue());
}
}
}
}
示例3: decryptIfEncrypted
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String decryptIfEncrypted(String nonEncryptedString, String encryptedString, String encryptionKey) {
Map<String, String> map = new HashMap<String, String>();
if (nonEncryptedString != null) {
logger.debug("Using the provided non encrypted value");
map.put(TaskInputArgs.PASSWORD, nonEncryptedString);
}
if (encryptedString != null) {
logger.debug("Decrypting the value...");
map.put(TaskInputArgs.PASSWORD_ENCRYPTED, encryptedString);
map.put(TaskInputArgs.ENCRYPTION_KEY, encryptionKey);
}
String decryptedValue = CryptoUtil.getPassword(map);
return decryptedValue;
}
开发者ID:Appdynamics,项目名称:azure-servicebus-monitoring-extension,代码行数:20,代码来源:AzureServiceBusMonitoringTask.java
示例4: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword(String password, String encryptedPassword, String encryptionKey) {
if (!Strings.isNullOrEmpty(password)) {
return password;
}
try {
Map<String, String> args = Maps.newHashMap();
args.put(TaskInputArgs.PASSWORD_ENCRYPTED, encryptedPassword);
args.put(TaskInputArgs.ENCRYPTION_KEY, encryptionKey);
return CryptoUtil.getPassword(args);
} catch (IllegalArgumentException e) {
String msg = "Encryption Key not specified. Please set the value in config.yaml.";
logger.error(msg);
throw new IllegalArgumentException(msg);
}
}
示例5: createHttpConfigMap
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private Map createHttpConfigMap() {
Map map = new HashMap();
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
map.put("servers", list);
HashMap<String, String> server = new HashMap<String, String>();
server.put(TaskInputArgs.URI, config.getDomain());
server.put(TaskInputArgs.USER, config.getUsername());
server.put(TaskInputArgs.PASSWORD, getPassword(config.getPassword(), config.getEncryptedPassword()));
list.add(server);
Map connectionProps = new HashMap();
connectionProps.put("socketTimeout", config.getSocketTimeout());
connectionProps.put("connectTimeout", config.getConnectTimeout());
map.put("connection", connectionProps);
HashMap proxyProps = new HashMap();
if(config.getProxy() != null) {
Proxy proxy = config.getProxy();
proxyProps.put(TaskInputArgs.URI, proxy.getUri());
proxyProps.put(TaskInputArgs.USER, proxy.getUser());
proxyProps.put(TaskInputArgs.PASSWORD, getPassword(proxy.getPassword(), proxy.getEncryptedPassword()));
map.put("proxy", proxyProps);
}
return map;
}
示例6: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword(String password, String passwordEncrypted) {
Map<String, String> map = new HashMap<String, String>();
if (password != null) {
logger.debug("Using provided password");
map.put(TaskInputArgs.PASSWORD, password);
}
if (passwordEncrypted != null) {
logger.debug("Using provided passwordEncrypted");
map.put(TaskInputArgs.PASSWORD_ENCRYPTED, passwordEncrypted);
map.put(TaskInputArgs.ENCRYPTION_KEY, config.getEncryptionKey());
}
String plainPassword = CryptoUtil.getPassword(map);
return plainPassword;
}
示例7: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword(Map<String, ?> config) {
String password = null;
if (!Strings.isNullOrEmpty((String) config.get("password"))) {
password = (String) config.get("password");
} else {
try {
Map<String, String> args = Maps.newHashMap();
args.put(TaskInputArgs.PASSWORD_ENCRYPTED, (String) config.get("encryptedPassword"));
args.put(TaskInputArgs.ENCRYPTION_KEY, (String) config.get("encryptionKey"));
password = CryptoUtil.getPassword(args);
} catch (IllegalArgumentException e) {
String msg = "Encryption Key not specified. Please set the value in config.yaml.";
logger.error(msg);
throw new IllegalArgumentException(msg);
}
}
return password;
}
示例8: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword() {
String password = null;
if (StringUtils.isNotBlank(varnish.getPassword())) {
password = varnish.getPassword();
} else {
try {
Map<String, String> args = Maps.newHashMap();
args.put(TaskInputArgs.PASSWORD_ENCRYPTED, varnish.getPasswordEncrypted());
args.put(TaskInputArgs.ENCRYPTION_KEY, varnish.getEncryptionKey());
password = CryptoUtil.getPassword(args);
} catch (IllegalArgumentException e) {
String msg = "Encryption Key not specified. Please set the value in config.yaml.";
logger.error(msg);
throw new IllegalArgumentException(msg);
}
}
return password;
}
示例9: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword(Map server) {
String password = convertToString(server.get(PASSWORD), "");
if (!Strings.isNullOrEmpty(password)) {
return password;
}
String encryptionKey = convertToString(configuration.getConfigYml().get(ConfigConstants.ENCRYPTION_KEY), "");
String encryptedPassword = convertToString(server.get(ENCRYPTED_PASSWORD), "");
if (!Strings.isNullOrEmpty(encryptionKey) && !Strings.isNullOrEmpty(encryptedPassword)) {
Map<String, String> cryptoMap = Maps.newHashMap();
cryptoMap.put(PASSWORD_ENCRYPTED, encryptedPassword);
cryptoMap.put(TaskInputArgs.ENCRYPTION_KEY, encryptionKey);
return CryptoUtil.getPassword(cryptoMap);
}
return null;
}
示例10: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword (Map server) {
String password = convertToString(server.get("password"), "");
if (!Strings.isNullOrEmpty(password)) {
return password;
}
String encryptionKey = convertToString(configuration.getConfigYml().get("encryptionKey"), "");
String encryptedPassword = convertToString(server.get("encryptedPassword"), "");
if (!Strings.isNullOrEmpty(encryptionKey) && !Strings.isNullOrEmpty(encryptedPassword)) {
java.util.Map<String, String> cryptoMap = Maps.newHashMap();
cryptoMap.put(PASSWORD_ENCRYPTED, encryptedPassword);
cryptoMap.put(TaskInputArgs.ENCRYPTION_KEY, encryptionKey);
return CryptoUtil.getPassword(cryptoMap);
}
return null;
}
示例11: getPassword
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private String getPassword(Map server) {
String password = convertToString(server.get("password"), "");
if (!Strings.isNullOrEmpty(password)) {
return password;
}
String encryptionKey = convertToString(configuration.getConfigYml().get("encryptionKey"), "");
String encryptedPassword = convertToString(server.get("encryptedPassword"), "");
if (!Strings.isNullOrEmpty(encryptionKey) && !Strings.isNullOrEmpty(encryptedPassword)) {
java.util.Map<String, String> cryptoMap = Maps.newHashMap();
cryptoMap.put(PASSWORD_ENCRYPTED, encryptedPassword);
cryptoMap.put(TaskInputArgs.ENCRYPTION_KEY, encryptionKey);
return CryptoUtil.getPassword(cryptoMap);
}
return null;
}
示例12: createHttpConfigMap
import com.appdynamics.TaskInputArgs; //导入依赖的package包/类
private Map<String, String> createHttpConfigMap() {
Map<String,String> map = new HashMap<String, String>();
if(isSSLEnabled()) {
map.put("use-ssl", "true");
}
if(this.config.getProxy() != null) {
if (!Strings.isNullOrEmpty(this.config.getProxy().getHost())) {
map.put(TaskInputArgs.PROXY_HOST, this.config.getProxy().getHost());
}
if (!Strings.isNullOrEmpty(this.config.getProxy().getPort())) {
map.put(TaskInputArgs.PROXY_PORT, this.config.getProxy().getPort());
}
if (!Strings.isNullOrEmpty(this.config.getProxy().getUri())) {
map.put(TaskInputArgs.PROXY_URI, this.config.getProxy().getUri());
}
if (!Strings.isNullOrEmpty(this.config.getProxy().getUser())) {
map.put(TaskInputArgs.PROXY_USER, this.config.getProxy().getUser());
// Don't put any password if not specified
if (!Strings.isNullOrEmpty(this.config.getProxy().getPassword())) {
map.put(TaskInputArgs.PROXY_PASSWORD, this.config.getProxy().getPassword());
} else if (!Strings.isNullOrEmpty(this.config.getProxy().getPasswordEncrypted())) {
map.put(TaskInputArgs.PROXY_PASSWORD_ENCRYPTED, this.config.getProxy().getPasswordEncrypted());
}
}
}
return map;
}