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


Java MultiValueMap.containsKey方法代码示例

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


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

示例1: getAccessTokenUri

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
protected String getAccessTokenUri(OAuth2ProtectedResourceDetails resource, MultiValueMap<String, String> form) {
    String accessTokenUri = resource.getAccessTokenUri();
    if (form.containsKey("refresh_token"))
        accessTokenUri = "https://api.weixin.qq.com/sns/oauth2/refresh_token";
    if(this.logger.isDebugEnabled()) {
        this.logger.debug("Retrieving token from " + accessTokenUri);
    }

    StringBuilder builder = new StringBuilder(accessTokenUri);
    if(this.getHttpMethod() == HttpMethod.GET) {
        String separator = "?";
        if(accessTokenUri.contains("?")) {
            separator = "&";
        }

        for(Iterator var6 = form.keySet().iterator(); var6.hasNext(); separator = "&") {
            String key = (String)var6.next();
            builder.append(separator);
            builder.append(key + "={" + key + "}");
        }
    }

    if (form.containsKey("refresh_token"))
        return builder.toString();
    return builder.toString() + "#wechat_redirect";
}
 
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:27,代码来源:MyAuthorizationCodeAccessTokenProvider.java

示例2: startJob

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
@RequestMapping(value = "/{jobName}/start", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
public void startJob(@PathVariable("jobName") String jobName, @RequestParam(required = false) MultiValueMap<String, String> payload) {
	if (isEmpty(payload) || !payload.containsKey(JOB_PARAMETERS)) {
		jobService.startJob(jobName);
	}
	JobParameters jobParameters = jobParametersConverter.getJobParameters(stringToProperties(payload.getFirst(JOB_PARAMETERS)));
	jobService.startJob(jobName, jobParameters);
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:10,代码来源:JobDataController.java

示例3: search

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
public SearchResult<Conversation> search(Client client, MultiValueMap<String, String> queryParams) throws IOException {

        final ModifiableSolrParams solrParams = new ModifiableSolrParams(toListOfStringArrays(queryParams, "text"));

        solrParams.add(CommonParams.FL, "id");
        solrParams.add(CommonParams.FQ, String.format("%s:\"%s\"", FIELD_OWNER, client.getId().toHexString()));
        solrParams.add(CommonParams.FQ, String.format("%s:\"%s\"", FIELD_TYPE, TYPE_MESSAGE));
        solrParams.set(GroupParams.GROUP, "true");
        solrParams.set(GroupParams.GROUP_FIELD, "_root_");
        solrParams.set("group.ngroups", "true");
        if (queryParams.containsKey("text")) {
            List<String> searchTerms = queryParams.get("text");
            String query = SearchUtils.createSearchWordQuery(searchTerms.stream()
                    .filter(StringUtils::isNotBlank).collect(Collectors.joining(" ")));
            if(query != null){
                solrParams.set(CommonParams.Q, query);
            }
        }
        log.trace("SolrParams: {}", solrParams);

        try (SolrClient solrClient = solrServer.getSolrClient(conversationCore)) {

            final QueryResponse queryResponse = solrClient.query(solrParams);


            return fromQueryResponse(queryResponse, this::readConversation);

        } catch (SolrServerException e) {
            throw new IllegalStateException("Cannot query non-initialized core", e);
        }
    }
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:32,代码来源:ConversationSearchService.java

示例4: submitDeployJob

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
public String submitDeployJob (	String requestedByUserid, ServiceInstance instance,
								MultiValueMap<String, String> rebuildVariables, boolean isPerformStart,
								boolean isForceDeploy ) {

	String buildItem = "User: " + requestedByUserid + " service: " + instance.getServiceName_Port();

	if ( getBuildList().size() == 0 ||
			(getBuildList().size() > 0 && !getBuildList().contains( buildItem )) ) {
		// update deploy file to reflect new schedule in progress.
		try {
			OutputFileMgr outputFm = new OutputFileMgr(
				csapApp.getProcessingDir(), "/"
						+ instance.getServiceName_Port() + DEPLOY_OP );
			outputFm.print( "*** Scheduling Deployment" );
			outputFm.close();
			// do not to opComplete as UI polling will end
		} catch (IOException e) {
			// Emptying
		}
	}

	if ( !instance.getServiceName().equals( INIT_COMPLETE ) ) {
		buildItem = "User: " + requestedByUserid + " Service: " + instance.getServiceName();
		getBuildList().add( buildItem );

		String userName = Application.SYS_USER;
		if ( rebuildVariables != null && rebuildVariables.containsKey( "scmUserid" ) ) {
			userName = rebuildVariables.getFirst( "scmUserid" );
		}

		csapEventClient.generateEvent( CsapEventClient.CSAP_SVC_CATEGORY + "/" + instance.getServiceName(),
			userName, "Deployment Queued",
			"Timeout configured in cluster.js: "
					+ instance.getDeployTimeOutSeconds() + ", Command: \n" + rebuildVariables );
	}

	serviceJobExecutor.submit( () -> deployServiceRunnable( requestedByUserid,
		instance, rebuildVariables, isPerformStart, isForceDeploy ) );

	return buildItem;
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:42,代码来源:ServiceOsManager.java

示例5: inspectPrams

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
public List<Task> inspectPrams(MultiValueMap<String, String> params)
    throws NotAuthorizedException, InvalidArgumentException {
    TaskQuery taskQuery = taskService.createTaskQuery();

    // apply filters
    if (params.containsKey(NAME)) {
        String[] names = extractCommaSeperatedFields(params.get(NAME));
        taskQuery.name(names);
    }
    if (params.containsKey(DESCRIPTION)) {
        taskQuery.descriptionLike(params.get(DESCRIPTION).get(0));
    }
    if (params.containsKey(PRIORITY)) {
        String[] prioritesInString = extractCommaSeperatedFields(params.get(PRIORITY));
        int[] priorites = extractPriorities(prioritesInString);
        taskQuery.priority(priorites);
    }
    if (params.containsKey(STATE)) {
        TaskState[] states = extractStates(params);
        taskQuery.state(states);
    }
    if (params.containsKey(CLASSIFICATION_KEY)) {
        String[] classificationKeys = extractCommaSeperatedFields(params.get(CLASSIFICATION_KEY));
        taskQuery.classificationKeyIn(classificationKeys);
    }
    if (params.containsKey(WORKBASKET_KEY)) {
        String[] workbaskets = extractCommaSeperatedFields(params.get(WORKBASKET_KEY));
        taskQuery.workbasketKeyIn(workbaskets);
    }
    if (params.containsKey(OWNER)) {
        String[] owners = extractCommaSeperatedFields(params.get(OWNER));
        taskQuery.owner(owners);
    }
    // objectReference
    if (params.keySet().stream().filter(s -> s.startsWith(POR)).toArray().length > 0) {
        if (params.containsKey(POR_COMPANY)) {
            String[] companies = extractCommaSeperatedFields(params.get(POR_COMPANY));
            taskQuery.primaryObjectReferenceCompanyIn(companies);
        }
        if (params.containsKey(POR_SYSTEM)) {
            String[] systems = extractCommaSeperatedFields(params.get(POR_SYSTEM));
            taskQuery.primaryObjectReferenceSystemIn(systems);
        }
        if (params.containsKey(POR_SYSTEM_INSTANCE)) {
            String[] systemInstances = extractCommaSeperatedFields(params.get(POR_SYSTEM_INSTANCE));
            taskQuery.primaryObjectReferenceSystemInstanceIn(systemInstances);
        }
        if (params.containsKey(POR_TYPE)) {
            String[] types = extractCommaSeperatedFields(params.get(POR_TYPE));
            taskQuery.primaryObjectReferenceTypeIn(types);
        }
        if (params.containsKey(POR_VALUE)) {
            String[] values = extractCommaSeperatedFields(params.get(POR_VALUE));
            taskQuery.primaryObjectReferenceValueIn(values);
        }
    }
    if (params.containsKey(IS_READ)) {
        taskQuery.read(Boolean.getBoolean(params.get(IS_READ).get(0)));
    }
    if (params.containsKey(IS_TRANSFERRED)) {
        taskQuery.transferred(Boolean.getBoolean(params.get(IS_TRANSFERRED).get(0)));
    }
    if (params.containsKey(CUSTOM)) {
        String[] custom = extractCommaSeperatedFields(params.get(CUSTOM));
        taskQuery.customFields(custom);
    }
    return taskQuery.list();
}
 
开发者ID:Taskana,项目名称:taskana,代码行数:69,代码来源:TaskFilter.java

示例6: getWorkbaskets

import org.springframework.util.MultiValueMap; //导入方法依赖的package包/类
@GetMapping
public ResponseEntity<List<WorkbasketSummary>> getWorkbaskets(@RequestParam MultiValueMap<String, String> params) {
    List<WorkbasketSummary> workbaskets = new ArrayList<>();
    if (params.containsKey("requiredPermission")) {
        List<WorkbasketAuthorization> authorizations = new ArrayList<>();
        params.get("requiredPermission").stream().forEach(item -> {
            for (String authorization : Arrays.asList(item.split(","))) {
                switch (authorization.trim()) {
                    case "READ":
                        authorizations.add(WorkbasketAuthorization.READ);
                        break;
                    case "OPEN":
                        authorizations.add(WorkbasketAuthorization.OPEN);
                        break;
                    case "APPEND":
                        authorizations.add(WorkbasketAuthorization.APPEND);
                        break;
                    case "TRANSFER":
                        authorizations.add(WorkbasketAuthorization.TRANSFER);
                        break;
                    case "DISTRIBUTE":
                        authorizations.add(WorkbasketAuthorization.DISTRIBUTE);
                        break;
                    case "CUSTOM_1":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_1);
                        break;
                    case "CUSTOM_2":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_2);
                        break;
                    case "CUSTOM_3":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_3);
                        break;
                    case "CUSTOM_4":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_4);
                        break;
                    case "CUSTOM_5":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_5);
                        break;
                    case "CUSTOM_6":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_6);
                        break;
                    case "CUSTOM_7":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_7);
                        break;
                    case "CUSTOM_8":
                        authorizations.add(WorkbasketAuthorization.CUSTOM_8);
                        break;
                }
            }
        });
        workbaskets = workbasketService.getWorkbaskets(authorizations);
    } else {
        workbaskets = workbasketService.getWorkbaskets();
    }
    return new ResponseEntity<>(workbaskets, HttpStatus.OK);
}
 
开发者ID:Taskana,项目名称:taskana,代码行数:57,代码来源:WorkbasketController.java


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