当前位置: 首页>>代码示例>>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;未经允许,请勿转载。