本文整理汇总了Java中org.springframework.cloud.deployer.spi.app.DeploymentState.error方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentState.error方法的具体用法?Java DeploymentState.error怎么用?Java DeploymentState.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.cloud.deployer.spi.app.DeploymentState
的用法示例。
在下文中一共展示了DeploymentState.error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: aggregateState
import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
/**
* Aggregate the set of app states into a single state for a stream.
*
* @param states set of states for apps of a stream
* @return the stream state based on app states
*/
public static DeploymentState aggregateState(List<DeploymentState> states) {
if (states.size() == 1) {
DeploymentState state = states.iterator().next();
logger.debug("aggregateState: Deployment State Set Size = 1. Deployment State " + state);
// a stream which is known to the stream definition repository
// but unknown to deployers is undeployed
if (state == DeploymentState.unknown) {
logger.debug("aggregateState: Returning " + DeploymentState.undeployed);
return DeploymentState.undeployed;
}
else {
logger.debug("aggregateState: Returning " + state);
return state;
}
}
if (states.isEmpty() || states.contains(DeploymentState.error)) {
logger.debug("aggregateState: Returning " + DeploymentState.error);
return DeploymentState.error;
}
if (states.contains(DeploymentState.failed)) {
logger.debug("aggregateState: Returning " + DeploymentState.failed);
return DeploymentState.failed;
}
if (states.contains(DeploymentState.deploying)) {
logger.debug("aggregateState: Returning " + DeploymentState.deploying);
return DeploymentState.deploying;
}
if (allAppsDeployed(states)) {
return DeploymentState.deployed;
}
logger.debug("aggregateState: Returning " + DeploymentState.partial);
return DeploymentState.partial;
}
示例2: aggregateState
import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
/**
* Aggregate the set of app states into a single state for a stream.
*
* @param states set of states for apps of a stream
* @return the stream state based on app states
*/
public static DeploymentState aggregateState(Set<DeploymentState> states) {
if (states.size() == 1) {
DeploymentState state = states.iterator().next();
logger.debug("aggregateState: Deployment State Set Size = 1. Deployment State " + state);
// a stream which is known to the stream definition streamDefinitionRepository
// but unknown to deployers is undeployed
if (state == DeploymentState.unknown) {
logger.debug("aggregateState: Returning " + DeploymentState.undeployed);
return DeploymentState.undeployed;
}
else {
logger.debug("aggregateState: Returning " + state);
return state;
}
}
if (states.isEmpty() || states.contains(DeploymentState.error)) {
logger.debug("aggregateState: Returning " + DeploymentState.error);
return DeploymentState.error;
}
if (states.contains(DeploymentState.failed)) {
logger.debug("aggregateState: Returning " + DeploymentState.failed);
return DeploymentState.failed;
}
if (states.contains(DeploymentState.deploying)) {
logger.debug("aggregateState: Returning " + DeploymentState.deploying);
return DeploymentState.deploying;
}
logger.debug("aggregateState: Returing " + DeploymentState.partial);
return DeploymentState.partial;
}
示例3: assertApplicationDoesNotExist
import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
private void assertApplicationDoesNotExist(String deploymentId, AppStatus status) {
DeploymentState state = status.getState();
if (state != DeploymentState.unknown && state != DeploymentState.error) {
throw new IllegalStateException(String.format("App %s is already deployed with state %s", deploymentId, state));
}
}