本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例4: transformStatus
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
public InstanceStatus transformStatus(DropletStatus dropletStatus) {
return transformStatusOfDroplet(dropletStatus);
}
示例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());
}
示例6: isActive
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
* @return true if droplet is active
*/
public boolean isActive() {
return DropletStatus.ACTIVE == status;
}
示例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;
}
示例8: isOff
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
* @return true if droplet is turned off
*/
public boolean isOff() {
return DropletStatus.OFF == status;
}
示例9: isArchived
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
* @return true if droplet is archived
*/
public boolean isArchived() {
return DropletStatus.ARCHIVE == status;
}
示例10: getStatus
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
* @return the status
*/
public DropletStatus getStatus() {
return status;
}
示例11: setStatus
import com.myjeeva.digitalocean.common.DropletStatus; //导入依赖的package包/类
/**
* @param status the status to set
*/
public void setStatus(DropletStatus status) {
this.status = status;
}
示例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);