本文整理汇总了Java中com.google.api.services.calendar.model.CalendarListEntry.getId方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarListEntry.getId方法的具体用法?Java CalendarListEntry.getId怎么用?Java CalendarListEntry.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.api.services.calendar.model.CalendarListEntry
的用法示例。
在下文中一共展示了CalendarListEntry.getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCalendar
import com.google.api.services.calendar.model.CalendarListEntry; //导入方法依赖的package包/类
/**
* retrieves the calendar for the given name (summary)
*
* @return den Kalender
*/
private com.google.api.services.calendar.model.Calendar getCalendar() {
if (calendar == null) {
final com.google.api.services.calendar.Calendar myService = settings.getGoogleCalendarService();
try {
final CalendarList list = myService.calendarList().list().execute();
for (final CalendarListEntry entry : list.getItems()) {
if (settings.getGoogleCalendarName().equals(entry.getSummary())) {
final String id = entry.getId();
calendar = myService.calendars().get(id).execute();
break;
}
}
} catch (final IOException e) {
throw new SynchronisationException(e);
}
if (calendar == null) {
// calendar with given name does not exist
throw new SynchronisationException(UserMessage.get().GOOGLE_CALENDAR_S_DOES_NOT_EXIST_CHECK_CONFIG(settings.getGoogleCalendarName()));
}
}
return calendar;
}
示例2: updateCalendar
import com.google.api.services.calendar.model.CalendarListEntry; //导入方法依赖的package包/类
private void updateCalendar(Map<Thermostat, SortedMap<Period, ZoneStatus>> ts2schedule, Calendar calendarClient, CalendarListEntry calendar) {
NDC.push("updateCalendar");
Marker m = new Marker("updateCalendar");
try {
String name = calendar.getSummary();
Set<Thermostat> tSet = getByName(name);
if (tSet == null || tSet.isEmpty()) {
logger.debug("No zone '" + name + "' configured, skipped");
return;
}
logger.info("Zone name: " + name);
String id = calendar.getId();
logger.info("id: " + id);
parseEvents(ts2schedule, tSet, calendarClient, id);
} catch (IOException ex) {
logger.error("Unable to retrieve schedule for '" + calendar.getSummary() + "'", ex);
} finally {
m.close();
NDC.pop();
}
}