本文整理了Java中io.cattle.platform.eventing.model.Event.getResourceType()
方法的一些代码示例,展示了Event.getResourceType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getResourceType()
方法的具体详情如下:
包路径:io.cattle.platform.eventing.model.Event
类名称: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();
}
内容来源于网络,如有侵权,请联系作者删除!