本文整理匯總了Java中com.blackducksoftware.integration.hub.global.HubCredentialsFieldEnum類的典型用法代碼示例。如果您正苦於以下問題:Java HubCredentialsFieldEnum類的具體用法?Java HubCredentialsFieldEnum怎麽用?Java HubCredentialsFieldEnum使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HubCredentialsFieldEnum類屬於com.blackducksoftware.integration.hub.global包,在下文中一共展示了HubCredentialsFieldEnum類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkInput
import com.blackducksoftware.integration.hub.global.HubCredentialsFieldEnum; //導入依賴的package包/類
public void checkInput(final HttpServletRequest request, final ActionErrors errors) throws IllegalArgumentException, EncryptionException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
final HubServerConfigBuilder builder = getHubServerConfigBuilderFromRequest(request);
final AbstractValidator validator = builder.createValidator();
final ValidationResults results = validator.assertValid();
if (results.isSuccess()) {
final HubServerConfig config = builder.buildObject();
configPersistenceManager.setHubServerConfig(config);
configPersistenceManager.setHubWorkspaceCheck(Boolean.valueOf(request.getParameter("hubWorkspaceCheck")));
} else {
checkForErrors(HubServerConfigFieldEnum.HUBURL, "errorUrl", results, errors);
checkForErrors(HubServerConfigFieldEnum.HUBTIMEOUT, "errorTimeout", results, errors);
checkForErrors(HubCredentialsFieldEnum.USERNAME, "errorUserName", results, errors);
checkForErrors(HubCredentialsFieldEnum.PASSWORD, "errorPassword", results, errors);
checkForErrors(HubProxyInfoFieldEnum.PROXYHOST, "errorHubProxyServer", results, errors);
checkForErrors(HubProxyInfoFieldEnum.PROXYPORT, "errorHubProxyPort", results, errors);
checkForErrors(HubProxyInfoFieldEnum.NOPROXYHOSTS, "errorHubNoProxyHost", results, errors);
checkForErrors(HubProxyInfoFieldEnum.PROXYUSERNAME, "errorHubProxyUser", results, errors);
checkForErrors(HubProxyInfoFieldEnum.PROXYPASSWORD, "errorHubProxyPass", results, errors);
}
}
示例2: setConfigFromResult
import com.blackducksoftware.integration.hub.global.HubCredentialsFieldEnum; //導入依賴的package包/類
private void setConfigFromResult(final HubServerConfigSerializable config,
final AbstractValidator validator) {
final ValidationResults serverConfigResults = validator.assertValid();
if (serverConfigResults.hasErrors()) {
if (serverConfigResults.getResultString(HubServerConfigFieldEnum.HUBURL) != null) {
config.setHubUrlError(serverConfigResults.getResultString(HubServerConfigFieldEnum.HUBURL));
}
if (serverConfigResults.getResultString(HubServerConfigFieldEnum.HUBTIMEOUT) != null) {
config.setTimeoutError(serverConfigResults.getResultString(HubServerConfigFieldEnum.HUBTIMEOUT));
}
if (serverConfigResults.getResultString(HubCredentialsFieldEnum.USERNAME) != null) {
config.setUsernameError(serverConfigResults.getResultString(HubCredentialsFieldEnum.USERNAME));
}
if (serverConfigResults.getResultString(HubCredentialsFieldEnum.PASSWORD) != null) {
config.setPasswordError(serverConfigResults.getResultString(HubCredentialsFieldEnum.PASSWORD));
}
if (serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYHOST) != null) {
config.setHubProxyHostError(serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYHOST));
}
if (serverConfigResults.getResultString(HubProxyInfoFieldEnum.NOPROXYHOSTS) != null) {
config.setHubNoProxyHostsError(serverConfigResults.getResultString(HubProxyInfoFieldEnum.NOPROXYHOSTS));
}
if (serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYPORT) != null) {
config.setHubProxyPortError(serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYPORT));
}
if (serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYUSERNAME) != null) {
config.setHubProxyUserError(serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYUSERNAME));
}
if (serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYPASSWORD) != null) {
config.setHubProxyPasswordError(serverConfigResults.getResultString(HubProxyInfoFieldEnum.PROXYPASSWORD));
}
}
}