当前位置: 首页>>代码示例>>Java>>正文


Java HttpUtils.addValue方法代码示例

本文整理汇总了Java中org.craftercms.commons.http.HttpUtils.addValue方法的典型用法代码示例。如果您正苦于以下问题:Java HttpUtils.addValue方法的具体用法?Java HttpUtils.addValue怎么用?Java HttpUtils.addValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.craftercms.commons.http.HttpUtils的用法示例。


在下文中一共展示了HttpUtils.addValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProfile

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile createProfile(String tenantName, String username, String password, String email, boolean enabled,
                             Set<String> roles, Map<String, Object> attributes, String verificationUrl)
        throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_USERNAME, username, params);
    HttpUtils.addValue(PARAM_PASSWORD, password, params);
    HttpUtils.addValue(PARAM_EMAIL, email, params);
    HttpUtils.addValue(PARAM_ENABLED, enabled, params);
    HttpUtils.addValues(PARAM_ROLE, roles, params);
    if (MapUtils.isNotEmpty(attributes)) {
        HttpUtils.addValue(PARAM_ATTRIBUTES, serializeAttributes(attributes), params);
    }
    HttpUtils.addValue(PARAM_VERIFICATION_URL, verificationUrl, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_CREATE);

    return doPostForObject(url, params, Profile.class);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:21,代码来源:ProfileServiceRestClient.java

示例2: getProfileByUsername

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile getProfileByUsername(String tenantName, String username, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_USERNAME, username, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_USERNAME);
    url = addQueryParams(url, params, false);

    try {
        return doGetForObject(url, Profile.class);
    } catch (ProfileRestServiceException e) {
        if (e.getStatus() == HttpStatus.NOT_FOUND) {
            return null;
        } else {
            throw e;
        }
    }
}
 
开发者ID:craftercms,项目名称:profile,代码行数:21,代码来源:ProfileServiceRestClient.java

示例3: getProfileByTicket

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile getProfileByTicket(String ticketId, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TICKET_ID, ticketId, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_TICKET);
    url = addQueryParams(url, params, false);

    try {
        return doGetForObject(url, Profile.class);
    } catch (ProfileRestServiceException e) {
        if (e.getStatus() == HttpStatus.NOT_FOUND) {
            return null;
        } else {
            throw e;
        }
    }
}
 
开发者ID:craftercms,项目名称:profile,代码行数:20,代码来源:ProfileServiceRestClient.java

示例4: getProfilesByQuery

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfilesByQuery(String tenantName, String query, String sortBy, SortOrder sortOrder,
                                        Integer start, Integer count, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_QUERY, query, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValue(PARAM_START, start, params);
    HttpUtils.addValue(PARAM_COUNT, count, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_QUERY);
    url = addQueryParams(url, params, true);

    try {
        return doGetForObject(new URI(url), profileListTypeRef);
    } catch (URISyntaxException e) {
        throw new I10nProfileException(ERROR_KEY_INVALID_URI_ERROR, url);
    }
}
 
开发者ID:craftercms,项目名称:profile,代码行数:22,代码来源:ProfileServiceRestClient.java

示例5: getProfileRange

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfileRange(String tenantName, String sortBy, SortOrder sortOrder, Integer start,
                                     Integer count, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValue(PARAM_START, start, params);
    HttpUtils.addValue(PARAM_COUNT, count, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_RANGE);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, profileListTypeRef);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:17,代码来源:ProfileServiceRestClient.java

示例6: getProfilesByExistingAttribute

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfilesByExistingAttribute(String tenantName, String attributeName, String sortBy,
                                                    SortOrder sortOrder, String... attributesToReturn)
        throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_ATTRIBUTE_NAME, attributeName, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_EXISTING_ATTRIB);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, profileListTypeRef);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:17,代码来源:ProfileServiceRestClient.java

