KickJava   Java API By Example, From Geeks To Geeks.

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


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.List JavaDoc;
22 import org.apache.roller.RollerException;
23 import org.apache.roller.pojos.RefererData;
24 import org.apache.roller.pojos.WebsiteData;
25
26 /**
27  * Interface to Referer management.
28  */

29 public interface RefererManager {
30     
31     /**
32      * Store the referer.
33      */

34     public void saveReferer(RefererData referer) throws RollerException;
35     
36     /**
37      * Remove a single referer.
38      */

39     public void removeReferer(RefererData referer) throws RollerException;
40     
41     /**
42      * Clear referrer dayhits and remove referrers without excerpts.
43      */

44     public void clearReferrers() throws RollerException;
45     
46     /**
47      * Clear referrer dayhits and remove referrers without excerpts.
48      */

49     public void clearReferrers(WebsiteData website) throws RollerException;
50     
51     /**
52      * Retrieve referer by id.
53      */

54     public RefererData getReferer(String JavaDoc id) throws RollerException;
55     
56     /**
57      * Get all referers for specified weblog.
58      * @param weblog
59      * @return List of type RefererData
60      */

61     public List JavaDoc getReferers(WebsiteData weblog) throws RollerException;
62     
63     /**
64      * Get all referers for specified user that were made today.
65      * @param userName Name of user.
66      * @return List of type RefererData
67      */

68     public List JavaDoc getTodaysReferers(WebsiteData website) throws RollerException;
69     
70     /**
71      * Get referers for a specified date.
72      * @param userName Name of user.
73      * @param date YYYYMMDD format of day's date.
74      * @return List of type RefererData.
75      * @throws RollerException
76      */

77     public List JavaDoc getReferersToDate(WebsiteData website, String JavaDoc date)
78         throws RollerException;
79     
80     /**
81      * Get most popular websites based on referer day hits.
82      * @param offset Offset into results (for paging)
83      * @param len Maximum number of results to return (for paging)
84      * @return List of WebsiteDisplayData objects.
85      */

86     public List JavaDoc getDaysPopularWebsites(
87             int offset,
88             int length)
89         throws RollerException;
90     
91     /**
92      * Returns hot weblogs as StatCount objects, in descending order by today's hits.
93      * @param sinceDays Restrict to last X days (or -1 for all)
94      * @param offset Offset into results (for paging)
95      * @param len Maximum number of results to return (for paging)
96      * @return List of StatCount objects.
97      */

98     public List JavaDoc getHotWeblogs(int sinceDays, int offset, int length)
99         throws RollerException;
100
101     /**
102      * Get referers that refer to a specific weblog entry.
103      * @param entryid Weblog entry ID
104      * @return List of RefererData objects.
105      * @throws RollerException
106      */

107     public List JavaDoc getReferersToEntry(String JavaDoc entryid) throws RollerException;
108     
109     /**
110      * Get user's day hits
111      */

112     public int getDayHits(WebsiteData website) throws RollerException;
113     
114     /**
115      * Get user's all-time total hits
116      */

117     public int getTotalHits(WebsiteData website) throws RollerException;
118     
119     /**
120      * Apply ignoreWord/spam filters to all referers in system.
121      */

122     public void applyRefererFilters() throws RollerException;
123     
124     /**
125      * Apply ignoreWord/spam filters to all referers in website.
126      */

127     public void applyRefererFilters(WebsiteData website) throws RollerException;
128     
129     /**
130      * Process an incoming referer.
131      */

132     public void processReferrer(
133             String JavaDoc requestUrl,
134             String JavaDoc referrerUrl,
135             String JavaDoc weblogHandle,
136             String JavaDoc weblogAnchor,
137             String JavaDoc weblogDateString);
138     
139     /**
140      * Release all resources held by manager.
141      */

142     public void release();
143 }
144
145
Popular Tags