本文整理汇总了Java中com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder.setProxyPasswordLength方法的典型用法代码示例。如果您正苦于以下问题:Java HubServerConfigBuilder.setProxyPasswordLength方法的具体用法?Java HubServerConfigBuilder.setProxyPasswordLength怎么用?Java HubServerConfigBuilder.setProxyPasswordLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder
的用法示例。
在下文中一共展示了HubServerConfigBuilder.setProxyPasswordLength方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHubServerConfigBuilder
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
public HubServerConfigBuilder createHubServerConfigBuilder() {
final HubServerConfigBuilder hubConfigBuilder = new HubServerConfigBuilder();
hubConfigBuilder.setHubUrl(hubUrl);
hubConfigBuilder.setUsername(hubUsername);
hubConfigBuilder.setPassword(hubPasswordEncrypted);
hubConfigBuilder.setPasswordLength(NumberUtils.toInt(hubPasswordLength));
hubConfigBuilder.setTimeout(hubTimeoutString);
hubConfigBuilder.setProxyHost(hubProxyHost);
hubConfigBuilder.setProxyPort(hubProxyPort);
hubConfigBuilder.setIgnoredProxyHosts(hubProxyNoHost);
hubConfigBuilder.setProxyUsername(hubProxyUser);
hubConfigBuilder.setProxyPassword(hubProxyPassEncrypted);
hubConfigBuilder.setProxyPasswordLength(NumberUtils.toInt(hubProxyPassLength));
return hubConfigBuilder;
}
示例2: buildConfigFromStrings
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
public HubServerConfig buildConfigFromStrings(final String hubUrl,
final String hubUser, final String hubPass, final String hubPassLength,
final String hubImportSSLCerts, final String hubProxyUrl,
final String hubProxyPort, final String hubProxyNoHost, final String hubProxyUser,
final String hubProxyPass, final String hubProxyPassLength) {
final HubServerConfigBuilder configBuilder = new HubServerConfigBuilder();
configBuilder.setHubUrl(hubUrl);
configBuilder.setUsername(hubUser);
configBuilder.setPassword(hubPass);
configBuilder.setProxyHost(hubProxyUrl);
configBuilder.setProxyPort(hubProxyPort);
configBuilder.setProxyUsername(hubProxyUser);
configBuilder.setIgnoredProxyHosts(hubProxyNoHost);
int length = 0;
if (StringUtils.isNotBlank(hubPassLength)) {
length = Integer.valueOf(hubPassLength);
configBuilder.setPasswordLength(length);
}
if (StringUtils.isNotBlank(hubProxyUser)) {
configBuilder.setProxyPassword(hubProxyPass);
if (StringUtils.isNotBlank(hubProxyPassLength)) {
length = Integer.valueOf(hubProxyPassLength);
configBuilder.setProxyPasswordLength(length);
}
}
if (StringUtils.isNotBlank(hubImportSSLCerts)) {
configBuilder.setAutoImportHttpsCertificates(Boolean.valueOf(hubImportSSLCerts));
}
return configBuilder.build();
}
示例3: setConfigBuilderFromSerializableConfig
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
private HubServerConfigBuilder setConfigBuilderFromSerializableConfig(final HubServerConfigSerializable config,
final PluginSettings settings) {
final HubServerConfigBuilder serverConfigBuilder = new HubServerConfigBuilder();
serverConfigBuilder.setHubUrl(config.getHubUrl());
serverConfigBuilder.setTimeout(config.getTimeout());
serverConfigBuilder.setUsername(config.getUsername());
if (StringUtils.isBlank(config.getPassword())) {
serverConfigBuilder.setPassword(null);
serverConfigBuilder.setPasswordLength(0);
} else if (StringUtils.isNotBlank(config.getPassword()) && !config.isPasswordMasked()) {
serverConfigBuilder.setPassword(config.getPassword());
serverConfigBuilder.setPasswordLength(0);
} else {
serverConfigBuilder.setPassword(getValue(settings, HubConfigKeys.CONFIG_HUB_PASS));
serverConfigBuilder
.setPasswordLength(NumberUtils.toInt(getValue(settings, HubConfigKeys.CONFIG_HUB_PASS_LENGTH)));
}
serverConfigBuilder.setProxyHost(config.getHubProxyHost());
serverConfigBuilder.setProxyPort(config.getHubProxyPort());
serverConfigBuilder.setIgnoredProxyHosts(config.getHubNoProxyHosts());
serverConfigBuilder.setProxyUsername(config.getHubProxyUser());
if (StringUtils.isBlank(config.getHubProxyPassword())) {
serverConfigBuilder.setProxyPassword(null);
serverConfigBuilder.setProxyPasswordLength(0);
} else if (StringUtils.isNotBlank(config.getHubProxyPassword()) && !config.isProxyPasswordMasked()) {
// only update the stored password if it is not the masked
// password used for display
serverConfigBuilder.setProxyPassword(config.getHubProxyPassword());
serverConfigBuilder.setProxyPasswordLength(0);
} else {
serverConfigBuilder.setProxyPassword(getValue(settings, HubConfigKeys.CONFIG_PROXY_PASS));
serverConfigBuilder.setProxyPasswordLength(
NumberUtils.toInt(getValue(settings, HubConfigKeys.CONFIG_PROXY_PASS_LENGTH)));
}
return serverConfigBuilder;
}
示例4: getHubServerConfig
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
private HubServerConfig getHubServerConfig(final IntLogger logger, final CIEnvironmentVariables commonVariables) {
final HubServerConfigBuilder configBuilder = new HubServerConfigBuilder();
// read the credentials and proxy info using the existing objects.
final String serverUrl = commonVariables.getValue(HubConstantValues.HUB_URL);
final String timeout = commonVariables.getValue(HubConstantValues.HUB_CONNECTION_TIMEOUT);
final String username = commonVariables.getValue(HubConstantValues.HUB_USERNAME);
final String password = commonVariables.getValue(HubConstantValues.HUB_PASSWORD);
final String passwordLength = commonVariables.getValue(HubConstantValues.HUB_PASSWORD_LENGTH);
final String autoImportHttpsCertificates = commonVariables.getValue(HubConstantValues.HUB_IMPORT_SSL_CERT);
final String proxyHost = commonVariables.getValue(HubConstantValues.HUB_PROXY_HOST);
final String proxyPort = commonVariables.getValue(HubConstantValues.HUB_PROXY_PORT);
final String ignoredProxyHosts = commonVariables.getValue(HubConstantValues.HUB_NO_PROXY_HOSTS);
final String proxyUsername = commonVariables.getValue(HubConstantValues.HUB_PROXY_USER);
final String proxyPassword = commonVariables.getValue(HubConstantValues.HUB_PROXY_PASS);
final String proxyPasswordLength = commonVariables.getValue(HubConstantValues.HUB_PROXY_PASS_LENGTH);
configBuilder.setHubUrl(serverUrl);
configBuilder.setUsername(username);
configBuilder.setPassword(password);
configBuilder.setPasswordLength(NumberUtils.toInt(passwordLength));
configBuilder.setTimeout(timeout);
configBuilder.setAutoImportHttpsCertificates(Boolean.valueOf(autoImportHttpsCertificates));
configBuilder.setProxyHost(proxyHost);
configBuilder.setProxyPort(proxyPort);
configBuilder.setIgnoredProxyHosts(ignoredProxyHosts);
configBuilder.setProxyUsername(proxyUsername);
configBuilder.setProxyPassword(proxyPassword);
configBuilder.setProxyPasswordLength(NumberUtils.toInt(proxyPasswordLength));
try {
return configBuilder.build();
} catch (final IllegalStateException e) {
logger.error(e.getMessage(), e);
}
return null;
}
示例5: setConfigBuilderFromSerializableConfig
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
private HubServerConfigBuilder setConfigBuilderFromSerializableConfig(final HubServerConfigSerializable config,
final PluginSettings settings) {
final HubServerConfigBuilder serverConfigBuilder = new HubServerConfigBuilder();
serverConfigBuilder.setHubUrl(config.getHubUrl());
serverConfigBuilder.setTimeout(config.getTimeout());
serverConfigBuilder.setUsername(config.getUsername());
if (StringUtils.isBlank(config.getPassword())) {
serverConfigBuilder.setPassword(null);
serverConfigBuilder.setPasswordLength(0);
} else if (StringUtils.isNotBlank(config.getPassword()) && !config.isPasswordMasked()) {
serverConfigBuilder.setPassword(config.getPassword());
serverConfigBuilder.setPasswordLength(0);
} else {
serverConfigBuilder.setPassword(getValue(settings, HubConfigKeys.CONFIG_HUB_PASS));
serverConfigBuilder
.setPasswordLength(NumberUtils.toInt(getValue(settings, HubConfigKeys.CONFIG_HUB_PASS_LENGTH)));
}
if (config.getImportSSLCerts() != null) {
serverConfigBuilder.setAutoImportHttpsCertificates(config.getImportSSLCerts());
}
serverConfigBuilder.setProxyHost(config.getHubProxyHost());
serverConfigBuilder.setProxyPort(config.getHubProxyPort());
serverConfigBuilder.setIgnoredProxyHosts(config.getHubNoProxyHosts());
serverConfigBuilder.setProxyUsername(config.getHubProxyUser());
if (StringUtils.isBlank(config.getHubProxyPassword())) {
serverConfigBuilder.setProxyPassword(null);
serverConfigBuilder.setProxyPasswordLength(0);
} else if (StringUtils.isNotBlank(config.getHubProxyPassword()) && !config.isProxyPasswordMasked()) {
// only update the stored password if it is not the masked
// password used for display
serverConfigBuilder.setProxyPassword(config.getHubProxyPassword());
serverConfigBuilder.setProxyPasswordLength(0);
} else {
serverConfigBuilder.setProxyPassword(getValue(settings, HubConfigKeys.CONFIG_PROXY_PASS));
serverConfigBuilder.setProxyPasswordLength(
NumberUtils.toInt(getValue(settings, HubConfigKeys.CONFIG_PROXY_PASS_LENGTH)));
}
return serverConfigBuilder;
}