KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. The ASF licenses this file to You
4  * under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. For additional information regarding
15  * copyright in this work, please see the NOTICE file in the top level
16  * directory of this distribution.
17  */

18 package org.apache.roller.model;
19
20 import java.io.Serializable JavaDoc;
21 import java.util.Date JavaDoc;
22 import java.util.Iterator JavaDoc;
23 import java.util.List JavaDoc;
24
25 import org.apache.roller.RollerException;
26 import org.apache.roller.pojos.PlanetConfigData;
27 import org.apache.roller.pojos.PlanetEntryData;
28 import org.apache.roller.pojos.PlanetGroupData;
29 import org.apache.roller.pojos.PlanetSubscriptionData;
30
31 /**
32  * Manages groups and subscriptions, can return aggregation for any group.
33  * @author David M Johnson
34  */

35 public interface PlanetManager extends Serializable JavaDoc {
36     
37     //------------------------------------------------------------------ create
38

39     /**
40      * Save configration
41      */

42     public void saveConfiguration(PlanetConfigData config)
43     throws RollerException;
44     
45     /**
46      * Save new or update existing entry
47      */

48     public void saveEntry(PlanetEntryData entry) throws RollerException;
49     
50     /**
51      * Save new or update existing a group
52      */

53     public void saveGroup(PlanetGroupData sub) throws RollerException;
54     
55     /**
56      * Save or update a subscription
57      */

58     public void saveSubscription(PlanetSubscriptionData sub)
59     throws RollerException;
60     
61     //---------------------------------------------------------------- retrieve
62

63     /**
64      * Get the one planet config object, config has default group
65      */

66     public PlanetConfigData getConfiguration() throws RollerException;
67     
68     /**
69      * Get handles for all defined groups
70      */

71     public List JavaDoc getGroupHandles() throws RollerException;
72     
73     /**
74      * Get list of group objects
75      */

76     public List JavaDoc getGroups() throws RollerException;
77     
78     /**
79      * Get group by handle, group has subscriptions
80      */

81     public PlanetGroupData getGroup(String JavaDoc handle) throws RollerException;
82     
83     /**
84      * Get group by ID rather than handle.
85      */

86     public PlanetGroupData getGroupById(String JavaDoc id) throws RollerException;
87     
88     /**
89      * Get subscription by feedUrl.
90      */

91     public PlanetSubscriptionData getSubscription(String JavaDoc feedUrl)
92     throws RollerException;
93     
94     /**
95      * Get subscription by ID rather than feedUrl.
96      */

97     public PlanetSubscriptionData getSubscriptionById(String JavaDoc id)
98     throws RollerException;
99     
100     /**
101      * Get all subscriptions.
102      */

103     public Iterator JavaDoc getAllSubscriptions() throws RollerException;
104     
105     /**
106      * Get total number of subscriptions.
107      */

108     public int getSubscriptionCount() throws RollerException;
109     
110     /**
111      * Get top X subscriptions.
112      */

113     public List JavaDoc getTopSubscriptions(int offset, int len) throws RollerException;
114     
115     /**
116      * Get top X subscriptions, restricted by group.
117      */

118     public List JavaDoc getTopSubscriptions(
119             String JavaDoc groupHandle, int offset, int len) throws RollerException;
120     
121     /**
122      * Get entries in a single feed as list of PlanetEntryData objects.
123      */

124     public List JavaDoc getFeedEntries(
125             String JavaDoc feedUrl, int offset, int len) throws RollerException;
126     
127     //------------------------------------------------------------ aggregations
128

129     /**
130      * Get agggration for group from cache, enries in reverse chonological order.
131      * Respects category constraints of group.
132      * @param group Restrict to entries from one subscription group.
133      * @param offset Offset into results (for paging)
134      * @param len Maximum number of results to return (for paging)
135      */

136     public List JavaDoc getAggregation(
137             PlanetGroupData group, Date JavaDoc startDate, Date JavaDoc endDate,
138             int offset, int len) throws RollerException;
139     
140     public List JavaDoc getAggregation(
141             int offset, int len) throws RollerException;
142     
143     public List JavaDoc getAggregation(
144             PlanetGroupData group, int offset, int len) throws RollerException;
145     
146     /**
147      * Get agggration from cache, enries in reverse chonological order.
148      * @param offset Offset into results (for paging)
149      * @param len Maximum number of results to return (for paging)
150      */

151     public List JavaDoc getAggregation(Date JavaDoc startDate, Date JavaDoc endDate,
152             int offset, int len) throws RollerException;
153     
154     //------------------------------------------------------------------ update
155

156     /** Refresh entry data by fetching and parsing feeds. */
157     public void refreshEntries() throws RollerException;
158     
159     //------------------------------------------------------------------ delete
160

161     /** Delete group and any subscriptions that are orphaned. */
162     public void deleteGroup(PlanetGroupData group) throws RollerException;
163     
164     /** Delete subscription, remove it from groups, cache, etc. */
165     public void deleteSubscription(PlanetSubscriptionData group)
166     throws RollerException;
167     
168     /** Delete entry. */
169     public void deleteEntry(PlanetEntryData entry) throws RollerException;
170     
171     /** Clear any aggregations and update times that have been cached */
172     public void clearCachedAggregations();
173     
174     /** Get last update time for entries most recent 'all' aggregation */
175     public Date JavaDoc getLastUpdated();
176     
177     /** Get last updated time for entries in a specify group */
178     public Date JavaDoc getLastUpdated(PlanetGroupData group);
179 }
180
181
Popular Tags