Source Code Cross Referenced for ConditionalStatsRecorder.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » services » stats » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.services.stats 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2005 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal.services.stats;
007:
008:        import org.apache.commons.logging.Log;
009:        import org.apache.commons.logging.LogFactory;
010:        import org.jasig.portal.ChannelDefinition;
011:        import org.jasig.portal.UserProfile;
012:        import org.jasig.portal.layout.node.IUserLayoutChannelDescription;
013:        import org.jasig.portal.layout.node.IUserLayoutFolderDescription;
014:        import org.jasig.portal.security.IPerson;
015:
016:        /**
017:         * Stats recorder implementation which conditionally propogates IStatsRecorder
018:         * events to a target IStatsRecorder.
019:         * 
020:         * This class just applies configured rules about which events to propogate.  It
021:         * requires that a target IStatsRecorder instance be injected via the 
022:         * setTargetStatsRecorder() setter method.
023:         * 
024:         * @version $Revision: 36282 $ $Date: 2005-10-31 10:50:39 -0700 (Mon, 31 Oct 2005) $
025:         * @since uPortal 2.5.1
026:         */
027:        public final class ConditionalStatsRecorder implements  IStatsRecorder {
028:
029:            private final Log log = LogFactory.getLog(getClass());
030:
031:            /**
032:             * IStatsRecorder to which we will conditionally propogate IStatsRecorder 
033:             * method calls.
034:             */
035:            private IStatsRecorder targetStatsRecorder;
036:
037:            /**
038:             * Bundle of boolean flags indicating whether we should propogate each
039:             * IStatsRecorder method.
040:             */
041:            private IStatsRecorderFlags flags = new StatsRecorderFlagsImpl();
042:
043:            /**
044:             * Returns the IStatsRecorder to which we will or will not propogate IStatsRecorder
045:             * method calls depending upon our configuration.
046:             * @return Returns the targetStatsRecorder.
047:             */
048:            public IStatsRecorder getTargetStatsRecorder() {
049:                return this .targetStatsRecorder;
050:            }
051:
052:            /**
053:             * Set the IStatsRecorder to which we will (or will not) propogate IStatsRecorder
054:             * method calls depending upon our configuration.
055:             * @param targetStatsRecorder The targetStatsRecorder to set.
056:             */
057:            public void setTargetStatsRecorder(
058:                    IStatsRecorder targetStatsRecorder) {
059:
060:                if (targetStatsRecorder == null) {
061:                    throw new IllegalArgumentException(
062:                            "Cannot set targetStatsRecorder to null");
063:                }
064:
065:                this .targetStatsRecorder = targetStatsRecorder;
066:            }
067:
068:            /**
069:             * Get the StatsRecorderFlags instance defining which IStatsRecorder method
070:             * calls we should propogate and which we should not.
071:             * @return flags indicating which methods we should propogate and which we should not.
072:             */
073:            public IStatsRecorderFlags getFlags() {
074:                return this .flags;
075:            }
076:
077:            /**
078:             * Set the boolean flags indicating which IStatsRecorder method calls we
079:             * should propogate and which we should not.
080:             * @param flags The flags to set.
081:             */
082:            public void setFlags(IStatsRecorderFlags flags) {
083:
084:                if (flags == null) {
085:                    throw new IllegalArgumentException(
086:                            "Cannot set flags to null.");
087:                }
088:
089:                this .flags = flags;
090:            }
091:
092:            public void recordLogin(IPerson person) {
093:                if (this .flags.isRecordLogin()) {
094:
095:                    if (this .targetStatsRecorder == null) {
096:                        log
097:                                .error("targetStatsRecorder of ConditionalStatsRecorder was illegally null");
098:                    } else {
099:                        this .targetStatsRecorder.recordLogin(person);
100:                    }
101:                }
102:            }
103:
104:            public void recordLogout(IPerson person) {
105:                if (this .flags.isRecordLogout()) {
106:
107:                    if (this .targetStatsRecorder == null) {
108:                        log
109:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
110:                    } else {
111:                        this .targetStatsRecorder.recordLogout(person);
112:                    }
113:
114:                }
115:            }
116:
117:            public void recordSessionCreated(IPerson person) {
118:
119:                if (this .flags.isRecordSessionCreated()) {
120:
121:                    if (this .targetStatsRecorder == null) {
122:                        log
123:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
124:                    } else {
125:                        this .targetStatsRecorder.recordSessionCreated(person);
126:                    }
127:
128:                }
129:            }
130:
131:            public void recordSessionDestroyed(IPerson person) {
132:                if (this .flags.isRecordSessionDestroyed()) {
133:                    if (this .targetStatsRecorder == null) {
134:                        log
135:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
136:                    } else {
137:                        this .targetStatsRecorder.recordSessionDestroyed(person);
138:                    }
139:                }
140:            }
141:
142:            public void recordChannelDefinitionPublished(IPerson person,
143:                    ChannelDefinition channelDef) {
144:                if (this .flags.isRecordChannelDefinitionPublished()) {
145:                    if (this .targetStatsRecorder == null) {
146:                        log
147:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
148:                    } else {
149:                        this .targetStatsRecorder
150:                                .recordChannelDefinitionPublished(person,
151:                                        channelDef);
152:                    }
153:                }
154:            }
155:
156:            public void recordChannelDefinitionModified(IPerson person,
157:                    ChannelDefinition channelDef) {
158:                if (this .flags.isRecordChannelDefinitionModified()) {
159:                    if (this .targetStatsRecorder == null) {
160:                        log
161:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
162:                    } else {
163:                        this .targetStatsRecorder
164:                                .recordChannelDefinitionModified(person,
165:                                        channelDef);
166:                    }
167:                }
168:            }
169:
170:            public void recordChannelDefinitionRemoved(IPerson person,
171:                    ChannelDefinition channelDef) {
172:                if (this .flags.isRecordChannelDefinitionRemoved()) {
173:                    if (this .targetStatsRecorder == null) {
174:                        log
175:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
176:                    } else {
177:                        this .targetStatsRecorder
178:                                .recordChannelDefinitionRemoved(person,
179:                                        channelDef);
180:                    }
181:                }
182:            }
183:
184:            public void recordChannelAddedToLayout(IPerson person,
185:                    UserProfile profile,
186:                    IUserLayoutChannelDescription channelDesc) {
187:                if (this .flags.isRecordChannelAddedToLayout()) {
188:                    if (this .targetStatsRecorder == null) {
189:                        log
190:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
191:                    } else {
192:                        this .targetStatsRecorder.recordChannelAddedToLayout(
193:                                person, profile, channelDesc);
194:                    }
195:                }
196:            }
197:
198:            public void recordChannelUpdatedInLayout(IPerson person,
199:                    UserProfile profile,
200:                    IUserLayoutChannelDescription channelDesc) {
201:                if (this .flags.isRecordChannelUpdatedInLayout()) {
202:                    if (this .targetStatsRecorder == null) {
203:                        log
204:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
205:                    } else {
206:                        this .targetStatsRecorder.recordChannelUpdatedInLayout(
207:                                person, profile, channelDesc);
208:                    }
209:                }
210:            }
211:
212:            public void recordChannelMovedInLayout(IPerson person,
213:                    UserProfile profile,
214:                    IUserLayoutChannelDescription channelDesc) {
215:                if (this .flags.isRecordChannelMovedInLayout()) {
216:                    if (this .targetStatsRecorder == null) {
217:                        log
218:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
219:                    } else {
220:                        this .targetStatsRecorder.recordChannelMovedInLayout(
221:                                person, profile, channelDesc);
222:                    }
223:                }
224:            }
225:
226:            public void recordChannelRemovedFromLayout(IPerson person,
227:                    UserProfile profile,
228:                    IUserLayoutChannelDescription channelDesc) {
229:                if (this .flags.isRecordChannelRemovedFromLayout()) {
230:                    if (this .targetStatsRecorder == null) {
231:                        log
232:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
233:                    } else {
234:                        this .targetStatsRecorder
235:                                .recordChannelRemovedFromLayout(person,
236:                                        profile, channelDesc);
237:                    }
238:                }
239:            }
240:
241:            public void recordFolderAddedToLayout(IPerson person,
242:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
243:                if (this .flags.isRecordFolderAddedToLayout()) {
244:                    if (this .targetStatsRecorder == null) {
245:                        log
246:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
247:                    } else {
248:                        this .targetStatsRecorder.recordFolderAddedToLayout(
249:                                person, profile, folderDesc);
250:                    }
251:                }
252:            }
253:
254:            public void recordFolderUpdatedInLayout(IPerson person,
255:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
256:                if (this .flags.isRecordFolderUpdatedInLayout()) {
257:                    if (this .targetStatsRecorder == null) {
258:                        log
259:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
260:                    } else {
261:                        this .targetStatsRecorder.recordFolderUpdatedInLayout(
262:                                person, profile, folderDesc);
263:                    }
264:                }
265:            }
266:
267:            public void recordFolderMovedInLayout(IPerson person,
268:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
269:                if (this .flags.isRecordFolderMovedInLayout()) {
270:                    if (this .targetStatsRecorder == null) {
271:                        log
272:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
273:                    } else {
274:                        this .targetStatsRecorder.recordFolderMovedInLayout(
275:                                person, profile, folderDesc);
276:                    }
277:                }
278:            }
279:
280:            public void recordFolderRemovedFromLayout(IPerson person,
281:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
282:                if (this .flags.isRecordFolderRemovedFromLayout()) {
283:                    if (this .targetStatsRecorder == null) {
284:                        log
285:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
286:                    } else {
287:                        this .targetStatsRecorder.recordFolderRemovedFromLayout(
288:                                person, profile, folderDesc);
289:                    }
290:                }
291:            }
292:
293:            public void recordChannelInstantiated(IPerson person,
294:                    UserProfile profile,
295:                    IUserLayoutChannelDescription channelDesc) {
296:                if (this .flags.isRecordChannelInstantiated()) {
297:                    if (this .targetStatsRecorder == null) {
298:                        log
299:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
300:                    } else {
301:                        this .targetStatsRecorder.recordChannelInstantiated(
302:                                person, profile, channelDesc);
303:                    }
304:                }
305:            }
306:
307:            public void recordChannelRendered(IPerson person,
308:                    UserProfile profile,
309:                    IUserLayoutChannelDescription channelDesc) {
310:                if (this .flags.isRecordChannelRendered()) {
311:                    if (this .targetStatsRecorder == null) {
312:                        log
313:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
314:                    } else {
315:                        this .targetStatsRecorder.recordChannelRendered(person,
316:                                profile, channelDesc);
317:                    }
318:                }
319:            }
320:
321:            public void recordChannelTargeted(IPerson person,
322:                    UserProfile profile,
323:                    IUserLayoutChannelDescription channelDesc) {
324:                if (this .flags.isRecordChannelTargeted()) {
325:                    if (this .targetStatsRecorder == null) {
326:                        log
327:                                .error("targetStatsRecorder of ConditionalStatsRecorder illegally null");
328:                    } else {
329:                        this.targetStatsRecorder.recordChannelTargeted(person,
330:                                profile, channelDesc);
331:                    }
332:                }
333:            }
334:
335:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.