Source Code Cross Referenced for AgentImplOsp.java in  » ERP-CRM-Financial » sakai » org » theospi » portfolio » shared » model » 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 » sakai » org.theospi.portfolio.shared.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.theospi.portfolio.shared.model;
002:
003:        import org.sakaiproject.metaobj.shared.mgt.HomeFactory;
004:        import org.sakaiproject.metaobj.shared.model.Artifact;
005:        import org.sakaiproject.metaobj.shared.model.Id;
006:        import org.sakaiproject.metaobj.shared.model.StructuredArtifact;
007:
008:        import java.util.ArrayList;
009:        import java.util.List;
010:
011:        /**
012:         * Created by IntelliJ IDEA.
013:         * User: bbiltimier
014:         * Date: Apr 18, 2006
015:         * Time: 3:46:01 PM
016:         * To change this template use File | Settings | File Templates.
017:         */
018:        public class AgentImplOsp implements 
019:                org.sakaiproject.metaobj.shared.model.Agent {
020:            static public final String ID = "id";
021:            static public final String REAL_NAME = "realName";
022:            static public final String EMAIL = "email";
023:            static public final String ROLES = "roles";
024:
025:            private Id id;
026:            private Id eid;
027:            private StructuredArtifact profile;
028:            private String[] roles;
029:            private HomeFactory homeFactory;
030:            private String displayName;
031:            private String md5Password;
032:            private String password;
033:            private String role;
034:            private boolean initialized = false;
035:
036:            public AgentImplOsp() {
037:
038:            }
039:
040:            public AgentImplOsp(Id id) {
041:                this .id = id;
042:            }
043:
044:            public AgentImplOsp(StructuredArtifact profile) {
045:                this .profile = profile;
046:            }
047:
048:            public Id getId() {
049:                return id;
050:            }
051:
052:            public void setId(Id id) {
053:                this .id = id;
054:            }
055:
056:            public Id getEid() {
057:                return eid;
058:            }
059:
060:            public void setEid(Id eid) {
061:                this .eid = eid;
062:            }
063:
064:            public Artifact getProfile() {
065:                return profile;
066:            }
067:
068:            public void setProfile(StructuredArtifact profile) {
069:                this .profile = profile;
070:            }
071:
072:            public Object getProperty(String key) {
073:                return profile.get(key);
074:            }
075:
076:            public String getDisplayName() {
077:                return displayName;
078:            }
079:
080:            public boolean isInRole(String role) {
081:
082:                for (int i = 0; i < getRoles().length; i++) {
083:                    if (role.equals(getRoles()[i])) {
084:                        return true;
085:                    }
086:                }
087:
088:                return false;
089:            }
090:
091:            public boolean isInitialized() {
092:                return initialized;
093:            }
094:
095:            public void setInitialized(boolean initialized) {
096:                this .initialized = initialized;
097:            }
098:
099:            public void setDisplayName(String displayName) {
100:                this .displayName = displayName;
101:            }
102:
103:            /**
104:             * I imagine this will probably move into a authz call and out of here
105:             *
106:             * @return
107:             */
108:            public String[] getRoles() {
109:                /*      if (roles == null) {
110:                 //TODO implement for multiple roles
111:                 roles = new String[1];
112:                 roles[0] = (String) profile.get("role");
113:                 }
114:                 */
115:                roles = new String[1];
116:                roles[0] = role;
117:
118:                return roles;
119:            }
120:
121:            public void setRoles(String[] roles) {
122:                this .roles = roles;
123:            }
124:
125:            public HomeFactory getHomeFactory() {
126:                return homeFactory;
127:            }
128:
129:            public void setHomeFactory(HomeFactory homeFactory) {
130:                this .homeFactory = homeFactory;
131:            }
132:
133:            public String getPassword() {
134:                return password;
135:            }
136:
137:            public String getClearPassword() {
138:                return password;
139:            }
140:
141:            public void setPassword(String password) {
142:                this .password = password;
143:            }
144:
145:            public String getMd5Password() {
146:                return md5Password;
147:            }
148:
149:            public void setMd5Password(String md5Password) {
150:                this .md5Password = md5Password;
151:            }
152:
153:            public String getRole() {
154:                return role;
155:            }
156:
157:            public List getWorksiteRoles(String worksiteId) {
158:                return new ArrayList();
159:            }
160:
161:            public List getWorksiteRoles() {
162:                return new ArrayList();
163:            }
164:
165:            public boolean isRole() {
166:                return false;
167:            }
168:
169:            public void setRole(String role) {
170:                this .role = role;
171:            }
172:
173:            public String naturalKey() {
174:                return "" + displayName;
175:            }
176:
177:            public boolean equals(Object o) {
178:                if (this  == o) {
179:                    return true;
180:                }
181:                if (!(o instanceof  org.theospi.portfolio.shared.model.AgentImplOsp)) {
182:                    return false;
183:                }
184:
185:                final org.theospi.portfolio.shared.model.AgentImplOsp agent = (org.theospi.portfolio.shared.model.AgentImplOsp) o;
186:                return naturalKey().equals(agent.naturalKey());
187:            }
188:
189:            public int hashCode() {
190:                return naturalKey().hashCode();
191:            }
192:
193:            /**
194:             * Returns the name of this principal.
195:             *
196:             * @return the name of this principal.
197:             */
198:            public String getName() {
199:                return getDisplayName();
200:            }
201:
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.