本文整理汇总了Java中com.sforce.ws.ConnectorConfig.setProxyUsername方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectorConfig.setProxyUsername方法的具体用法?Java ConnectorConfig.setProxyUsername怎么用?Java ConnectorConfig.setProxyUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sforce.ws.ConnectorConfig
的用法示例。
在下文中一共展示了ConnectorConfig.setProxyUsername方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProxy
import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private synchronized void setProxy(ConnectorConfig config) {
final ProxyPropertiesRuntimeHelper proxyHelper = new ProxyPropertiesRuntimeHelper(
properties.getConnectionProperties().proxy);
resetAuthenticator();
if (proxyHelper.getProxyHost() != null) {
if (proxyHelper.getSocketProxy() != null) {
config.setProxy(proxyHelper.getSocketProxy());
} else {
config.setProxy(proxyHelper.getProxyHost(), Integer.parseInt(proxyHelper.getProxyPort()));
}
if (proxyHelper.getProxyUser() != null && proxyHelper.getProxyUser().length() > 0) {
config.setProxyUsername(proxyHelper.getProxyUser());
if (proxyHelper.getProxyPwd() != null && proxyHelper.getProxyPwd().length() > 0) {
config.setProxyPassword(proxyHelper.getProxyPwd());
setAuthenticator(proxyHelper.getProxyUser(), proxyHelper.getProxyPwd());
}
}
}
}
示例2: setProxyConfig
import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private static void setProxyConfig(ForceConfigBean conf, ConnectorConfig config) throws StageException {
if (conf.useProxy) {
config.setProxy(conf.proxyHostname, conf.proxyPort);
if (conf.useProxyCredentials) {
config.setProxyUsername(conf.proxyUsername.get());
config.setProxyPassword(conf.proxyPassword.get());
}
}
}
示例3: setProxyOnConnectorConfig
import com.sforce.ws.ConnectorConfig; //导入方法依赖的package包/类
private static void setProxyOnConnectorConfig(IProxy proxy, ConnectorConfig connectorConfig) {
final String proxyHost = proxy.getProxyHost();
final String proxyPort = proxy.getProxyPort();
int portNumber = Utils.isNotEmpty(proxyPort) ? Integer.parseInt(proxyPort) : -1;
if (portNumber >= 0 && portNumber <= 65535) {
connectorConfig.setProxy(proxyHost, Integer.parseInt(proxyPort));
if (logger.isDebugEnabled()) {
logger.debug("Set proxy '" + connectorConfig.getProxy().address().toString());
}
}
connectorConfig.setProxyUsername(proxy.getProxyUser());
connectorConfig.setProxyPassword(proxy.getProxyPassword());
}