KickJava   Java API By Example, From Geeks To Geeks.

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


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
19 package org.apache.roller.model;
20
21 import java.util.Collection JavaDoc;
22 import java.util.List JavaDoc;
23 import org.apache.roller.RollerException;
24 import org.apache.roller.pojos.AutoPingData;
25 import org.apache.roller.pojos.PingTargetData;
26 import org.apache.roller.pojos.WeblogEntryData;
27 import org.apache.roller.pojos.WebsiteData;
28
29
30 /**
31  * Manages autoping storage/retrieval, queries and queue.
32  */

33 public interface AutoPingManager {
34     
35     
36     /**
37      * Store an auto ping configuration.
38      *
39      * @param autoPing the auto ping configuration
40      * @throws RollerException
41      */

42     public void saveAutoPing(AutoPingData autoPing) throws RollerException;
43     
44     
45     /**
46      * Remove the auto ping configuration with given id.
47      *
48      * @param autoPing the auto ping configuration to remove
49      * @throws RollerException
50      */

51     public void removeAutoPing(AutoPingData autoPing) throws RollerException;
52     
53     
54     /**
55      * Remove the auto ping configuration for the given ping target and website, if one exists. Returns silently if it
56      * doesn't exist.
57      *
58      * @param pingTarget the ping target
59      * @param website the website
60      * @throws RollerException
61      */

62     public void removeAutoPing(PingTargetData pingTarget, WebsiteData website) throws RollerException;
63     
64     
65     /**
66      * Remove a collection of auto ping configurations.
67      *
68      * @param autopings a <code>Collection</code> of <code>AutoPingData</code> objects
69      * @throws RollerException
70      */

71     public void removeAutoPings(Collection JavaDoc autopings) throws RollerException;
72     
73     
74     /**
75      * Remove all auto ping configurations for all websites.
76      *
77      * @throws RollerException
78      */

79     public void removeAllAutoPings() throws RollerException;
80     
81     
82     /**
83      * Retrieve an auto ping configuration by id.
84      *
85      * @param id the id of the auto ping configuration to retrieve.
86      * @return the auto ping configuration with specified id or null if not found
87      * @throws RollerException
88      */

89     public AutoPingData getAutoPing(String JavaDoc id) throws RollerException;
90     
91     
92     /**
93      * Get all of the auto ping configurations for the given website.
94      *
95      * @param website
96      * @return a list of auto ping configurations for the given website as <code>AutoPingData</code> objects.
97      */

98     public List JavaDoc getAutoPingsByWebsite(WebsiteData website) throws RollerException;
99     
100     
101     /**
102      * Get all of the auto ping configurations for a given target (across all websites).
103      *
104      * @param pingTarget
105      * @return a list of auto ping configurations for the given target as <code>AutoPingData</code> objects.
106      */

107     public List JavaDoc getAutoPingsByTarget(PingTargetData pingTarget) throws RollerException;
108     
109     
110     /**
111      * Get the auto ping configurations that should be pinged upon creation/change of the given weblog entry.
112      *
113      * @param changedWeblogEntry the entry that has been created or changed
114      * @return a list of the ping configurations that should be applied due to this change
115      */

116     public List JavaDoc getApplicableAutoPings(WeblogEntryData changedWeblogEntry) throws RollerException;
117     
118     
119     /**
120      * Queue the auto ping configurations that should be pinged upon change to the given weblog entry. This calls the
121      * {@link PingQueueManager} to queue ping requests for each ping configuration that should be applied on change to
122      * the given weblog entry. If ping processing is suspended, this returns without doing anything.
123      *
124      * @param changedWeblogEntry the entry that has been created or changed
125      */

126     public void queueApplicableAutoPings(WeblogEntryData changedWeblogEntry) throws RollerException;
127     
128     
129     /**
130      * Get the category restrictions on the given auto ping configuration.
131      *
132      * @param autoPing
133      * @return the category restrictions as a collection of <code>WeblogCategoryData</code> objects. This collection
134      * will be empty if there are no restrictions (meaning that the auto ping configuration applies to changes
135      * in any category of the website).
136      */

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

147     public void setCategoryRestrictions(AutoPingData autoPing,
148             Collection JavaDoc newCategories);
149     
150     
151     /**
152      * Release all resources associated with Roller session.
153      */

154     public void release();
155     
156 }
157
Popular Tags