当前位置: 首页>>代码示例>>Java>>正文


Java Schedule.getId方法代码示例

本文整理汇总了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);
					}
				}
			}
		}
	}
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:39,代码来源:Scheduler.java

示例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);
          }
        }
      }
    }
  }
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:40,代码来源:Scheduler.java


注:本文中的org.edgexfoundry.domain.meta.Schedule.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。