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


Java HttpUtils.addValues方法代码示例

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


在下文中一共展示了HttpUtils.addValues方法的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: getProfile

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

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

    try {
        return doGetForObject(url, Profile.class, profileId);
    } catch (ProfileRestServiceException e) {
        if (e.getStatus() == HttpStatus.NOT_FOUND) {
            return null;
        } else {
            throw e;
        }
    }
}
 
开发者ID:craftercms,项目名称:profile,代码行数:19,代码来源: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: removeAttributeDefinitions

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Tenant removeAttributeDefinitions(String tenantName, Collection<String> attributeNames)
        throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValues(PARAM_ATTRIBUTE_NAME, attributeNames, params);

    String url = getAbsoluteUrl(BASE_URL_TENANT + URL_TENANT_REMOVE_ATTRIBUTE_DEFINITIONS);

    return doPostForObject(url, params, Tenant.class, tenantName);
}
 
开发者ID:craftercms,项目名称:profile,代码行数:11,代码来源:TenantServiceRestClient.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: enableProfile

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

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_ENABLE);

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

示例11: disableProfile

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

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_DISABLE);

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

示例12: addRoles

import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
@Override
public Tenant addRoles(String tenantName, Collection<String> roles) throws ProfileException {
    MultiValueMap<String, String> params = createBaseParams();
    HttpUtils.addValues(PARAM_ROLE, roles, params);

    String url = getAbsoluteUrl(BASE_URL_TENANT + URL_TENANT_ADD_ROLES);

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

示例13: removeRoles

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

    String url = getAbsoluteUrl(BASE_URL_PROFILE + URL_PROFILE_REMOVE_ROLES);

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

示例14: 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

示例15: updateAttributes

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

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

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


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