List of usage examples for com.vaadin.v7.data.util HierarchicalContainer getItemIds
public Collection<?> getItemIds();
From source file:org.esn.esobase.jobs.SyncAbilityDescriptionsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsAbilityDescription> items = docsService.getAbilityDescriptions(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getAbilityDescriptionsDiff(items, hc); List<AbilityDescriptionsDiff> diffs = (List<AbilityDescriptionsDiff>) hc.getItemIds(); List<GSpreadSheetsAbilityDescription> itemsToSh = new ArrayList<>(); List<GSpreadSheetsAbilityDescription> itemsToDb = new ArrayList<>(); for (AbilityDescriptionsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }//w w w .j a va 2s.co m } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadAbilityDescriptions(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveAbilityDescriptions(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncAchievementDescriptionsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsAchievementDescription> items = docsService.getAchievementDescriptions(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getAchievementDescriptionsDiff(items, hc); List<AchievementDescriptionsDiff> diffs = (List<AchievementDescriptionsDiff>) hc.getItemIds(); List<GSpreadSheetsAchievementDescription> itemsToSh = new ArrayList<>(); List<GSpreadSheetsAchievementDescription> itemsToDb = new ArrayList<>(); for (AchievementDescriptionsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }// ww w . ja va 2 s .c o m } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadAchievementDescriptions(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveAchievementDescriptions(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncAchievementsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsAchievement> items = docsService.getAchievements(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getAchievementsDiff(items, hc); List<AchievementsDiff> diffs = (List<AchievementsDiff>) hc.getItemIds(); List<GSpreadSheetsAchievement> itemsToSh = new ArrayList<>(); List<GSpreadSheetsAchievement> itemsToDb = new ArrayList<>(); for (AchievementsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }/* w ww. j a va 2s . c o m*/ } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadAchievements(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveAchievements(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncActivatorsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsActivator> items = docsService.getActivators(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getActivatorsDiff(items, hc); List<ActivatorsDiff> diffs = (List<ActivatorsDiff>) hc.getItemIds(); List<GSpreadSheetsActivator> itemsToSh = new ArrayList<>(); List<GSpreadSheetsActivator> itemsToDb = new ArrayList<>(); for (ActivatorsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }//w w w .jav a 2 s . c o m } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadActivators(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveActivators(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncCollectibleDescriptionsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsCollectibleDescription> items = docsService.getCollectibleDescriptions(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getCollectibleDescriptionsDiff(items, hc); List<CollectibleDescriptionsDiff> diffs = (List<CollectibleDescriptionsDiff>) hc.getItemIds(); List<GSpreadSheetsCollectibleDescription> itemsToSh = new ArrayList<>(); List<GSpreadSheetsCollectibleDescription> itemsToDb = new ArrayList<>(); for (CollectibleDescriptionsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }/*from w w w. ja va2 s .c om*/ } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadCollectibleDescriptions(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveCollectibleDescriptions(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncCollectiblesJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsCollectible> items = docsService.getCollectibles(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getCollectiblesDiff(items, hc); List<CollectiblesDiff> diffs = (List<CollectiblesDiff>) hc.getItemIds(); List<GSpreadSheetsCollectible> itemsToSh = new ArrayList<>(); List<GSpreadSheetsCollectible> itemsToDb = new ArrayList<>(); for (CollectiblesDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }/*from w ww .j av a2 s .co m*/ } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadCollectibles(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveCollectibles(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncItemDescriptionsJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsItemDescription> items = docsService.getItemDescriptions(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getItemDescriptionsDiff(items, hc); List<ItemDescriptionsDiff> diffs = (List<ItemDescriptionsDiff>) hc.getItemIds(); List<GSpreadSheetsItemDescription> itemsToSh = new ArrayList<>(); List<GSpreadSheetsItemDescription> itemsToDb = new ArrayList<>(); for (ItemDescriptionsDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }/*from w w w .ja v a 2s . c o m*/ } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadItemDescriptions(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveItemDescriptions(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncItemNamesJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsItemName> items = docsService.getItemNames(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getItemNamesDiff(items, hc); List<ItemNamesDiff> diffs = (List<ItemNamesDiff>) hc.getItemIds(); List<GSpreadSheetsItemName> itemsToSh = new ArrayList<>(); List<GSpreadSheetsItemName> itemsToDb = new ArrayList<>(); for (ItemNamesDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }// w ww . j a v a2 s .com } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadItemNames(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveItemNames(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncJournalEntriesJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsJournalEntry> items = docsService.getJournaleEntries(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getJournalEntriesDiff(items, hc); List<JournalEntriesDiff> diffs = (List<JournalEntriesDiff>) hc.getItemIds(); List<GSpreadSheetsJournalEntry> itemsToSh = new ArrayList<>(); List<GSpreadSheetsJournalEntry> itemsToDb = new ArrayList<>(); for (JournalEntriesDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }/* w w w . j a v a2 s . c o m*/ } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadJournalEntries(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveJournalEntries(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }
From source file:org.esn.esobase.jobs.SyncLoadscreensJob.java
@Scheduled(fixedDelay = 1800000, initialDelay = 2000) public void execute() throws OriginalTextMismatchException { if (dbService.getIsAutoSynchronizationEnabled()) { LOG.info(TABLE_NAME + ": automatic sync enabled"); HierarchicalContainer hc = new HierarchicalContainer(); hc.addContainerProperty("shText", String.class, null); hc.addContainerProperty("shNic", String.class, null); hc.addContainerProperty("shDate", Date.class, null); hc.addContainerProperty("dbText", String.class, null); hc.addContainerProperty("dbNic", String.class, null); hc.addContainerProperty("dbDate", Date.class, null); hc.addContainerProperty("syncType", String.class, null); LOG.info("loading " + TABLE_NAME); List<GSpreadSheetsLoadscreen> items = docsService.getLoadscreens(); LOG.info("making diff for " + TABLE_NAME); hc = dbService.getLoadscreensDiff(items, hc); List<LoadscreensDiff> diffs = (List<LoadscreensDiff>) hc.getItemIds(); List<GSpreadSheetsLoadscreen> itemsToSh = new ArrayList<>(); List<GSpreadSheetsLoadscreen> itemsToDb = new ArrayList<>(); for (LoadscreensDiff diff : diffs) { if (diff.getSyncType() == SYNC_TYPE.TO_SPREADSHEET) { itemsToSh.add(diff.getDbName()); } else if (diff.getSyncType() == SYNC_TYPE.TO_DB) { itemsToDb.add(diff.getSpreadsheetsName()); }//from w w w. j a v a2 s . c o m } LOG.log(Level.INFO, "uploading {0}" + " " + TABLE_NAME, itemsToSh.size()); docsService.uploadLoadscreens(itemsToSh); LOG.log(Level.INFO, "saving to db {0}" + " " + TABLE_NAME, itemsToDb.size()); dbService.saveLoadscreens(itemsToDb); LOG.info("sync finished for " + TABLE_NAME); hc.removeAllItems(); } else { LOG.info(TABLE_NAME + ": automatic sync disabled"); } }