KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (c) 2005
3  * Anil R. Gangolli. All rights reserved.
4  *
5  * Distributed with the Roller Weblogger Project under the terms of the Roller Software
6  * License
7  */

8
9 package org.roller.model;
10
11 import org.roller.pojos.AutoPingData;
12 import org.roller.pojos.PingTargetData;
13 import org.roller.pojos.WebsiteData;
14 import org.roller.pojos.WeblogEntryData;
15 import org.roller.RollerException;
16
17 import java.io.Serializable JavaDoc;
18 import java.util.Collection JavaDoc;
19 import java.util.List JavaDoc;
20
21 /**
22  * Manages autoping storage/retrieval, queries and queue.
23  */

24 public interface AutoPingManager extends Serializable JavaDoc
25 {
26     /**
27      * Release all resources associated with Roller session.
28      */

29     public void release();
30
31     /**
32      * Create an auto ping configuration specifying that the given ping target is to be pinged when the given website
33      * changes.
34      * @param pingTarget target to ping
35      * @param website website whose changes should trigger the ping
36      * @return new auto ping configuration
37      * @throws RollerException
38      */

39     public AutoPingData createAutoPing(PingTargetData pingTarget, WebsiteData website)
40         throws RollerException;
41
42     /*
43      * Create an auto ping configuration specifying that the given pingTarget is to be pinged when the
44      * given website changes, but only for changes on one of the specified categories of that website.
45      * If the collection of categories is empty, this has the same effect as creating an unrestricted
46      * auto ping configuration.
47      *
48      * @param pingTarget
49      * @param website website whose changes should trigger the ping (subject to category restrictions)
50      * @param categories categories in which changes should trigger the ping
51      * @return new auto ping configuration
52      * @throws RollerException
53
54     public AutoPingData createAutoPing(PingTargetData pingTarget,
55                                            WebsiteData website,
56                                            Collection categories) throws RollerException;
57     */

58
59     /**
60      * Retrieve an auto ping configuration by id.
61      *
62      * @param id the id of the auto ping configuration to retrieve.
63      * @return the auto ping configuration with specified id or null if not found
64      * @throws RollerException
65      */

66     public AutoPingData retrieveAutoPing(String JavaDoc id) throws RollerException;
67
68     /**
69      * Store an auto ping configuration.
70      *
71      * @param autoPing the auto ping configuration
72      * @throws RollerException
73      */

74     public void storeAutoPing(AutoPingData autoPing) throws RollerException;
75
76     /**
77      * Remove the auto ping configuration with given id.
78      *
79      * @param id the id of the auto ping configuration to remove
80      * @throws RollerException
81      */

82     public void removeAutoPing(String JavaDoc id) throws RollerException;
83
84     /**
85      * Remove the auto ping configuration with given id.
86      *
87      * @param autoPing the auto ping configuration to remove
88      * @throws RollerException
89      */

90     public void removeAutoPing(AutoPingData autoPing) throws RollerException;
91
92     /**
93      * Remove the auto ping configuration for the given ping target and website, if one exists. Returns silently if it
94      * doesn't exist.
95      *
96      * @param pingTarget the ping target
97      * @param website the website
98      * @throws RollerException
99      */

100     public void removeAutoPing(PingTargetData pingTarget, WebsiteData website) throws RollerException;
101
102     /**
103      * Remove a collection of auto ping configurations.
104      *
105      * @param autopings a <code>Collection</code> of <code>AutoPingData</code> objects
106      * @throws RollerException
107      */

108     public void removeAutoPings(Collection JavaDoc autopings) throws RollerException;
109
110     /**
111      * Remove all auto ping configurations for all websites.
112      *
113      * @throws RollerException
114      */

115     public void removeAllAutoPings() throws RollerException;
116
117     /**
118      * Get all of the auto ping configurations for the given website.
119      *
120      * @param website
121      * @return a list of auto ping configurations for the given website as <code>AutoPingData</code> objects.
122      */

123     public List JavaDoc getAutoPingsByWebsite(WebsiteData website) throws RollerException;
124
125     /**
126      * Get all of the auto ping configurations for a given target (across all websites).
127      *
128      * @param pingTarget
129      * @return a list of auto ping configurations for the given target as <code>AutoPingData</code> objects.
130      */

131     public List JavaDoc getAutoPingsByTarget(PingTargetData pingTarget) throws RollerException;
132
133     /**
134      * Get the category restrictions on the given auto ping configuration.
135      *
136      * @param autoPing
137      * @return the category restrictions as a collection of <code>WeblogCategoryData</code> objects. This collection
138      * will be empty if there are no restrictions (meaning that the auto ping configuration applies to changes
139      * in any category of the website).
140      */

141     public List JavaDoc getCategoryRestrictions(AutoPingData autoPing) throws RollerException;
142
143     /**
144      * Set the category restrictions on the given ping configuration to the specified ones. If the new collection is
145      * empty, all category restrictions are removed.
146      *
147      * @param autoPing auto ping configuration to change
148      * @param newCategories a collection of <code>WeblogCategoryData</code> objects for the new category restrictions
149      */

150     public void setCategoryRestrictions(AutoPingData autoPing,
151                                         Collection JavaDoc newCategories);
152
153     /**
154      * Get the auto ping configurations that should be pinged upon creation/change of the given weblog entry.
155      *
156      * @param changedWeblogEntry the entry that has been created or changed
157      * @return a list of the ping configurations that should be applied due to this change
158      */

159     public List JavaDoc getApplicableAutoPings(WeblogEntryData changedWeblogEntry) throws RollerException;
160
161     /**
162      * Queue the auto ping configurations that should be pinged upon change to the given weblog entry. This calls the
163      * {@link PingQueueManager} to queue ping requests for each ping configuration that should be applied on change to
164      * the given weblog entry. If ping processing is suspended, this returns without doing anything.
165      *
166      * @param changedWeblogEntry the entry that has been created or changed
167      */

168     public void queueApplicableAutoPings(WeblogEntryData changedWeblogEntry) throws RollerException;
169 }
170
Popular Tags