io.cattle.platform.core.model.Agent.getRemoved()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中io.cattle.platform.core.model.Agent.getRemoved()方法的一些代码示例,展示了Agent.getRemoved()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Agent.getRemoved()方法的具体详情如下:
包路径:io.cattle.platform.core.model.Agent
类名称:Agent
方法名:getRemoved

Agent.getRemoved介绍

[英]Getter for cattle.agent.removed.
[中]cattle.agent.removed的Getter。

代码示例

代码示例来源:origin: rancher/cattle

@Override
  public HandlerResult handle(ProcessState state, ProcessInstance process) {
    Object resource = state.getResource();

    Long agentId = AgentLocatorImpl.getAgentId(resource);
    Agent agent = objectManager.loadResource(Agent.class, agentId);

    if (agent == null || agent.getRemoved() != null) {
      return null;
    }

    try {
      objectProcessManager.scheduleStandardProcess(StandardProcess.DEACTIVATE,
          agent, ProcessUtils.chainInData(state.getData(), AgentConstants.PROCESS_DEACTIVATE,
              AgentConstants.PROCESS_REMOVE));
    } catch (ProcessCancelException e) {
      objectProcessManager.scheduleStandardProcess(StandardProcess.REMOVE, agent, state.getData());
    }

    return null;
  }
}

代码示例来源:origin: rancher/cattle

@Override
public <T extends Event> T callSync(Event event, Class<T> reply, EventCallOptions options) {
  /*
   * NOTE: Forever blocking get() used only because underlying future will
   * always timeout
   */
  try {
    return AsyncUtils.get(call(event, reply, options));
  } catch (TimeoutException e) {
    Agent agent = objectManager.loadResource(Agent.class, agentId);
    if (agent == null || agent.getRemoved() != null) {
      throw new AgentRemovedException("Agent [" + agentId + "] is removed", event);
    }
    throw e;
  } catch (AgentRemovedException e) {
    throw e;
  } catch (EventExecutionException e) {
    /*
     * This is done so that the exception will have a better stack
     * trace. Normally the exceptions from a future will have a pretty
     * sparse stack not giving too much context
     */
    throw EventExecutionException.fromEvent(e.getEvent());
  }
}

代码示例来源:origin: rancher/cattle

/**
 * {@inheritDoc}
 */
@Override
public void from(io.cattle.platform.core.model.Agent from) {
  setId(from.getId());
  setName(from.getName());
  setAccountId(from.getAccountId());
  setKind(from.getKind());
  setUuid(from.getUuid());
  setDescription(from.getDescription());
  setState(from.getState());
  setCreated(from.getCreated());
  setRemoved(from.getRemoved());
  setRemoveTime(from.getRemoveTime());
  setData(from.getData());
  setUri(from.getUri());
  setManagedConfig(from.getManagedConfig());
  setZoneId(from.getZoneId());
  setExternalId(from.getExternalId());
}

代码示例来源:origin: rancher/cattle

if (agent.getRemoved() != null) {
  continue;

相关文章