public static void addDatabaseSourceId(IMemento memento) { if (memento != null) { try { memento.putString(MEMENTO_SOURCE_GUID, OseeInfo.getDatabaseGuid()); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.WARNING, "Unable to set memento source db guid"); } } }
public static boolean isSourceValid(IMemento memento) throws OseeCoreException { boolean result = false; if (memento != null) { String dbId = memento.getString(MEMENTO_SOURCE_GUID); if (Strings.isValid(dbId)) { String currentDbId = null; try { currentDbId = OseeInfo.getDatabaseGuid(); } catch (OseeDataStoreException ex) { OseeLog.log(Activator.class, Level.WARNING, "Unable to set memento source db guid"); } if (dbId.equals(currentDbId)) { result = true; } } } return result; }