Source Code Cross Referenced for Operation.java in  » Database-ORM » MMBase » org » mmbase » 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 » Database ORM » MMBase » org.mmbase.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:        package org.mmbase.security;
011:
012:        /**
013:         * This class is a kind of enumeration (introduced before java 1.5 enumerations) of the operations
014:         * possible within the security authorization.
015:         * @author Eduard Witteveen
016:         * @version $Id: Operation.java,v 1.13 2007/12/06 08:08:13 michiel Exp $
017:         * @see Authorization
018:         */
019:        public final class Operation {
020:            /** int value for the read Operation*/
021:            public final static int READ_INT = 0;
022:
023:            /** int value for the write Operation*/
024:            public final static int WRITE_INT = 1;
025:
026:            /** int value for the create Operation*/
027:            public final static int CREATE_INT = 2;
028:
029:            /** int value for the change relation Operation */
030:            public final static int CHANGE_RELATION_INT = 3;
031:
032:            /** int value for the remove Operation */
033:            public final static int DELETE_INT = 4;
034:
035:            /**
036:             * int value for change context operation
037:             * @since MMBase-1.7
038:             */
039:            public final static int CHANGE_CONTEXT_INT = 6;
040:
041:            /**
042:             * @deprecated use CHANGE_CONTEXT_INT
043:             */
044:            public final static int CHANGECONTEXT_INT = CHANGE_CONTEXT_INT;
045:
046:            /** 
047:             * A 'read' operation is acquiring an MMBase Node. We have no field-level granularity for the
048:             * authorization. Having a {@link org.mmbase.bridge.Node} means that you 
049:             */
050:            public final static Operation READ = new Operation(READ_INT, "read");
051:
052:            /**
053:             * {@link Node#setValue} is an example of a write-operation.
054:             */
055:            public final static Operation WRITE = new Operation(WRITE_INT,
056:                    "write");
057:
058:            /**
059:             *	Identifier for create operation, which is used for creating a new node.
060:             *	This only applies on NodeManagers (builders)
061:             */
062:            public final static Operation CREATE = new Operation(CREATE_INT,
063:                    "create");
064:
065:            /**
066:             * Identifier for changing the source and/or destination field of a
067:             * relation.
068:             */
069:            public final static Operation CHANGE_RELATION = new Operation(
070:                    CHANGE_RELATION_INT, "change relation");
071:
072:            /** 
073:             *Identifier for remove operation, which is used when removing a node */
074:            public final static Operation DELETE = new Operation(DELETE_INT,
075:                    "delete");
076:
077:            /** 
078:             * Identifier for change context operation, which is used when changing the context of a node 
079:             * @since MMBase-1.7
080:             */
081:            public final static Operation CHANGE_CONTEXT = new Operation(
082:                    CHANGE_CONTEXT_INT, "change context");
083:
084:            /** 
085:             * Identifier for change context operation, which is used when changing the context of a node 
086:             * @deprecated Use CHANGE_CONTEXT
087:             */
088:            public final static Operation CHANGECONTEXT = CHANGE_CONTEXT;
089:
090:            /**
091:             *	Private constructor, to prevent creation of new Operations
092:             */
093:            private Operation(int level, String description) {
094:                this .level = level;
095:                this .description = description;
096:            }
097:
098:            /**
099:             *	This method gives back the internal int value of the Operation,
100:             *	which can be used in switch statements
101:             *	@return the internal int value
102:             */
103:            public int getInt() {
104:                return level;
105:            }
106:
107:            /**
108:             *	@return a string containing the description of the operation
109:             */
110:            public String toString() {
111:                return description;
112:            }
113:
114:            /**
115:             * the int value of the instance
116:             */
117:            private final int level;
118:
119:            /**
120:             * the description of this operation
121:             */
122:            private final String description;
123:
124:            /** retrieve a Operation by a given string */
125:            public static Operation getOperation(String operationString) {
126:                if (READ.toString().equals(operationString))
127:                    return READ;
128:                if (WRITE.toString().equals(operationString))
129:                    return WRITE;
130:                if (CREATE.toString().equals(operationString))
131:                    return CREATE;
132:                if (CHANGE_RELATION.toString().equals(operationString))
133:                    return CHANGE_RELATION;
134:                if (DELETE.toString().equals(operationString))
135:                    return DELETE;
136:                if (CHANGE_CONTEXT.toString().equals(operationString))
137:                    return CHANGE_CONTEXT;
138:                throw new org.mmbase.security.SecurityException(
139:                        "Could not find a operation for the operation with name:"
140:                                + operationString);
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.