diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-17 13:21:30 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-17 13:21:30 +0000 |
commit | 1099bc9633be66080426a8683b702c3739318fcb (patch) | |
tree | 1a5e6a25020a1e1762fcc5d901d795eea97459dc /collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java | |
parent | 2189f061bea7839dfd33f8c9d78eb8c93e760e4d (diff) |
TUSCANY-3522: Commit the twitapp program Eranda Sooriyabandara has attached as part of the GSoC project Develop a 'NoSQL' Datastore component for Apache Cassandra, CouchDB, Hadoop/Hbase
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1104231 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java')
-rw-r--r-- | collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java b/collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java new file mode 100644 index 0000000000..0ce20feeba --- /dev/null +++ b/collaboration/GSoC-2011-Eranda/twitapp/src/main/java/twitapp/services/AppManager.java @@ -0,0 +1,39 @@ +package main.java.twitapp.services;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class AppManager {
+
+ private User user;
+ private UserBase userBase;
+
+ public AppManager(String userId){
+ userBase = UserBase.getInstance();
+ user = userBase.get(userId);
+ }
+
+ public void twit(String twit){
+ user.setTwit(new Twit(twit));
+ }
+
+ public void follow(String followId){
+ user.setFollower(userBase.get(followId));
+ }
+
+ public Iterator<User> getFollowers(){
+ ArrayList<User> users = user.getFollowers();
+ return users.iterator();
+ }
+
+ public Iterator<Twit> getTwits(){
+ ArrayList<Twit> twits = user.getTwits();
+ return twits.iterator();
+ }
+
+ public Iterator<Twit> getFollowerTwits(String followeId){
+ ArrayList<Twit> followerTwits= userBase.get(followeId).getTwits();
+ return followerTwits.iterator();
+ }
+
+}
|