本文整理汇总了Java中com.cloud.host.Status.Event方法的典型用法代码示例。如果您正苦于以下问题:Java Status.Event方法的具体用法?Java Status.Event怎么用?Java Status.Event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cloud.host.Status
的用法示例。
在下文中一共展示了Status.Event方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disconnectInternal
import com.cloud.host.Status; //导入方法依赖的package包/类
private void disconnectInternal(final long hostId, final Status.Event event, final boolean invstigate) {
final AgentAttache attache = findAttache(hostId);
if (attache != null) {
if (!invstigate) {
disconnectWithoutInvestigation(attache, event);
} else {
disconnectWithInvestigation(attache, event);
}
} else {
/* Agent is still in connecting process, don't allow to disconnect right away */
if (tapLoadingAgents(hostId, TapAgentsAction.Contains)) {
s_logger.info("Host " + hostId + " is being loaded so no disconnects needed.");
return;
}
final HostVO host = _hostDao.findById(hostId);
if (host != null && host.getRemoved() == null) {
disconnectAgent(host, event, _nodeId);
}
}
}
示例2: agentStatusTransitTo
import com.cloud.host.Status; //导入方法依赖的package包/类
@Override
public boolean agentStatusTransitTo(final HostVO host, final Status.Event e, final long msId) {
try {
_agentStatusLock.lock();
if (status_logger.isDebugEnabled()) {
final ResourceState state = host.getResourceState();
final StringBuilder msg = new StringBuilder("Transition:");
msg.append("[Resource state = ").append(state);
msg.append(", Agent event = ").append(e.toString());
msg.append(", Host id = ").append(host.getId()).append(", name = " + host.getName()).append("]");
status_logger.debug(msg.toString());
}
host.setManagementServerId(msId);
try {
return _statusStateMachine.transitTo(host, e, host.getId(), _hostDao);
} catch (final NoTransitionException e1) {
status_logger.debug("Cannot transit agent status with event " + e + " for host " + host.getId() + ", name=" + host.getName() +
", mangement server id is " + msId);
throw new CloudRuntimeException("Cannot transit agent status with event " + e + " for host " + host.getId() + ", mangement server id is " + msId + "," +
e1.getMessage());
}
} finally {
_agentStatusLock.unlock();
}
}
示例3: handleDisconnect
import com.cloud.host.Status; //导入方法依赖的package包/类
protected boolean handleDisconnect(final AgentAttache agent, final Status.Event event, final boolean investigate, final boolean broadcast, final boolean removeAgent) {
final boolean res;
if (!investigate) {
res = super.handleDisconnectWithoutInvestigation(agent, event, true, removeAgent);
} else {
res = super.handleDisconnectWithInvestigation(agent, event);
}
if (res) {
if (broadcast) {
notifyNodesInCluster(agent);
}
return true;
} else {
return false;
}
}
示例4: disconnectAgent
import com.cloud.host.Status; //导入方法依赖的package包/类
public boolean disconnectAgent(final HostVO host, final Status.Event e, final long msId) {
host.setDisconnectedOn(new Date());
if (e.equals(Status.Event.Remove)) {
host.setGuid(null);
host.setClusterId(null);
}
return agentStatusTransitTo(host, e, msId);
}
示例5: handleDisconnectWithoutInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
protected boolean handleDisconnectWithoutInvestigation(final AgentAttache attache, final Status.Event event, final boolean transitState, final boolean removeAgent) {
final long hostId = attache.getId();
s_logger.info("Host " + hostId + " is disconnecting with event " + event);
Status nextStatus = null;
final HostVO host = _hostDao.findById(hostId);
if (host == null) {
s_logger.warn("Can't find host with " + hostId);
nextStatus = Status.Removed;
} else {
final Status currentStatus = host.getStatus();
if (currentStatus == Status.Down || currentStatus == Status.Alert || currentStatus == Status.Removed) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Host " + hostId + " is already " + currentStatus);
}
nextStatus = currentStatus;
} else {
try {
nextStatus = currentStatus.getNextStatus(event);
} catch (final NoTransitionException e) {
final String err = "Cannot find next status for " + event + " as current status is " + currentStatus + " for agent " + hostId;
s_logger.debug(err);
throw new CloudRuntimeException(err);
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("The next status of agent " + hostId + "is " + nextStatus + ", current status is " + currentStatus);
}
}
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Deregistering link for " + hostId + " with state " + nextStatus);
}
removeAgent(attache, nextStatus);
// update the DB
if (host != null && transitState) {
disconnectAgent(host, event, _nodeId);
}
return true;
}
示例6: disconnectWithoutInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
protected void disconnectWithoutInvestigation(final AgentAttache attache, final Status.Event event) {
_executor.submit(new DisconnectTask(attache, event, false));
}
示例7: disconnectWithInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
public void disconnectWithInvestigation(final long hostId, final Status.Event event) {
disconnectInternal(hostId, event, true);
}
示例8: DisconnectTask
import com.cloud.host.Status; //导入方法依赖的package包/类
DisconnectTask(final AgentAttache attache, final Status.Event event, final boolean investigate) {
_attache = attache;
_event = event;
_investigate = investigate;
}
示例9: handleDisconnectWithInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
@Override
protected boolean handleDisconnectWithInvestigation(final AgentAttache attache, final Status.Event event) {
return handleDisconnect(attache, event, true, true, true);
}
示例10: handleDisconnectWithoutInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
@Override
protected boolean handleDisconnectWithoutInvestigation(final AgentAttache attache, final Status.Event event, final boolean transitState, final boolean removeAgent) {
return handleDisconnect(attache, event, false, true, removeAgent);
}
示例11: agentStatusTransitTo
import com.cloud.host.Status; //导入方法依赖的package包/类
public boolean agentStatusTransitTo(HostVO host, Status.Event e, long msId);
示例12: disconnectWithoutInvestigation
import com.cloud.host.Status; //导入方法依赖的package包/类
void disconnectWithoutInvestigation(long hostId, Status.Event event);