Source Code Cross Referenced for WorkgroupMembershipChangeProcessor.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » workgroup » 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 » ERP CRM Financial » Kuali Financial System » edu.iu.uis.eden.workgroup 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2006 The Kuali Foundation.
003:         *
004:         *
005:         * Licensed under the Educational Community License, Version 1.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * You may obtain a copy of the License at
008:         *
009:         * http://www.opensource.org/licenses/ecl1.php
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package edu.iu.uis.eden.workgroup;
018:
019:        import edu.iu.uis.eden.KEWServiceLocator;
020:        import edu.iu.uis.eden.actionitem.ActionItem;
021:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
022:        import edu.iu.uis.eden.exception.WorkflowException;
023:        import edu.iu.uis.eden.messaging.KEWXMLService;
024:        import edu.iu.uis.eden.messaging.ParameterTranslator;
025:        import edu.iu.uis.eden.user.AuthenticationUserId;
026:        import edu.iu.uis.eden.user.WorkflowUser;
027:
028:        /**
029:         * Executes the updating of {@link ActionItem}s for a {@link Workgroup} when
030:         * the membership of a Workgroup changes.
031:         *
032:         * @see ActionItem
033:         * @see Workgroup
034:         *
035:         * @author ewestfal
036:         * @author rkirkend
037:         */
038:        public class WorkgroupMembershipChangeProcessor implements 
039:                KEWXMLService {
040:
041:            private static final String ADDED_OPERATION = "ADDED";
042:            private static final String REMOVED_OPERATION = "REMOVED";
043:
044:            public void invoke(String contents) throws Exception {
045:                ParameterTranslator translator = new ParameterTranslator(
046:                        contents);
047:                String[] parameters = translator.getParameters();
048:                if (parameters.length != 4) {
049:                    throw new IllegalArgumentException(
050:                            "The Workgroup Membership Change Processor requires four parameters.");
051:                }
052:                String operation = parameters[0];
053:                WorkflowUser user = KEWServiceLocator.getUserService()
054:                        .getWorkflowUser(
055:                                new AuthenticationUserId(parameters[1]));
056:                if (user == null) {
057:                    throw new EdenUserNotFoundException(
058:                            "Could not locate the user for the given authentication id '"
059:                                    + parameters[1] + "'");
060:                }
061:                Long versionNumber = new Long(parameters[3]);
062:                GroupNameId workgroupName = new GroupNameId(parameters[2]);
063:                Workgroup workgroup = KEWServiceLocator.getWorkgroupService()
064:                        .getWorkgroup(workgroupName);
065:                if (workgroup != null
066:                        && !workgroup.getLockVerNbr().equals(versionNumber)) {
067:                    // if the lock version numbers don't match, then refresh the workgroup from the cache
068:                    KEWServiceLocator.getWorkgroupService()
069:                            .removeNameFromCache(workgroupName);
070:                    workgroup = KEWServiceLocator.getWorkgroupService()
071:                            .getWorkgroup(workgroupName);
072:                }
073:                if (workgroup == null) {
074:                    throw new WorkflowException(
075:                            "Could not locate the workgroup with the given name '"
076:                                    + workgroupName + "'");
077:                }
078:                if (ADDED_OPERATION.equals(operation)) {
079:                    KEWServiceLocator.getActionListService()
080:                            .updateActionListForUserAddedToWorkgroup(user,
081:                                    workgroup);
082:                } else if (REMOVED_OPERATION.equals(operation)) {
083:                    KEWServiceLocator.getActionListService()
084:                            .updateActionListForUserRemovedFromWorkgroup(user,
085:                                    workgroup);
086:                } else {
087:                    throw new WorkflowException(
088:                            "Did not understand requested workgroup membership change operation '"
089:                                    + operation + "'");
090:                }
091:            }
092:
093:            public static String getMemberAddedMessageContents(
094:                    WorkflowUser user, Workgroup workgroup) {
095:                return getMessageContents(user, workgroup, ADDED_OPERATION);
096:            }
097:
098:            public static String getMemberRemovedMessageContents(
099:                    WorkflowUser user, Workgroup workgroup) {
100:                return getMessageContents(user, workgroup, REMOVED_OPERATION);
101:            }
102:
103:            public static String getMessageContents(WorkflowUser user,
104:                    Workgroup workgroup, String operation) {
105:                ParameterTranslator translator = new ParameterTranslator();
106:                translator.addParameter(operation);
107:                translator.addParameter(user.getAuthenticationUserId()
108:                        .getAuthenticationId());
109:                translator.addParameter(workgroup.getGroupNameId().getNameId());
110:                translator.addParameter(workgroup.getLockVerNbr().toString());
111:                // delay for about 10 seconds to allow a reasonable amount of time for the workgroup cache to be updated
112:                // (and hopefully prevent thrashing of the workgroup cache), regardless we will fall back on the version
113:                // number of the workgroup and check it against the machine this processor is processed on to ensure that
114:                // it's cache is up to date
115:                //SpringServiceLocator.getRouteQueueService().requeueDocument(new Long(-1), EdenConstants.ROUTE_QUEUE_DEFAULT_PRIORITY, new Long(10*1000), WorkgroupMembershipChangeProcessor.class.getName(), translator.getUntranslatedString());
116:                return translator.getUntranslatedString();
117:            }
118:
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.