本文整理汇总了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 );
}
示例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 );
}