當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonNode.findValues方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.JsonNode.findValues方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonNode.findValues方法的具體用法?Java JsonNode.findValues怎麽用?Java JsonNode.findValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.JsonNode的用法示例。


在下文中一共展示了JsonNode.findValues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateLifecycleServiceInstances

import com.fasterxml.jackson.databind.JsonNode; //導入方法依賴的package包/類
private void generateLifecycleServiceInstances (
													ReleasePackage releasePackage,
													String platformLifeCycle, StringBuffer resultsBuf, LifeCycleSettings lifeMetaData,
													ArrayList<String> groupList, String platformSubLife, JsonNode subLifeNode,
													ReleasePackage testRootModel
													)
		throws IOException, JsonParseException, JsonMappingException {

	logger.debug( "Checking: {} ", releasePackage.getReleasePackageFileName() );

	if ( subLifeNode.has( DEFINITION_MONITORS ) ) {
		// this is a hook for cluster level settings that overwrite
		// the defaults
		List<JsonNode> nodes = subLifeNode.findValues( "hosts" );

		for ( JsonNode node : nodes ) {
			ArrayNode nodeArray = (ArrayNode) node;
			for ( JsonNode hostNameNode : nodeArray ) {
				String host = hostNameNode.asText().replaceAll( "\\$host", Application.getHOST_NAME() );
				lifeMetaData
					.addHostMonitor( host, subLifeNode.path( DEFINITION_MONITORS ) );
			}
			// logger.warn("_node: " +
			// jacksonMapper.writeValueAsString( node));
		}
	}
	groupList.add( platformSubLife );

	// Any logic/semantic errors are pushed via
	// Application.CONFIG_PARSE_ERROR
	resultsBuf.append( "\n \t " + releasePackage.getReleasePackageFileName() + "\t - \t" + platformSubLife );
	
	
	configureAllJavaServices( resultsBuf, releasePackage, platformLifeCycle, platformSubLife, subLifeNode );

	configureAllOsProcesses( resultsBuf, releasePackage, platformLifeCycle, platformSubLife, subLifeNode, testRootModel );

	generateMapsForConfigScreen( releasePackage, platformLifeCycle, platformSubLife, subLifeNode );

}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:41,代碼來源:DefinitionParser.java

示例2: addJeeSeviceAttributes

import com.fasterxml.jackson.databind.JsonNode; //導入方法依賴的package包/類
private void addJeeSeviceAttributes(ModelMap modelMap, ReleasePackage appPackage, String lifeToEdit) {

		JsonNode lifeJson = appPackage.getJsonModelDefinition().at( DefinitionParser.buildLifePtr( lifeToEdit ) );
		List<JsonNode> javaServiceNodes = lifeJson.findValues( DefinitionParser.CLUSTER_JAVA_SERVICES );

		Map<String, String> jeePortMap = corePortals.jeeServices( appPackage ).stream()
				//	.filter( serviceName -> !serviceName.equals( Application.AGENT_ID ) )
				.collect( Collectors.toMap(
						serviceName -> serviceName,
						serviceName -> getHttpPortFromCurrentClusters( serviceName, javaServiceNodes ) ) );

		AtomicInteger startPort = new AtomicInteger( csapApp.lifeCycleSettings().getPortStart() + 10 );

		jeePortMap.entrySet().stream()
				.filter( jeeport -> jeeport.getValue().length() == 0 ) // we set unknown services to ""
				.forEach( entry -> {
					String nextAvailable = getNextAvailableHttpPort( javaServiceNodes, startPort );
					entry.setValue( nextAvailable );
					// we need new values.
				} );

		modelMap.addAttribute( "jeeServices", jeePortMap );

		// Get the next 20 free ports for manual assignment
		List<String> jeeFreePorts = IntStream
				.iterate( startPort.get(), i -> i + 1 ).limit( 20 )
				.mapToObj( portNumber -> {
					return getNextAvailableHttpPort( javaServiceNodes, startPort );
				} )
				.collect( Collectors.toList() );

		modelMap.addAttribute( "jeeFreePorts", jeeFreePorts );

	}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:35,代碼來源:ApplicationEditor.java


注:本文中的com.fasterxml.jackson.databind.JsonNode.findValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。