當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。