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


Java UriBuilder.queryParam方法代码示例

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


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

示例1: buildAuthenticationRequestUri

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
public URI buildAuthenticationRequestUri(final URI redirectUri,
    final String state,
    final String nonce) {

    openIdConfiguration.getAuthorizationEndpoint();
    final UriBuilder b = UriBuilder.fromUri(openIdConfiguration.getAuthorizationEndpoint())
        .queryParam("response_type", "code")
        .queryParam("scope", scope)
        .queryParam("client_id", clientId)
        .queryParam("redirect_uri", redirectUri)
        .queryParam("nonce", nonce);
    if (state != null) {
        b.queryParam("state", state);
    }
    if (display != null) {
        b.queryParam("display", display);
    }
    if (prompt != null) {
        b.queryParam("prompt", prompt);
    }
    return b
        .build();
}
 
开发者ID:trajano,项目名称:app-ms,代码行数:24,代码来源:IssuerConfig.java

示例2: validateOpenShiftProjectExists

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
/**
 * Validates if the OpenShift project exists
 *
 * @param authHeader
 * @param project
 * @return a validation message, returns {@link #VALIDATION_MESSAGE_OK} if the project does not exist
 */
public String validateOpenShiftProjectExists(String authHeader, String project, String cluster) {
    String validationMessage;
    try {
        UriBuilder builder = UriBuilder.fromUri(missionControlValidationURI).path("/project/" + project);
        if (cluster != null) {
            builder.queryParam("cluster", cluster);
        }
        URI targetURI = builder.build();
        if (head(targetURI, authHeader) == Response.Status.OK.getStatusCode()) {
            validationMessage = "OpenShift Project '" + project + "' already exists";
        } else {
            validationMessage = VALIDATION_MESSAGE_OK;
        }
    } catch (Exception e) {
        String message = e.getMessage();
        Throwable root = rootException(e);
        if (root instanceof UnknownHostException || root instanceof ConnectException) {
            validationMessage = "Mission Control is offline and cannot validate the OpenShift Project Name";
        } else {
            if (root.getMessage() != null) {
                message = root.getMessage();
            }
            validationMessage = "Error while validating OpenShift Project Name: " + message;
        }
    }
    return validationMessage;
}
 
开发者ID:fabric8-launcher,项目名称:launcher-backend,代码行数:35,代码来源:MissionControl.java

示例3: validateOpenShiftTokenExists

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
public String validateOpenShiftTokenExists(String authHeader, String cluster) {
    String validationMessage;
    try {
        UriBuilder builder = UriBuilder.fromUri(missionControlValidationURI).path("/token/openshift");
        if (cluster != null) {
            builder.queryParam("cluster", cluster);
        }
        URI targetURI = builder.build();
        if (head(targetURI, authHeader) == Response.Status.OK.getStatusCode()) {
            validationMessage = VALIDATION_MESSAGE_OK;
        } else {
            validationMessage = "OpenShift Token does not exist";
        }
    } catch (Exception e) {
        String message = e.getMessage();
        Throwable root = rootException(e);
        if (root instanceof UnknownHostException || root instanceof ConnectException) {
            validationMessage = "Mission Control is offline and cannot validate if the OpenShift token exists";
        } else {
            if (root.getMessage() != null) {
                message = root.getMessage();
            }
            validationMessage = "Error while validating if the OpenShift Token exists: " + message;
        }
    }
    return validationMessage;
}
 
开发者ID:fabric8-launcher,项目名称:launcher-backend,代码行数:28,代码来源:MissionControl.java

