當前位置: 首頁>>代碼示例>>Java>>正文


Java HubCredentialsFieldEnum類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:blackducksoftware,項目名稱:hub-teamcity,代碼行數:25,代碼來源:HubGlobalServerConfigController.java

示例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));
        }
    }
}
 
開發者ID:blackducksoftware,項目名稱:hub-bamboo,代碼行數:34,代碼來源:HubConfigController.java


注:本文中的com.blackducksoftware.integration.hub.global.HubCredentialsFieldEnum類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。