KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > model > PlanetManager


1 package org.roller.model;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.Iterator JavaDoc;
6 import java.util.List JavaDoc;
7
8 import org.roller.RollerException;
9 import org.roller.pojos.PlanetConfigData;
10 import org.roller.pojos.PlanetEntryData;
11 import org.roller.pojos.PlanetGroupData;
12 import org.roller.pojos.PlanetSubscriptionData;
13
14 /**
15  * Manages groups and subscriptions, can return aggregation for any group.
16  * @author David M Johnson
17  */

18 public interface PlanetManager extends Serializable JavaDoc
19 {
20     //------------------------------------------------------------------ create
21

22     /**
23      * Save configration
24      */

25     public void saveConfiguration(PlanetConfigData config)
26         throws RollerException;
27     
28     /**
29      * Save new or update existing entry
30      */

31     public void saveEntry(PlanetEntryData entry) throws RollerException;
32
33     /**
34      * Save new or update existing a group
35      */

36     public void saveGroup(PlanetGroupData sub) throws RollerException;
37     
38     /**
39      * Save or update a subscription
40      */

41     public void saveSubscription(PlanetSubscriptionData sub)
42         throws RollerException;
43     
44     //---------------------------------------------------------------- retrieve
45

46     /**
47      * Get the one planet config object, config has default group
48      */

49     public PlanetConfigData getConfiguration() throws RollerException;
50     
51     /**
52      * Get handles for all defined groups
53      */

54     public List JavaDoc getGroupHandles() throws RollerException;
55     
56     /**
57      * Get list of group objects
58      */

59     public List JavaDoc getGroups() throws RollerException;
60     
61     /**
62      * Get group by handle, group has subscriptions
63      */

64     public PlanetGroupData getGroup(String JavaDoc handle) throws RollerException;
65     
66     /**
67      * Get group by ID rather than handle.
68      */

69     public PlanetGroupData getGroupById(String JavaDoc id) throws RollerException;
70     
71     /**
72      * Get subscription by feedUrl.
73      */

74     public PlanetSubscriptionData getSubscription(String JavaDoc feedUrl)
75         throws RollerException;
76
77     /**
78      * Get subscription by ID rather than feedUrl.
79      */

80     public PlanetSubscriptionData getSubscriptionById(String JavaDoc id)
81         throws RollerException;
82     
83     /**
84      * Get all subscriptions.
85      */

86     public Iterator JavaDoc getAllSubscriptions() throws RollerException;
87     
88     /**
89      * Get total number of subscriptions.
90      */

91     public int getSubscriptionCount() throws RollerException;
92     
93     /**
94      * Get top X subscriptions.
95      */

96     public List JavaDoc getTopSubscriptions(int max) throws RollerException;
97
98     /**
99      * Get top X subscriptions, restricted by group.
100      */

101     public List JavaDoc getTopSubscriptions(
102         PlanetGroupData group, int max) throws RollerException;
103
104     //------------------------------------------------------------ aggregations
105

106     /**
107      * Get agggration for group from cache, enries in
108      * reverse chonological order.
109      * Respects category constraints of group.
110      * @param group
111      * @param maxEntries Maximum number of entries to return.
112      */

113     public List JavaDoc getAggregation(
114         PlanetGroupData group, int maxEntries) throws RollerException;
115     
116     /**
117      * Get agggration from cache, enries in reverse chonological order.
118      * @param maxEntries Maximum number of entries to return.
119      */

120     public List JavaDoc getAggregation(int maxEntries) throws RollerException;
121     
122     //------------------------------------------------------------------ update
123

124     /** Refresh entry data by fetching and parsing feeds. */
125     public void refreshEntries() throws RollerException;
126     
127     //------------------------------------------------------------------ delete
128

129     /** Delete group and any subscriptions that are orphaned. */
130     public void deleteGroup(PlanetGroupData group) throws RollerException;
131     
132     /** Delete subscription, remove it from groups, cache, etc. */
133     public void deleteSubscription(PlanetSubscriptionData group)
134         throws RollerException;
135     
136     /** Delete entry. */
137     public void deleteEntry(PlanetEntryData entry) throws RollerException;
138
139     /** Clear any aggregations and update times that have been cached */
140     public void clearCachedAggregations();
141     
142     /** Get last update time for entries most recent 'all' aggregation */
143     public Date JavaDoc getLastUpdated();
144     
145     /** Get last updated time for entries in a specify group */
146     public Date JavaDoc getLastUpdated(PlanetGroupData group);
147 }
148
149
Popular Tags