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.referrers;
020:
021: import java.util.List;
022: import org.apache.roller.RollerException;
023: import org.apache.roller.pojos.RefererData;
024: import org.apache.roller.pojos.WebsiteData;
025:
026: /**
027: * Interface to Referer management.
028: */
029: public interface RefererManager {
030:
031: /**
032: * Store the referer.
033: */
034: public void saveReferer(RefererData referer) throws RollerException;
035:
036: /**
037: * Remove a single referer.
038: */
039: public void removeReferer(RefererData referer)
040: throws RollerException;
041:
042: /**
043: * Clear referrer dayhits and remove referrers without excerpts.
044: */
045: public void clearReferrers() throws RollerException;
046:
047: /**
048: * Clear referrer dayhits and remove referrers without excerpts.
049: */
050: public void clearReferrers(WebsiteData website)
051: throws RollerException;
052:
053: /**
054: * Retrieve referer by id.
055: */
056: public RefererData getReferer(String id) throws RollerException;
057:
058: /**
059: * Get all referers for specified weblog.
060: * @param weblog
061: * @return List of type RefererData
062: */
063: public List getReferers(WebsiteData weblog) throws RollerException;
064:
065: /**
066: * Get all referers for specified user that were made today.
067: * @param userName Name of user.
068: * @return List of type RefererData
069: */
070: public List getTodaysReferers(WebsiteData website)
071: throws RollerException;
072:
073: /**
074: * Get referers for a specified date.
075: * @param userName Name of user.
076: * @param date YYYYMMDD format of day's date.
077: * @return List of type RefererData.
078: * @throws RollerException
079: */
080: public List getReferersToDate(WebsiteData website, String date)
081: throws RollerException;
082:
083: /**
084: * Get most popular websites based on referer day hits.
085: * @param offset Offset into results (for paging)
086: * @param len Maximum number of results to return (for paging)
087: * @return List of WebsiteDisplayData objects.
088: */
089: public List getDaysPopularWebsites(int offset, int length)
090: throws RollerException;
091:
092: /**
093: * Returns hot weblogs as StatCount objects, in descending order by today's hits.
094: * @param sinceDays Restrict to last X days (or -1 for all)
095: * @param offset Offset into results (for paging)
096: * @param len Maximum number of results to return (for paging)
097: * @return List of StatCount objects.
098: */
099: public List getHotWeblogs(int sinceDays, int offset, int length)
100: throws RollerException;
101:
102: /**
103: * Get referers that refer to a specific weblog entry.
104: * @param entryid Weblog entry ID
105: * @return List of RefererData objects.
106: * @throws RollerException
107: */
108: public List getReferersToEntry(String entryid)
109: throws RollerException;
110:
111: /**
112: * Get user's day hits
113: */
114: public int getDayHits(WebsiteData website) throws RollerException;
115:
116: /**
117: * Get user's all-time total hits
118: */
119: public int getTotalHits(WebsiteData website) throws RollerException;
120:
121: /**
122: * Apply ignoreWord/spam filters to all referers in system.
123: */
124: public void applyRefererFilters() throws RollerException;
125:
126: /**
127: * Apply ignoreWord/spam filters to all referers in website.
128: */
129: public void applyRefererFilters(WebsiteData website)
130: throws RollerException;
131:
132: /**
133: * Process an incoming referer.
134: */
135: public void processReferrer(String requestUrl, String referrerUrl,
136: String weblogHandle, String weblogAnchor,
137: String weblogDateString);
138:
139: /**
140: * Release all resources held by manager.
141: */
142: public void release();
143: }
|