当前位置: 首页>>代码示例>>Java>>正文


Java DropletStatus类代码示例

本文整理汇总了Java中com.myjeeva.digitalocean.common.DropletStatus的典型用法代码示例。如果您正苦于以下问题:Java DropletStatus类的具体用法?Java DropletStatus怎么用?Java DropletStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DropletStatus类属于com.myjeeva.digitalocean.common包,在下文中一共展示了DropletStatus类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transformStatusOfDroplet

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
public static InstanceStatus transformStatusOfDroplet(DropletStatus dropletStatus) {
    switch (dropletStatus) {
        case NEW:
            return InstanceStatus.STARTING;
        case ACTIVE:
            return InstanceStatus.RUNNING;
        case ARCHIVE:
            return InstanceStatus.STOPPED;
        case OFF:
            return InstanceStatus.STOPPED;
        default:
            return InstanceStatus.UNKNOWN;
    }
}
 
开发者ID:beolnix,项目名称:tcdop,代码行数:15,代码来源:DOAdapterUtils.java

示例2: createState

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
private static InstanceState createState(DropletStatus dropletStatus) {
    switch (dropletStatus) {
        case NEW: return InstanceState.QUEUED;
        default:
        case ACTIVE: return InstanceState.LAUNCHED;
        case OFF:
        case ARCHIVE: return InstanceState.SHUTOFF;
    }
}
 
开发者ID:meridor,项目名称:perspective-backend,代码行数:10,代码来源:ListInstancesOperation.java

示例3: waitForGracefulShutdown

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
private boolean waitForGracefulShutdown(Api api, Integer dropletId) throws Exception {
    int totalWaitingMs = 0;
    while (totalWaitingMs < instanceShutdownTimeout) {
        Optional<Droplet> dropletCandidate = api.getDropletById(dropletId);
        if (!dropletCandidate.isPresent()) {
            break;
        }
        if (dropletCandidate.get().getStatus() == DropletStatus.OFF) {
            return true;
        }
        totalWaitingMs += CHECK_DELAY;
        Thread.sleep(CHECK_DELAY);
    }
    return false;
}
 
开发者ID:meridor,项目名称:perspective-backend,代码行数:16,代码来源:ShutdownInstanceOperation.java

示例4: transformStatus

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
public InstanceStatus transformStatus(DropletStatus dropletStatus) {
    return transformStatusOfDroplet(dropletStatus);
}
 
开发者ID:beolnix,项目名称:tcdop,代码行数:4,代码来源:DOAdapterImpl.java

示例5: isDropletActive

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
public static boolean isDropletActive(Droplet droplet) {
    if (droplet == null) {
        return false;
    }
    return DropletStatus.ACTIVE.equals(droplet.getStatus());
}
 
开发者ID:beolnix,项目名称:tcdop,代码行数:7,代码来源:DOAdapterUtils.java

示例6: isActive

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @return true if droplet is active
 */
public boolean isActive() {
  return DropletStatus.ACTIVE == status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例7: isNew

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @return true if droplet is new, meaning it's booting up
 */
public boolean isNew() {
  return DropletStatus.NEW == status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例8: isOff

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @return true if droplet is turned off
 */
public boolean isOff() {
  return DropletStatus.OFF == status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例9: isArchived

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @return true if droplet is archived
 */
public boolean isArchived() {
  return DropletStatus.ARCHIVE == status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例10: getStatus

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @return the status
 */
public DropletStatus getStatus() {
  return status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例11: setStatus

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * @param status the status to set
 */
public void setStatus(DropletStatus status) {
  this.status = status;
}
 
开发者ID:jeevatkm,项目名称:digitalocean-api-java,代码行数:7,代码来源:Droplet.java

示例12: transformStatus

import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
 * Transforms status from Digital Ocean format to the Teamcity Format
 * @param dropletStatus status to be converted
 * @return status in TeamCity format
 */
InstanceStatus transformStatus(DropletStatus dropletStatus);
 
开发者ID:beolnix,项目名称:tcdop,代码行数:7,代码来源:DOAdapter.java


注:本文中的com.myjeeva.digitalocean.common.DropletStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。