示例4: getEnabledIdentityProviders

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
@Timed
public List<String> getEnabledIdentityProviders(Optional<String> transactionEntityId) {
    final UriBuilder uriBuilder = UriBuilder
            .fromUri(configUri)
            .path(Urls.ConfigUrls.ENABLED_IDENTITY_PROVIDERS_RESOURCE);
    if (transactionEntityId.isPresent()) {
        uriBuilder.queryParam(Urls.ConfigUrls.TRANSACTION_ENTITY_ID_PARAM, transactionEntityId.get());
    }
    URI uri = uriBuilder.build();
    return jsonClient.get(uri, new GenericType<List<String>>() {
    });
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:13,代码来源:IdentityProvidersConfigProxy.java

示例5: getEncodedUri

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
private URI getEncodedUri(final String path, final Map<String, String> queryParams, final String entityId) {
    final UriBuilder uriBuilder = UriBuilder
            .fromUri(configUri)
            .path(path);
    for (Map.Entry<String, String> entry : queryParams.entrySet()) {
        uriBuilder.queryParam(entry.getKey(), entry.getValue());
    }

    return uriBuilder.buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:11,代码来源:TransactionsConfigProxy.java

示例6: setUpStubForAssertionConsumerServiceUri

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
public void setUpStubForAssertionConsumerServiceUri(String entityId, Optional<Integer> assertionConsumerServiceIndex) throws JsonProcessingException {
    UriBuilder uriBuilder = UriBuilder.fromPath(Urls.ConfigUrls.TRANSACTIONS_ASSERTION_CONSUMER_SERVICE_URI_RESOURCE);
    if (assertionConsumerServiceIndex.isPresent()) {
        uriBuilder.queryParam(Urls.ConfigUrls.ASSERTION_CONSUMER_SERVICE_INDEX_PARAM, assertionConsumerServiceIndex.get().toString());
    }

    URI uri = uriBuilder.buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));

    register(uri.toString(), OK, new ResourceLocation(URI.create("thisIsAnRpPostEndpointUri")));
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:11,代码来源:ConfigStubRule.java

示例7: getShouldHubSignResponseMessages

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
public Boolean getShouldHubSignResponseMessages(String entityId) {
    final UriBuilder uriBuilder = UriBuilder
            .fromUri(configUri)
            .path(Urls.ConfigUrls.SHOULD_HUB_SIGN_RESPONSE_MESSAGES_RESOURCE);
    for (Map.Entry<String, String> entry : ImmutableMap.<String, String>of().entrySet()) {
        uriBuilder.queryParam(entry.getKey(), entry.getValue());
    }
    URI uri = uriBuilder.buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));
    try {
        return booleanCache.getUnchecked(uri);
    } catch (UncheckedExecutionException e) {
        Throwables.throwIfUnchecked(e.getCause());
        throw new RuntimeException(e.getCause());
    }
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:16,代码来源:TransactionsConfigProxy.java

示例8: getShouldHubUseLegacySamlStandard

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
public Boolean getShouldHubUseLegacySamlStandard(String entityId) {
    final UriBuilder uriBuilder = UriBuilder
            .fromUri(configUri)
            .path(Urls.ConfigUrls.SHOULD_HUB_USE_LEGACY_SAML_STANDARD_RESOURCE);
    for (Map.Entry<String, String> entry : ImmutableMap.<String, String>of().entrySet()) {
        uriBuilder.queryParam(entry.getKey(), entry.getValue());
    }
    URI uri = uriBuilder.buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));
    try {
        return booleanCache.getUnchecked(uri);
    } catch (UncheckedExecutionException e) {
        Throwables.throwIfUnchecked(e.getCause());
        throw new RuntimeException(e.getCause());
    }
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:16,代码来源:TransactionsConfigProxy.java

示例9: createLink

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
private Link createLink(String rel, int pageNum, int perPage) {
  UriBuilder uriBuilder = uriBuilderSupplier.get().clone()
      .queryParam(RouterObjectService.PAGE_NUMBER_PARAM, String.valueOf(pageNum));

  if (perPage != 10) {
    uriBuilder.queryParam(RouterObjectService.ITEMS_PER_PAGE_PARAM, String.valueOf(perPage));
  }

  return linkCreator.apply(Link.fromUriBuilder(uriBuilder).rel(rel));
}
 
开发者ID:Nexmo,项目名称:comms-router,代码行数:11,代码来源:PaginationHelper.java

示例10: rebuildQuery

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
/** Rebuild the URI query with lower case parameter names. */
private static URI rebuildQuery(final URI uri,
    final MultivaluedMap<String, String> parameters) {
  UriBuilder b = UriBuilder.fromUri(uri).replaceQuery("");
  for(Map.Entry<String, List<String>> e : parameters.entrySet()) {
    final String key = StringUtils.toLowerCase(e.getKey());
    for(String v : e.getValue()) {
      b = b.queryParam(key, v);
    }
  }
  return b.build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ParamFilter.java

示例11: addResponseSocketOpenTimeUrlParameter

import javax.ws.rs.core.UriBuilder; //导入方法依赖的package包/类
private void addResponseSocketOpenTimeUrlParameter(SessionStatusRequest request, UriBuilder uriBuilder) {
  if (request.isResponseSocketOpenTimeSet()) {
    TimeUnit timeUnit = request.getResponseSocketOpenTimeUnit();
    long timeValue = request.getResponseSocketOpenTimeValue();
    long queryTimeoutInMilliseconds = timeUnit.toMillis(timeValue);
    uriBuilder.queryParam("timeoutMs", queryTimeoutInMilliseconds);
  }
}
 
开发者ID:SK-EID,项目名称:smart-id-java-client,代码行数:9,代码来源:SmartIdRestConnector.java


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