Source Code Cross Referenced for SecurityObject.java in  » Web-Framework » TURBINE » org » apache » turbine » om » security » 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 » Web Framework » TURBINE » org.apache.turbine.om.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.turbine.om.security;
002:
003:        /*
004:         * Licensed to the Apache Software Foundation (ASF) under one
005:         * or more contributor license agreements.  See the NOTICE file
006:         * distributed with this work for additional information
007:         * regarding copyright ownership.  The ASF licenses this file
008:         * to you under the Apache License, Version 2.0 (the
009:         * "License"); you may not use this file except in compliance
010:         * with the License.  You may obtain a copy of the License at
011:         *
012:         *   http://www.apache.org/licenses/LICENSE-2.0
013:         *
014:         * Unless required by applicable law or agreed to in writing,
015:         * software distributed under the License is distributed on an
016:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017:         * KIND, either express or implied.  See the License for the
018:         * specific language governing permissions and limitations
019:         * under the License.
020:         */
021:
022:        import java.util.Collections;
023:        import java.util.HashMap;
024:        import java.util.Map;
025:
026:        import org.apache.torque.om.BaseObject;
027:
028:        /**
029:         * This class represents a generic object used in the Access Control Lists.
030:         *
031:         * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
032:         * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
033:         * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
034:         * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
035:         *
036:         * @deprecated Use {@link org.apache.turbine.services.security.torque.TorqueSecurityService}
037:         * instead.
038:         *
039:         * @version $Id: SecurityObject.java 534527 2007-05-02 16:10:59Z tv $
040:         */
041:        public abstract class SecurityObject extends BaseObject implements 
042:                Comparable {
043:            /** The name of this object. */
044:            private String name;
045:
046:            /** The id of this object */
047:            private int id;
048:
049:            /** The attributes of this object. */
050:            private Map attributes;
051:
052:            /**
053:             * Constructs a new SecurityObject
054:             */
055:            public SecurityObject() {
056:                this ("");
057:            }
058:
059:            /**
060:             * Constructs a new SecurityObject with the specified name.
061:             *
062:             * @param name The name of the new object.
063:             */
064:            public SecurityObject(String name) {
065:                setName(name);
066:                setId(0);
067:                setAttributes(Collections.synchronizedMap(new HashMap()));
068:            }
069:
070:            /**
071:             * Returns a Map containing this object's attributes.
072:             *
073:             * @return the object's attributes.
074:             */
075:            public Map getAttributes() {
076:                return attributes;
077:            }
078:
079:            /**
080:             * Replaces this object's attributes with the specified Map.
081:             *
082:             * @param attributes The new attributes of the object.
083:             */
084:            public void setAttributes(Map attributes) {
085:                this .attributes = attributes;
086:            }
087:
088:            /**
089:             * Retrieves the value of specific attribute of this object.
090:             *
091:             * @param name the name of the attribute
092:             * @return the value of the attribute
093:             */
094:            public Object getAttribute(String name) {
095:                return attributes.get(name);
096:            }
097:
098:            /**
099:             * Sets the value of specific attribute of this object.
100:             *
101:             * @param name the name of the attribute
102:             * @param value the value of the attribute
103:             */
104:            public void setAttribute(String name, Object value) {
105:                attributes.put(name, value);
106:            }
107:
108:            /**
109:             * Returns the name of this object.
110:             *
111:             * @return The name of the object.
112:             */
113:            public String getName() {
114:                return name;
115:            }
116:
117:            /**
118:             * Sets the name of this object.
119:             *
120:             * @param name The name of the object.
121:             */
122:            public void setName(String name) {
123:                this .name = name;
124:            }
125:
126:            /**
127:             * Unused. There is an ID column in the
128:             * database scheme but it doesn't seem
129:             * to be used.
130:             *
131:             * @return 0
132:             */
133:            public int getId() {
134:                return id;
135:            }
136:
137:            /**
138:             * Unused. There is an ID column in the
139:             * database scheme but it doesn't seem
140:             * to be used.
141:             *
142:             * @return null
143:             */
144:            public Integer getIdAsObj() {
145:                return new Integer(id);
146:            }
147:
148:            /**
149:             * Unused. There is an ID column in the
150:             * database scheme but it doesn't seem
151:             * to be used.
152:             *
153:             * @param id The id of the User.
154:             */
155:            public void setId(int id) {
156:                this .id = id;
157:            }
158:
159:            /**
160:             * Used for ordering SecurityObjects.
161:             *
162:             * @param obj The Object to compare to.
163:             * @return -1 if the name of the other object is lexically greater than this
164:             *         group, 1 if it is lexically lesser, 0 if they are equal.
165:             */
166:            public int compareTo(Object obj) {
167:                if (this .getClass() != obj.getClass()) {
168:                    throw new ClassCastException();
169:                }
170:                String name1 = ((SecurityObject) obj).getName();
171:                String name2 = this .getName();
172:
173:                return name2.compareTo(name1);
174:            }
175:
176:            /**
177:             * Returns a textual representation of this object, consisted by
178:             * it's name and attributes.
179:             *
180:             * @return  a textual representation of this group.
181:             */
182:            public String toString() {
183:                return (getName() + ':' + getAttributes().toString());
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.