本文整理汇总了Java中com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder.setProxyPassword方法的典型用法代码示例。如果您正苦于以下问题:Java HubServerConfigBuilder.setProxyPassword方法的具体用法?Java HubServerConfigBuilder.setProxyPassword怎么用?Java HubServerConfigBuilder.setProxyPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder
的用法示例。
在下文中一共展示了HubServerConfigBuilder.setProxyPassword方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHubServerConfig
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
/**
* Build the Hub Server information for connection
*
* @return
*/
private static HubServerConfig getHubServerConfig(PropertyConstants propertyConstants) {
HubServerConfigBuilder builder = new HubServerConfigBuilder();
builder.setHubUrl(propertyConstants.getHubServerUrl());
builder.setUsername(propertyConstants.getHubUserName());
builder.setPassword(propertyConstants.getHubPassword());
builder.setTimeout(propertyConstants.getHubTimeout());
if (propertyConstants.getHubProxyHost() != null && !"".equalsIgnoreCase(propertyConstants.getHubProxyHost())) {
logger.info("Inside Proxy settings::" + propertyConstants.getHubProxyHost() + "::");
builder.setProxyHost(propertyConstants.getHubProxyHost());
builder.setProxyPort(propertyConstants.getHubProxyPort());
builder.setProxyUsername(propertyConstants.getHubProxyUser());
builder.setProxyPassword(propertyConstants.getHubPassword());
builder.setIgnoredProxyHosts(propertyConstants.getHubProxyNoHost());
}
return builder.build();
}
开发者ID:blackducksoftware,项目名称:hub-fortify-ssc-integration-service,代码行数:24,代码来源:RestConnectionHelper.java
示例2: getHubServerConfigBuilderFromRequest
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
private HubServerConfigBuilder getHubServerConfigBuilderFromRequest(final HttpServletRequest request) throws IllegalArgumentException, EncryptionException {
final HubServerConfigBuilder serverConfigBuilder = new HubServerConfigBuilder();
serverConfigBuilder.setHubUrl(request.getParameter("hubUrl"));
serverConfigBuilder.setTimeout(request.getParameter("hubTimeout"));
serverConfigBuilder.setUsername(request.getParameter("hubUser"));
String hubPass = getDecryptedWebPassword(request.getParameter("encryptedHubPass"));
if (isPasswordAstericks(hubPass) && configPersistenceManager.getHubServerConfig() != null && configPersistenceManager.getHubServerConfig().getGlobalCredentials() != null) {
hubPass = configPersistenceManager.getHubServerConfig().getGlobalCredentials().getDecryptedPassword();
}
serverConfigBuilder.setPassword(hubPass);
serverConfigBuilder.setAutoImportHttpsCertificates(Boolean.valueOf(request.getParameter("autoImportHttpsCertificates")));
serverConfigBuilder.setProxyHost(request.getParameter("hubProxyServer"));
serverConfigBuilder.setProxyPort(request.getParameter("hubProxyPort"));
serverConfigBuilder.setIgnoredProxyHosts(request.getParameter("hubNoProxyHost"));
serverConfigBuilder.setProxyUsername(request.getParameter("hubProxyUser"));
String proxyPass = getDecryptedWebPassword(request.getParameter("encryptedHubProxyPass"));
if (isPasswordAstericks(proxyPass) && configPersistenceManager.getHubServerConfig() != null && configPersistenceManager.getHubServerConfig().getProxyInfo() != null) {
proxyPass = configPersistenceManager.getHubServerConfig().getProxyInfo().getDecryptedPassword();
}
serverConfigBuilder.setProxyPassword(proxyPass);
return serverConfigBuilder;
}
示例3: 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;
}
示例4: createHubConfig
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
public HubServerConfig createHubConfig(final String hubUri) {
try {
final HubServerConfigBuilder configBuilder = new HubServerConfigBuilder();
configBuilder.setHubUrl(hubUri);
// using oauth the username and password aren't used but need to be set
// for the builder
configBuilder.setUsername("auser");
configBuilder.setPassword("apassword");
configBuilder.setTimeout(extensionProperties.getHubServerTimeout());
configBuilder.setProxyHost(extensionProperties.getHubProxyHost());
configBuilder.setProxyPort(extensionProperties.getHubProxyPort());
configBuilder.setIgnoredProxyHosts(extensionProperties.getHubProxyNoHost());
configBuilder.setProxyUsername(extensionProperties.getHubProxyUser());
configBuilder.setProxyPassword(extensionProperties.getHubProxyPassword());
configBuilder.setAlwaysTrustServerCertificate(alwaysTrustServerCertificate);
final HubServerConfig config = configBuilder.build();
// output the configuration details
logger.info("Hub Server URL = " + config.getHubUrl());
logger.info("Hub Timeout = " + config.getTimeout());
return config;
} catch (final IllegalStateException ex) {
logger.error("Error with the hub configuration", ex);
}
return null;
}
示例5: 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();
}
示例6: getHubServerConfigBuilder
import com.blackducksoftware.integration.hub.builder.HubServerConfigBuilder; //导入方法依赖的package包/类
public HubServerConfigBuilder getHubServerConfigBuilder() {
final HubServerConfigBuilder hubServerConfigBuilder = new HubServerConfigBuilder();
hubServerConfigBuilder.setHubUrl(getHubUrl());
hubServerConfigBuilder.setUsername(getHubUsername());
hubServerConfigBuilder.setPassword(getHubPassword());
hubServerConfigBuilder.setTimeout(getHubTimeout());
hubServerConfigBuilder.setProxyHost(getHubProxyHost());
hubServerConfigBuilder.setProxyPort(getHubProxyPort());
hubServerConfigBuilder.setIgnoredProxyHosts(getHubNoProxyHosts());
hubServerConfigBuilder.setProxyUsername(getHubProxyUsername());
hubServerConfigBuilder.setProxyPassword(getHubProxyPassword());
return hubServerConfigBuilder;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}