001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. The ASF licenses this file to You
004: * under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License. For additional information regarding
015: * copyright in this work, please see the NOTICE file in the top level
016: * directory of this distribution.
017: */
018:
019: package org.apache.roller.business.pings;
020:
021: import java.util.Collection;
022: import java.util.List;
023: import org.apache.roller.RollerException;
024: import org.apache.roller.pojos.AutoPingData;
025: import org.apache.roller.pojos.PingTargetData;
026: import org.apache.roller.pojos.WeblogEntryData;
027: import org.apache.roller.pojos.WebsiteData;
028:
029: /**
030: * Manages autoping storage/retrieval, queries and queue.
031: */
032: public interface AutoPingManager {
033:
034: /**
035: * Store an auto ping configuration.
036: *
037: * @param autoPing the auto ping configuration
038: * @throws RollerException
039: */
040: public void saveAutoPing(AutoPingData autoPing)
041: throws RollerException;
042:
043: /**
044: * Remove the auto ping configuration with given id.
045: *
046: * @param autoPing the auto ping configuration to remove
047: * @throws RollerException
048: */
049: public void removeAutoPing(AutoPingData autoPing)
050: throws RollerException;
051:
052: /**
053: * Remove the auto ping configuration for the given ping target and website, if one exists. Returns silently if it
054: * doesn't exist.
055: *
056: * @param pingTarget the ping target
057: * @param website the website
058: * @throws RollerException
059: */
060: public void removeAutoPing(PingTargetData pingTarget,
061: WebsiteData website) throws RollerException;
062:
063: /**
064: * Remove a collection of auto ping configurations.
065: *
066: * @param autopings a <code>Collection</code> of <code>AutoPingData</code> objects
067: * @throws RollerException
068: */
069: public void removeAutoPings(Collection autopings)
070: throws RollerException;
071:
072: /**
073: * Remove all auto ping configurations for all websites.
074: *
075: * @throws RollerException
076: */
077: public void removeAllAutoPings() throws RollerException;
078:
079: /**
080: * Retrieve an auto ping configuration by id.
081: *
082: * @param id the id of the auto ping configuration to retrieve.
083: * @return the auto ping configuration with specified id or null if not found
084: * @throws RollerException
085: */
086: public AutoPingData getAutoPing(String id) throws RollerException;
087:
088: /**
089: * Get all of the auto ping configurations for the given website.
090: *
091: * @param website
092: * @return a list of auto ping configurations for the given website as <code>AutoPingData</code> objects.
093: */
094: public List getAutoPingsByWebsite(WebsiteData website)
095: throws RollerException;
096:
097: /**
098: * Get all of the auto ping configurations for a given target (across all websites).
099: *
100: * @param pingTarget
101: * @return a list of auto ping configurations for the given target as <code>AutoPingData</code> objects.
102: */
103: public List getAutoPingsByTarget(PingTargetData pingTarget)
104: throws RollerException;
105:
106: /**
107: * Get the auto ping configurations that should be pinged upon creation/change of the given weblog entry.
108: *
109: * @param changedWeblogEntry the entry that has been created or changed
110: * @return a list of the ping configurations that should be applied due to this change
111: */
112: public List getApplicableAutoPings(
113: WeblogEntryData changedWeblogEntry) throws RollerException;
114:
115: /**
116: * Queue the auto ping configurations that should be pinged upon change to the given weblog entry. This calls the
117: * {@link PingQueueManager} to queue ping requests for each ping configuration that should be applied on change to
118: * the given weblog entry. If ping processing is suspended, this returns without doing anything.
119: *
120: * @param changedWeblogEntry the entry that has been created or changed
121: */
122: public void queueApplicableAutoPings(
123: WeblogEntryData changedWeblogEntry) throws RollerException;
124:
125: /**
126: * Get the category restrictions on the given auto ping configuration.
127: *
128: * @param autoPing
129: * @return the category restrictions as a collection of <code>WeblogCategoryData</code> objects. This collection
130: * will be empty if there are no restrictions (meaning that the auto ping configuration applies to changes
131: * in any category of the website).
132: */
133: public List getCategoryRestrictions(AutoPingData autoPing)
134: throws RollerException;
135:
136: /**
137: * Set the category restrictions on the given ping configuration to the specified ones. If the new collection is
138: * empty, all category restrictions are removed.
139: *
140: * @param autoPing auto ping configuration to change
141: * @param newCategories a collection of <code>WeblogCategoryData</code> objects for the new category restrictions
142: */
143: public void setCategoryRestrictions(AutoPingData autoPing,
144: Collection newCategories);
145:
146: /**
147: * Release all resources associated with Roller session.
148: */
149: public void release();
150:
151: }
|