Source Code Cross Referenced for Store.java in  » Groupware » lucane » org » lucane » server » store » 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 » Groupware » lucane » org.lucane.server.store 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Lucane - a collaborative platform
003:         * Copyright (C) 2003  Vincent Fiack <vfiack@mail15.com>
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         *
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018:         */
019:
020:        package org.lucane.server.store;
021:
022:        import org.lucane.server.*;
023:        import org.lucane.common.concepts.*;
024:        import org.lucane.common.crypto.MD5;
025:        import org.lucane.server.store.sql.*;
026:        import org.lucane.server.store.ldap.*;
027:        import org.lucane.common.Logging;
028:
029:        /**
030:         * The unique way to get Stores for the different concepts.
031:         */
032:        public class Store {
033:            private GroupStore group;
034:            private PluginStore plugin;
035:            private ServiceStore service;
036:            private UserStore user;
037:
038:            /**
039:             * Constructor.
040:             * 
041:             * Instantiate the managers and set some initial data if necessary
042:             */
043:            public Store(ServerConfig config) throws Exception {
044:                String backend = config.getStoreBackend();
045:
046:                if (backend.equals("database")) {
047:                    Logging.getLogger().info("Using database backend");
048:                    this .group = new SqlGroupStore(this );
049:                    this .plugin = new SqlPluginStore();
050:                    this .service = new SqlServiceStore();
051:                    this .user = new SqlUserStore();
052:                } else if (backend.equals("ldap")) {
053:                    Logging.getLogger().info("Using ldap backend");
054:                    LdapConfig ldapConfig = new LdapConfig(
055:                            LdapConfig.CONFIG_FILE);
056:                    this .group = new LdapGroupStore(this , ldapConfig);
057:                    this .plugin = new LdapPluginStore(ldapConfig);
058:                    this .service = new LdapServiceStore(ldapConfig);
059:                    this .user = new LdapUserStore(ldapConfig);
060:                } else
061:                    throw new Exception("no such backend : '" + backend + "'");
062:
063:                if (!this .group.isInitialized())
064:                    setInitialData();
065:            }
066:
067:            /**
068:             * Get the GroupStore
069:             * 
070:             * @return the GroupStore instance
071:             */
072:            public GroupStore getGroupStore() {
073:                return group;
074:            }
075:
076:            /**
077:             * Get the PluginStore
078:             * 
079:             * @return the PluginStore instance
080:             */
081:            public PluginStore getPluginStore() {
082:                return plugin;
083:            }
084:
085:            /**
086:             * Get the ServiceStore
087:             * 
088:             * @return the ServiceStore instance
089:             */
090:            public ServiceStore getServiceStore() {
091:                return service;
092:            }
093:
094:            /**
095:             * Get the UserStore
096:             * 
097:             * @return the UserStore instance
098:             */
099:            public UserStore getUserStore() {
100:                return user;
101:            }
102:
103:            /**
104:             * Set some default initial data.
105:             * Called by the constructor.
106:             */
107:            private void setInitialData() throws Exception {
108:                //groups
109:                GroupConcept allUsers = new GroupConcept("AllUsers");
110:                GroupConcept admins = new GroupConcept("Admins");
111:                GroupConcept shutdownGroup = new GroupConcept("Shutdown");
112:                admins.addParent(allUsers);
113:
114:                //admin user
115:                UserConcept admin = new UserConcept("admin", MD5
116:                        .encode("admin"), "Admin User", "", "en", false,
117:                        "org.lucane.applications.quicklaunch");
118:                admins.addUser(admin);
119:                getUserStore().storeUser(admin);
120:
121:                //shutdown user
122:                UserConcept shutdown = new UserConcept("shutdown", MD5
123:                        .encode("shutdown"), "Shutdown User", "", "en", false,
124:                        "org.lucane.applications.shutdown");
125:                shutdownGroup.addUser(shutdown);
126:                getUserStore().storeUser(shutdown);
127:
128:                //guest user
129:                UserConcept guest = new UserConcept("guest", MD5
130:                        .encode("guest"), "Guest User", "", "en", false,
131:                        "org.lucane.applications.quicklaunch");
132:                allUsers.addUser(guest);
133:                getUserStore().storeUser(guest);
134:
135:                //administrator application
136:                PluginConcept administratorPlugin = new PluginConcept(
137:                        "org.lucane.applications.administrator", "0.7.5");
138:                ServiceConcept administratorService = new ServiceConcept(
139:                        "org.lucane.applications.administrator", false);
140:                admins.addPlugin(administratorPlugin);
141:                admins.addService(administratorService);
142:                getPluginStore().storePlugin(administratorPlugin);
143:                getServiceStore().storeService(administratorService);
144:
145:                //shutdown application
146:                PluginConcept shutdownPlugin = new PluginConcept(
147:                        "org.lucane.applications.shutdown", "0.7.5");
148:                ServiceConcept shutdownService = new ServiceConcept(
149:                        "org.lucane.applications.shutdown", false);
150:                admins.addPlugin(shutdownPlugin);
151:                admins.addService(shutdownService);
152:                shutdownGroup.addPlugin(shutdownPlugin);
153:                shutdownGroup.addService(shutdownService);
154:                getPluginStore().storePlugin(shutdownPlugin);
155:                getServiceStore().storeService(shutdownService);
156:
157:                //forum application
158:                PluginConcept forumPlugin = new PluginConcept(
159:                        "org.lucane.applications.forum", "0.7.5");
160:                ServiceConcept forumService = new ServiceConcept(
161:                        "org.lucane.applications.forum", false);
162:                allUsers.addPlugin(forumPlugin);
163:                allUsers.addService(forumService);
164:                getPluginStore().storePlugin(forumPlugin);
165:                getServiceStore().storeService(forumService);
166:
167:                //forumadmin application
168:                PluginConcept forumadminPlugin = new PluginConcept(
169:                        "org.lucane.applications.forumadmin", "0.7.5");
170:                ServiceConcept forumadminService = new ServiceConcept(
171:                        "org.lucane.applications.forumadmin", false);
172:                admins.addPlugin(forumadminPlugin);
173:                admins.addService(forumadminService);
174:                getPluginStore().storePlugin(forumadminPlugin);
175:                getServiceStore().storeService(forumadminService);
176:
177:                //helpbrowser application
178:                PluginConcept helpbrowserPlugin = new PluginConcept(
179:                        "org.lucane.applications.helpbrowser", "0.7.5");
180:                allUsers.addPlugin(helpbrowserPlugin);
181:                getPluginStore().storePlugin(helpbrowserPlugin);
182:
183:                //maininterface application
184:                PluginConcept maininterfacePlugin = new PluginConcept(
185:                        "org.lucane.applications.maininterface", "0.7.5");
186:                ServiceConcept maininterfaceService = new ServiceConcept(
187:                        "org.lucane.applications.maininterface", false);
188:                allUsers.addPlugin(maininterfacePlugin);
189:                allUsers.addService(maininterfaceService);
190:                admins.addPlugin(maininterfacePlugin);
191:                admins.addService(maininterfaceService);
192:                getPluginStore().storePlugin(maininterfacePlugin);
193:                getServiceStore().storeService(maininterfaceService);
194:
195:                //quicklaunch application
196:                PluginConcept quicklaunchPlugin = new PluginConcept(
197:                        "org.lucane.applications.quicklaunch", "0.7.5");
198:                allUsers.addPlugin(quicklaunchPlugin);
199:                admins.addPlugin(quicklaunchPlugin);
200:                getPluginStore().storePlugin(quicklaunchPlugin);
201:
202:                //notes application
203:                PluginConcept notesPlugin = new PluginConcept(
204:                        "org.lucane.applications.notes", "0.7.5");
205:                ServiceConcept notesService = new ServiceConcept(
206:                        "org.lucane.applications.notes", false);
207:                allUsers.addPlugin(notesPlugin);
208:                allUsers.addService(notesService);
209:                getPluginStore().storePlugin(notesPlugin);
210:                getServiceStore().storeService(notesService);
211:
212:                //passwdchanger application
213:                PluginConcept passwdchangerPlugin = new PluginConcept(
214:                        "org.lucane.applications.passwdchanger", "0.7.5");
215:                ServiceConcept passwdchangerService = new ServiceConcept(
216:                        "org.lucane.applications.passwdchanger", false);
217:                allUsers.addPlugin(passwdchangerPlugin);
218:                allUsers.addService(passwdchangerService);
219:                admins.addPlugin(passwdchangerPlugin);
220:                admins.addService(passwdchangerService);
221:                getPluginStore().storePlugin(passwdchangerPlugin);
222:                getServiceStore().storeService(passwdchangerService);
223:
224:                //userprofile application
225:                PluginConcept userprofilePlugin = new PluginConcept(
226:                        "org.lucane.applications.userprofile", "0.7.5");
227:                ServiceConcept userprofileService = new ServiceConcept(
228:                        "org.lucane.applications.userprofile", false);
229:                allUsers.addPlugin(userprofilePlugin);
230:                allUsers.addService(userprofileService);
231:                getPluginStore().storePlugin(userprofilePlugin);
232:                getServiceStore().storeService(userprofileService);
233:
234:                //pluginsinfos application
235:                PluginConcept pluginsinfosPlugin = new PluginConcept(
236:                        "org.lucane.applications.pluginsinfos", "0.7.5");
237:                allUsers.addPlugin(pluginsinfosPlugin);
238:                getPluginStore().storePlugin(pluginsinfosPlugin);
239:
240:                //quickmessage application
241:                PluginConcept quickmessagePlugin = new PluginConcept(
242:                        "org.lucane.applications.quickmessage", "0.7.5");
243:                allUsers.addPlugin(quickmessagePlugin);
244:                admins.addPlugin(quickmessagePlugin);
245:                getPluginStore().storePlugin(quickmessagePlugin);
246:
247:                //reunion application
248:                PluginConcept reunionPlugin = new PluginConcept(
249:                        "org.lucane.applications.reunion", "0.7.5");
250:                allUsers.addPlugin(reunionPlugin);
251:                getPluginStore().storePlugin(reunionPlugin);
252:
253:                //sendfile application
254:                PluginConcept sendfilePlugin = new PluginConcept(
255:                        "org.lucane.applications.sendfile", "0.7.5");
256:                allUsers.addPlugin(sendfilePlugin);
257:                getPluginStore().storePlugin(sendfilePlugin);
258:
259:                //audioconf application
260:                PluginConcept audioconfPlugin = new PluginConcept(
261:                        "org.lucane.applications.audioconf", "0.7.5");
262:                allUsers.addPlugin(audioconfPlugin);
263:                getPluginStore().storePlugin(audioconfPlugin);
264:
265:                //kick application
266:                PluginConcept kickPlugin = new PluginConcept(
267:                        "org.lucane.applications.kick", "0.7.5");
268:                admins.addPlugin(kickPlugin);
269:                getPluginStore().storePlugin(kickPlugin);
270:
271:                //sendmail application
272:                PluginConcept sendmailPlugin = new PluginConcept(
273:                        "org.lucane.applications.sendmail", "0.7.5");
274:                ServiceConcept sendmailService = new ServiceConcept(
275:                        "org.lucane.applications.sendmail", false);
276:                admins.addPlugin(sendmailPlugin);
277:                allUsers.addService(sendmailService);
278:                getPluginStore().storePlugin(sendmailPlugin);
279:                getServiceStore().storeService(sendmailService);
280:
281:                //sqlnavigator application
282:                PluginConcept sqlnavigatorPlugin = new PluginConcept(
283:                        "org.lucane.applications.sqlnavigator", "0.7.5");
284:                ServiceConcept sqlnavigatorService = new ServiceConcept(
285:                        "org.lucane.applications.sqlnavigator", false);
286:                admins.addPlugin(sqlnavigatorPlugin);
287:                admins.addService(sqlnavigatorService);
288:                getPluginStore().storePlugin(sqlnavigatorPlugin);
289:                getServiceStore().storeService(sqlnavigatorService);
290:
291:                //calendar application
292:                PluginConcept calendarPlugin = new PluginConcept(
293:                        "org.lucane.applications.calendar", "0.7.5");
294:                ServiceConcept calendarService = new ServiceConcept(
295:                        "org.lucane.applications.calendar", false);
296:                allUsers.addPlugin(calendarPlugin);
297:                allUsers.addService(calendarService);
298:                getPluginStore().storePlugin(calendarPlugin);
299:                getServiceStore().storeService(calendarService);
300:
301:                //calendarprefs application
302:                PluginConcept calendarprefsPlugin = new PluginConcept(
303:                        "org.lucane.applications.calendarprefs", "0.7.5");
304:                allUsers.addPlugin(calendarprefsPlugin);
305:                getPluginStore().storePlugin(calendarprefsPlugin);
306:
307:                //reminder application
308:                PluginConcept reminderPlugin = new PluginConcept(
309:                        "org.lucane.applications.reminder", "0.7.5");
310:                ServiceConcept reminderService = new ServiceConcept(
311:                        "org.lucane.applications.reminder", false);
312:                allUsers.addPlugin(reminderPlugin);
313:                allUsers.addService(reminderService);
314:                getPluginStore().storePlugin(reminderPlugin);
315:                getServiceStore().storeService(reminderService);
316:
317:                //jmail
318:                PluginConcept jmailPlugin = new PluginConcept(
319:                        "org.lucane.applications.jmail", "0.7.5");
320:                ServiceConcept jmailService = new ServiceConcept(
321:                        "org.lucane.applications.jmail", false);
322:                allUsers.addPlugin(jmailPlugin);
323:                allUsers.addService(jmailService);
324:                getPluginStore().storePlugin(jmailPlugin);
325:                getServiceStore().storeService(jmailService);
326:
327:                //jmail account
328:                PluginConcept jmailaccountPlugin = new PluginConcept(
329:                        "org.lucane.applications.jmailaccount", "0.7.5");
330:                ServiceConcept jmailaccountService = new ServiceConcept(
331:                        "org.lucane.applications.jmailaccount", false);
332:                allUsers.addPlugin(jmailaccountPlugin);
333:                allUsers.addService(jmailaccountService);
334:                getPluginStore().storePlugin(jmailaccountPlugin);
335:                getServiceStore().storeService(jmailaccountService);
336:
337:                //jmail admin
338:                PluginConcept jmailadminPlugin = new PluginConcept(
339:                        "org.lucane.applications.jmailadmin", "0.7.5");
340:                ServiceConcept jmailadminService = new ServiceConcept(
341:                        "org.lucane.applications.jmailadmin", false);
342:                admins.addPlugin(jmailadminPlugin);
343:                admins.addService(jmailadminService);
344:                getPluginStore().storePlugin(jmailadminPlugin);
345:                getServiceStore().storeService(jmailadminService);
346:
347:                //todolist application
348:                PluginConcept todolistPlugin = new PluginConcept(
349:                        "org.lucane.applications.todolist", "0.7.5");
350:                ServiceConcept todolistService = new ServiceConcept(
351:                        "org.lucane.applications.todolist", false);
352:                allUsers.addPlugin(todolistPlugin);
353:                allUsers.addService(todolistService);
354:                getPluginStore().storePlugin(todolistPlugin);
355:                getServiceStore().storeService(todolistService);
356:
357:                //rssreader application
358:                PluginConcept rssreaderPlugin = new PluginConcept(
359:                        "org.lucane.applications.rssreader", "0.7.5");
360:                ServiceConcept rssreaderService = new ServiceConcept(
361:                        "org.lucane.applications.rssreader", false);
362:                allUsers.addPlugin(rssreaderPlugin);
363:                allUsers.addService(rssreaderService);
364:                getPluginStore().storePlugin(rssreaderPlugin);
365:                getServiceStore().storeService(rssreaderService);
366:
367:                //sharedfolder application
368:                PluginConcept sharedfolderPlugin = new PluginConcept(
369:                        "org.lucane.applications.sharedfolder", "0.7.5");
370:                ServiceConcept sharedfolderService = new ServiceConcept(
371:                        "org.lucane.applications.sharedfolder", false);
372:                allUsers.addPlugin(sharedfolderPlugin);
373:                allUsers.addService(sharedfolderService);
374:                getPluginStore().storePlugin(sharedfolderPlugin);
375:                getServiceStore().storeService(sharedfolderService);
376:
377:                //whiteboard application
378:                PluginConcept whiteboardPlugin = new PluginConcept(
379:                        "org.lucane.applications.whiteboard", "0.7.5");
380:                allUsers.addPlugin(whiteboardPlugin);
381:                getPluginStore().storePlugin(whiteboardPlugin);
382:
383:                //slideshow application
384:                PluginConcept slideshowPlugin = new PluginConcept(
385:                        "org.lucane.applications.slideshow", "0.7.5");
386:                allUsers.addPlugin(slideshowPlugin);
387:                getPluginStore().storePlugin(slideshowPlugin);
388:
389:                //webconnector
390:                ServiceConcept webconnectorService = new ServiceConcept(
391:                        "org.lucane.webconnector", false);
392:                allUsers.addService(webconnectorService);
393:                getServiceStore().storeService(webconnectorService);
394:
395:                //webadmin application
396:                PluginConcept webadminPlugin = new PluginConcept(
397:                        "org.lucane.applications.webadmin", "0.7.5");
398:                ServiceConcept webadminService = new ServiceConcept(
399:                        "org.lucane.applications.webadmin", false);
400:                admins.addPlugin(webadminPlugin);
401:                admins.addService(webadminService);
402:                getPluginStore().storePlugin(webadminPlugin);
403:                getServiceStore().storeService(webadminService);
404:
405:                getGroupStore().storeGroup(allUsers);
406:                getGroupStore().storeGroup(admins);
407:                getGroupStore().storeGroup(shutdownGroup);
408:            }
409:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.