io.cattle.platform.eventing.model.Event.getResourceType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(136)

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

Event.getResourceType介绍

暂无

代码示例

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

protected void add(Event event) {
  String id = event.getResourceId();
  String type = event.getResourceType();
  @SuppressWarnings("unchecked")
  Map<String, Object> data = (Map<String, Object>) event.getData();
  Object accountId = data == null ? null : data.get(ObjectMetaDataManager.ACCOUNT_FIELD);
  if (accountId == null) {
    accountId = Boolean.TRUE;
  }
  if (type != null && id != null) {
    changed.put(new ImmutablePair<String, String>(type, id), accountId);
  }
}

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

@EventHandler
public void resourceChange(Event event) {
  String key = key(event.getResourceType(), event.getResourceId());
  Object wait = waiters.get(key);
  if (wait != null) {
    synchronized (wait) {
      wait.notifyAll();
    }
  }
}

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

public static EventVO<Object> reply(Event request) {
  String[] previousIds = request.getPreviousIds();
  if (previousIds != null && previousIds.length > 0) {
    String[] newIds = new String[previousIds.length + 1];
    System.arraycopy(previousIds, 0, newIds, 1, previousIds.length);
    newIds[0] = request.getId();
    previousIds = newIds;
  } else {
    previousIds = new String[] { request.getId() };
  }
  EventVO<Object> event = new EventVO<Object>();
  event.setName(request.getReplyTo());
  event.setPreviousNames(prepend(request.getPreviousNames(), request.getName()));
  event.setPreviousIds(prepend(request.getPreviousIds(), request.getId()));
  event.setResourceId(request.getResourceId());
  event.setResourceType(request.getResourceType());
  return event;
}

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

@SuppressWarnings("unchecked")
public EventVO(Event event, String replyTo) {
  this.replyTo = replyTo;
  this.id = event.getId();
  this.name = event.getName();
  this.previousIds = event.getPreviousIds();
  this.previousNames = event.getPreviousNames();
  this.data = (T) event.getData();
  this.time = event.getTime();
  this.publisher = event.getPublisher();
  this.resourceId = event.getResourceId();
  this.resourceType = event.getResourceType();
  this.transitioning = event.getTransitioning();
  this.transitioningMessage = event.getTransitioningMessage();
  this.transitioningInternalMessage = event.getTransitioningInternalMessage();
  this.transitioningProgress = event.getTransitioningProgress();
  this.context = event.getContext();
  this.timeoutMillis = event.getTimeoutMillis();
}

相关文章