本文整理汇总了Java中org.edgexfoundry.domain.meta.Schedule.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Schedule.getId方法的具体用法?Java Schedule.getId怎么用?Java Schedule.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.edgexfoundry.domain.meta.Schedule
的用法示例。
在下文中一共展示了Schedule.getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateScheduleEventInScheduleContext
import org.edgexfoundry.domain.meta.Schedule; //导入方法依赖的package包/类
public void updateScheduleEventInScheduleContext(ScheduleEvent scheduleEvent)
{
synchronized (scheduleContextQueue)
{
// get the schedule for the event
String scheduleId = scheduleEventIdToScheduleIdMap.get(scheduleEvent.getId());
if(scheduleId == null) {
logger.error("failed to update schedule event " + scheduleEvent.getName() +
" current schedule " + scheduleEvent.getId() + " not found");
} else {
Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
if(schedule == null) {
logger.error("failed to update schedule event " + scheduleEvent.getName() +
" schedule " + scheduleEvent.getSchedule() + " not found");
} else {
// see if the event switched schedules
if(scheduleId != schedule.getId()) {
if(!scheduleIdToScheduleContextMap.containsKey(scheduleId)) {
logger.error("failed to switch schedule event " + scheduleEvent.getId() + ", schedule " + scheduleId + " not found");
} else {
// remove the schedule event from the old schedule
removeScheduleEventById(scheduleEvent.getId());
// add the schedule event to the new schedule
addScheduleEventToScheduleContext(scheduleEvent);
}
} else {
// update the schedule event in place
if(!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
logger.error("failed to update schedule event " + scheduleEvent.getId() + ", schedule " + schedule.getId() + " not found");
} else {
// update the schedule event in the context
scheduleIdToScheduleContextMap.get(schedule.getId()).updateScheduleEvent(scheduleEvent);
}
}
}
}
}
}
示例2: updateScheduleEventInScheduleContext
import org.edgexfoundry.domain.meta.Schedule; //导入方法依赖的package包/类
public void updateScheduleEventInScheduleContext(ScheduleEvent scheduleEvent) {
synchronized (scheduleContextQueue) {
// get the schedule for the event
String scheduleId = scheduleEventIdToScheduleIdMap.get(scheduleEvent.getId());
if (scheduleId == null) {
logger.error("failed to update schedule event " + scheduleEvent.getName()
+ " current schedule " + scheduleEvent.getId() + " not found");
} else {
Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
if (schedule == null) {
logger.error("failed to update schedule event " + scheduleEvent.getName() + " schedule "
+ scheduleEvent.getSchedule() + " not found");
} else {
// see if the event switched schedules
if (scheduleId != schedule.getId()) {
if (!scheduleIdToScheduleContextMap.containsKey(scheduleId)) {
logger.error("failed to switch schedule event " + scheduleEvent.getId()
+ ", schedule " + scheduleId + " not found");
} else {
// remove the schedule event from the old schedule
removeScheduleEventById(scheduleEvent.getId());
// add the schedule event to the new schedule
addScheduleEventToScheduleContext(scheduleEvent);
}
} else {
// update the schedule event in place
if (!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
logger.error("failed to update schedule event " + scheduleEvent.getId()
+ ", schedule " + schedule.getId() + " not found");
} else {
// update the schedule event in the context
scheduleIdToScheduleContextMap.get(schedule.getId())
.updateScheduleEvent(scheduleEvent);
}
}
}
}
}
}