diff options
author | Simon Rettberg | 2015-06-16 18:22:54 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-06-16 18:22:54 +0200 |
commit | 9085dcdcb35ae1f9e3a592c8cd5dfecdd4e9bde1 (patch) | |
tree | b7fb7612f4319943426d8ca30d1a8a7fb68b4208 /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java | |
parent | [server] On mah way (lots of restructuring, some early db classes, sql dump o... (diff) | |
download | tutor-module-9085dcdcb35ae1f9e3a592c8cd5dfecdd4e9bde1.tar.gz tutor-module-9085dcdcb35ae1f9e3a592c8cd5dfecdd4e9bde1.tar.xz tutor-module-9085dcdcb35ae1f9e3a592c8cd5dfecdd4e9bde1.zip |
[server] Add script field to lecture table; implement getImageDetails method to get detailed information about an image from the database
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java index 8db7e7e5..e012e5e2 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java @@ -1,9 +1,11 @@ package org.openslx.bwlp.sat.thrift.cache; import java.util.List; +import java.util.TimerTask; import org.apache.thrift.TException; import org.openslx.bwlp.sat.database.mappers.DbOrganization; +import org.openslx.bwlp.sat.util.QuickTimer; import org.openslx.bwlp.thrift.iface.Organization; import org.openslx.thrifthelper.ThriftManager; @@ -11,7 +13,7 @@ import org.openslx.thrifthelper.ThriftManager; * Holds the list of all known organizations. The list is synchronized with * the master server. */ -public class OrganizationList extends CachedList<Organization> { +public class OrganizationList extends CacheBase<List<Organization>> { private static final OrganizationList instance = new OrganizationList(); @@ -21,8 +23,14 @@ public class OrganizationList extends CachedList<Organization> { @Override protected List<Organization> getCallback() throws TException { - List<Organization> organizations = ThriftManager.getMasterClient().getOrganizations(); - DbOrganization.storeOrganizations(organizations); + final List<Organization> organizations = ThriftManager.getMasterClient().getOrganizations(); + // Also store the list in the local data base (asynchronous, in the timer thread) + QuickTimer.scheduleOnce(new TimerTask() { + @Override + public void run() { + DbOrganization.storeOrganizations(organizations); + } + }); return organizations; } |