Source Code Cross Referenced for MockStatsRecorder.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.jasig.portal.ChannelDefinition;
009:        import org.jasig.portal.UserProfile;
010:        import org.jasig.portal.layout.node.IUserLayoutChannelDescription;
011:        import org.jasig.portal.layout.node.IUserLayoutFolderDescription;
012:        import org.jasig.portal.security.IPerson;
013:
014:        /**
015:         * This is a Mock Object stats recorder.  It exists to support stats recorder
016:         * unit testing.
017:         * 
018:         * This object maintains internal counters of received "events" on the
019:         * IStatsRecorder API and exposes those lists for interrogation.  Test code can examine these counters to implement
020:         * sanity checking.
021:         * @since uPortal 2.5.2
022:         */
023:        public class MockStatsRecorder implements  IStatsRecorder {
024:
025:            private int logins = 0;
026:
027:            private int logouts = 0;
028:
029:            private int sessionCreates = 0;
030:
031:            private int sessionDestroys = 0;
032:
033:            private int channelDefinitionPublishes = 0;
034:
035:            private int channelDefinitionModifies = 0;
036:
037:            private int channelDefinitionRemoves = 0;
038:
039:            private int channelAddsToLayout = 0;
040:
041:            private int channelUpdatesInLayout = 0;
042:
043:            private int channelMovesInLayout = 0;
044:
045:            private int channelRemovesFromLayout = 0;
046:
047:            private int folderAddsToLayout = 0;
048:
049:            private int folderUpdatesInLayout = 0;
050:
051:            private int folderMovesInLayout = 0;
052:
053:            private int folderRemovesFromLayout = 0;
054:
055:            private int channelInstantiates = 0;
056:
057:            private int channelRenders = 0;
058:
059:            private int channelTargets = 0;
060:
061:            // IStatsRecorder methods
062:
063:            public void recordLogin(IPerson person) {
064:                this .logins++;
065:            }
066:
067:            public void recordLogout(IPerson person) {
068:                this .logouts++;
069:            }
070:
071:            public void recordSessionCreated(IPerson person) {
072:                this .sessionCreates++;
073:            }
074:
075:            public void recordSessionDestroyed(IPerson person) {
076:                this .sessionDestroys++;
077:            }
078:
079:            public void recordChannelDefinitionPublished(IPerson person,
080:                    ChannelDefinition channelDef) {
081:                this .channelDefinitionPublishes++;
082:            }
083:
084:            public void recordChannelDefinitionModified(IPerson person,
085:                    ChannelDefinition channelDef) {
086:                this .channelDefinitionModifies++;
087:            }
088:
089:            public void recordChannelDefinitionRemoved(IPerson person,
090:                    ChannelDefinition channelDef) {
091:                this .channelDefinitionRemoves++;
092:            }
093:
094:            public void recordChannelAddedToLayout(IPerson person,
095:                    UserProfile profile,
096:                    IUserLayoutChannelDescription channelDesc) {
097:                this .channelAddsToLayout++;
098:            }
099:
100:            public void recordChannelUpdatedInLayout(IPerson person,
101:                    UserProfile profile,
102:                    IUserLayoutChannelDescription channelDesc) {
103:                this .channelUpdatesInLayout++;
104:            }
105:
106:            public void recordChannelMovedInLayout(IPerson person,
107:                    UserProfile profile,
108:                    IUserLayoutChannelDescription channelDesc) {
109:                this .channelMovesInLayout++;
110:            }
111:
112:            public void recordChannelRemovedFromLayout(IPerson person,
113:                    UserProfile profile,
114:                    IUserLayoutChannelDescription channelDesc) {
115:                this .channelRemovesFromLayout++;
116:            }
117:
118:            public void recordFolderAddedToLayout(IPerson person,
119:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
120:                this .folderAddsToLayout++;
121:            }
122:
123:            public void recordFolderUpdatedInLayout(IPerson person,
124:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
125:                this .folderUpdatesInLayout++;
126:            }
127:
128:            public void recordFolderMovedInLayout(IPerson person,
129:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
130:                this .folderMovesInLayout++;
131:            }
132:
133:            public void recordFolderRemovedFromLayout(IPerson person,
134:                    UserProfile profile, IUserLayoutFolderDescription folderDesc) {
135:                this .folderRemovesFromLayout++;
136:            }
137:
138:            public void recordChannelInstantiated(IPerson person,
139:                    UserProfile profile,
140:                    IUserLayoutChannelDescription channelDesc) {
141:                this .channelInstantiates++;
142:            }
143:
144:            public void recordChannelRendered(IPerson person,
145:                    UserProfile profile,
146:                    IUserLayoutChannelDescription channelDesc) {
147:                this .channelRenders++;
148:            }
149:
150:            public void recordChannelTargeted(IPerson person,
151:                    UserProfile profile,
152:                    IUserLayoutChannelDescription channelDesc) {
153:                this .channelTargets++;
154:            }
155:
156:            //	 counter accessor methods
157:
158:            public int getChannelAddsToLayout() {
159:                return channelAddsToLayout;
160:            }
161:
162:            public int getChannelDefinitionModifies() {
163:                return channelDefinitionModifies;
164:            }
165:
166:            public int getChannelDefinitionPublishes() {
167:                return channelDefinitionPublishes;
168:            }
169:
170:            public int getChannelDefinitionRemoves() {
171:                return channelDefinitionRemoves;
172:            }
173:
174:            public int getChannelInstantiates() {
175:                return channelInstantiates;
176:            }
177:
178:            public int getChannelMovesInLayout() {
179:                return channelMovesInLayout;
180:            }
181:
182:            public int getChannelRemovesFromLayout() {
183:                return channelRemovesFromLayout;
184:            }
185:
186:            public int getChannelRenders() {
187:                return channelRenders;
188:            }
189:
190:            public int getChannelTargets() {
191:                return channelTargets;
192:            }
193:
194:            public int getChannelUpdatesInLayout() {
195:                return channelUpdatesInLayout;
196:            }
197:
198:            public int getFolderAddsToLayout() {
199:                return folderAddsToLayout;
200:            }
201:
202:            public int getFolderMovesInLayout() {
203:                return folderMovesInLayout;
204:            }
205:
206:            public int getFolderRemovesFromLayout() {
207:                return folderRemovesFromLayout;
208:            }
209:
210:            public int getFolderUpdatesInLayout() {
211:                return folderUpdatesInLayout;
212:            }
213:
214:            public int getLogins() {
215:                return logins;
216:            }
217:
218:            public int getLogouts() {
219:                return logouts;
220:            }
221:
222:            public int getSessionCreates() {
223:                return sessionCreates;
224:            }
225:
226:            public int getSessionDestroys() {
227:                return sessionDestroys;
228:            }
229:
230:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.