示例7: getProfilesByAttributeValue

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfilesByAttributeValue(String tenantName, String attributeName,
                                                 String attributeValue, String sortBy, SortOrder sortOrder,
                                                 String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_ATTRIBUTE_NAME, attributeName, params);
    HttpUtils.addValue(PARAM_ATTRIBUTE_VALUE, attributeValue, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_ATTRIB_VALUE);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, profileListTypeRef);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:18,代码来源:ProfileServiceRestClient.java

示例8: updateProfile

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile updateProfile(String profileId, String username, String password, String email, Boolean enabled,
                             Set<String> roles, Map<String, Object> attributes, String... attributesToReturn)
        throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_USERNAME, username, params);
    HttpUtils.addValue(PARAM_PASSWORD, password, params);
    HttpUtils.addValue(PARAM_EMAIL, email, params);
    HttpUtils.addValue(PARAM_ENABLED, enabled, params);

    // Send empty role to indicate that all roles should be deleted
    if (roles != null && roles.isEmpty()) {
        HttpUtils.addValue(PARAM_ROLE, "", params);
    } else {
        HttpUtils.addValues(PARAM_ROLE, roles, params);
    }

    if (MapUtils.isNotEmpty(attributes)) {
        HttpUtils.addValue(PARAM_ATTRIBUTES, serializeAttributes(attributes), params);
    }

    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_UPDATE);

    return doPostForObject(url, params, Profile.class, profileId);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:28,代码来源:ProfileServiceRestClient.java

示例9: verifyProfile

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile verifyProfile(String verificationTokenId, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_VERIFICATION_TOKEN_ID, verificationTokenId, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_VERIFY);

    return doPostForObject(url, params, Profile.class);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:11,代码来源:ProfileServiceRestClient.java

示例10: getProfileCount

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public long getProfileCount(String tenantName) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_COUNT);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, Long.class);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:11,代码来源:ProfileServiceRestClient.java

示例11: getProfileCountByQuery

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public long getProfileCountByQuery(String tenantName, String query) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_QUERY, query, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_TENANT_COUNT_BY_QUERY);
    url = addQueryParams(url, params, true);

    try {
        return doGetForObject(new URI(url), Long.class);
    } catch (URISyntaxException e) {
        throw new I10nProfileException(ERROR_KEY_INVALID_URI_ERROR, url);
    }
}
 
开发者ID:craftercms,项目名称:profile,代码行数:16,代码来源:ProfileServiceRestClient.java

示例12: getProfilesByIds

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfilesByIds(List<String> profileIds, String sortBy, SortOrder sortOrder,
                                      String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValues(PARAM_ID, profileIds, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_IDS);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, profileListTypeRef);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:15,代码来源:ProfileServiceRestClient.java

示例13: getProfilesByRole

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public List<Profile> getProfilesByRole(String tenantName, String role, String sortBy, SortOrder sortOrder,
                                       String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_TENANT_NAME, tenantName, params);
    HttpUtils.addValue(PARAM_ROLE, role, params);
    HttpUtils.addValue(PARAM_SORT_BY, sortBy, params);
    HttpUtils.addValue(PARAM_SORT_ORDER, sortOrder, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_GET_BY_ROLE);
    url = addQueryParams(url, params, false);

    return doGetForObject(url, profileListTypeRef);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:16,代码来源:ProfileServiceRestClient.java

示例14: resetPassword

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile resetPassword(String profileId, String resetPasswordUrl, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_RESET_PASSWORD_URL, resetPasswordUrl, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_RESET_PASSWORD);

    return doPostForObject(url, params, Profile.class, profileId);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:11,代码来源:ProfileServiceRestClient.java

示例15: changePassword

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Profile changePassword(String resetTokenId, String newPassword, String... attributesToReturn) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValue(PARAM_RESET_TOKEN_ID, resetTokenId, params);
    HttpUtils.addValue(PARAM_NEW_PASSWORD, newPassword, params);
    HttpUtils.addValues(PARAM_ATTRIBUTE_TO_RETURN, attributesToReturn, params);

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_CHANGE_PASSWORD);

    return doPostForObject(url, params, Profile.class);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:12,代码来源:ProfileServiceRestClient.java


注:本文中的org.craftercms.commons.http.HttpUtils.addValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。