KickJava   Java API By Example, From Geeks To Geeks.

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


1
2 package org.roller.model;
3 import org.roller.RollerException;
4 import org.roller.business.ThreadManagerImpl;
5 import org.roller.pojos.RefererData;
6 import org.roller.pojos.WebsiteData;
7
8 import java.io.Serializable JavaDoc;
9 import java.util.List JavaDoc;
10
11
12 /////////////////////////////////////////////////////////////////////////////
13
/**
14  * Interface to Referer management.
15  * @author David M Johnson
16  */

17 public interface RefererManager extends Serializable JavaDoc
18 {
19     //------------------------------------------ Access to Referer information
20

21     /**
22      * Get all referers for specified user.
23      * @param userName
24      * @return List of type RefererData
25      * @throws RollerException
26      */

27     public List JavaDoc getReferers(WebsiteData website)
28         throws RollerException;
29
30     /**
31      * Get all referers for specified user that were made today.
32      * @param userName Name of user.
33      * @return List of type RefererData
34      * @throws RollerException
35      */

36     public List JavaDoc getTodaysReferers(WebsiteData website)
37         throws RollerException;
38
39     /**
40      * Get referers for a specified date.
41      * @param userName Name of user.
42      * @param date YYYYMMDD format of day's date.
43      * @return List of type RefererData.
44      * @throws RollerException
45      */

46     public List JavaDoc getReferersToDate(WebsiteData website, String JavaDoc date)
47         throws RollerException;
48
49     /**
50      * Get most popular websites based on referer day hits.
51      * @return List of WebsiteDisplayData objects.
52      */

53     public List JavaDoc getDaysPopularWebsites(int max) throws RollerException;
54
55     /**
56      * Get referers that refer to a specific weblog entry.
57      * @param entryid Weblog entry ID
58      * @return List of RefererData objects.
59      * @throws RollerException
60      */

61     public List JavaDoc getReferersToEntry(String JavaDoc entryid)
62         throws RollerException;
63
64     /**
65      * Remove all referers for the specific weblog entry.
66      * @param entryId Weblog entry ID
67      * @throws RollerException
68      */

69     public void removeReferersForEntry(String JavaDoc entryid) throws RollerException;
70     
71     /**
72      * Apply ignoreWord/spam filters to all referers in system.
73      */

74     public void applyRefererFilters() throws RollerException;
75
76     /**
77      * Apply ignoreWord/spam filters to all referers in website.
78      */

79     public void applyRefererFilters(WebsiteData website) throws RollerException;
80
81     /**
82      * Get referers that refer to a specific weblog entry.
83      * @param entryId Weblog entry ID
84      * @param authorized Is the current user authorized to edit these Referers.
85      * @return List of RefererData objects.
86      * @throws RollerException
87      */

88     public List JavaDoc getEntryReferers(String JavaDoc entryId, boolean authorized)
89         throws RollerException;
90
91     /** Get user's day hits */
92     public int getDayHits(WebsiteData website) throws RollerException;
93
94     /** Get user's all-time total hits */
95     public int getTotalHits(WebsiteData website) throws RollerException;
96
97     //--------------------------------------------- Referer processing methods
98

99     /**
100      * Process request for incoming referers.
101      * @param request Request to be processed.
102      * @return boolean True if the referer header contains an ignore/spam word.
103      */

104     public boolean processRequest(ParsedRequest request);
105
106     //---------------------------------------------- Referer tracking turnover
107

108     /**
109      * Force refer of referer hit counts and deletes all referers that do nto have excerpts.
110      */

111     public void forceTurnover(String JavaDoc websiteId) throws RollerException;
112
113     /**
114      * Check to see if it's time for turnover.
115      */

116     public void checkForTurnover(boolean forceTurnover, String JavaDoc websiteId)
117             throws RollerException;
118
119     //----------------------------------------------- Standard manager methods
120

121     /**
122      * Retrieve referer specifie by ID.
123      */

124     public RefererData retrieveReferer(String JavaDoc id)
125         throws RollerException;
126
127     /**
128      * Remove referer specified by ID.
129      */

130     public void removeReferer( String JavaDoc id )
131         throws RollerException;
132
133     /**
134      * Release all resources associated with Roller session.
135      */

136     public void release();
137 }
138
139
Popular Tags