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


001:        /*
002:         * This software is OSI Certified Open Source Software.
003:         * OSI Certified is a certification mark of the Open Source Initiative. The
004:         * license (Mozilla version 1.0) can be read at the MMBase site. See
005:         * http://www.MMBase.org/license
006:         */
007:        package org.mmbase.core.event;
008:
009:        import java.io.Serializable;
010:        import org.mmbase.util.HashCodeUtil;
011:
012:        /**
013:         * This class reflects a ,,change relation event. it contains information about the kind of event (new, delete, change),
014:         * and it contains a reference to the appropriate typerel node, which allows you to find out on which relation from
015:         * which builder to which builder, the event occered. This is usefull for caching optimization.<br/> A relation changed
016:         * event is called the twoo nodes that the relation links (or used to).
017:         * 
018:         * @author Ernst Bunders
019:         * @since MMBase-1.8
020:         * @version $Id: RelationEvent.java,v 1.21 2007/07/26 11:45:54 michiel Exp $
021:         */
022:        public class RelationEvent extends Event implements  Serializable,
023:                Cloneable {
024:
025:            /**
026:             * 
027:             */
028:            private static final long serialVersionUID = 1L;
029:
030:            private final int relationSourceNumber;
031:            private final int relationDestinationNumber;
032:            private final String relationSourceType;
033:            private final String relationDestinationType;
034:
035:            private final int role; // the reldef node number
036:
037:            private final NodeEvent nodeEvent;
038:
039:            /**
040:             * Constructor for relation event
041:             * 
042:             * @param nodeEvent
043:             * @param relationSourceNumber the nodenumber of the 'soucre' node
044:             * @param relationDestinationNumber the nodenumber of the 'destination' node
045:             * @param relationSourceType the builder name of the 'source' node
046:             * @param relationDestinationType the builder name of the 'destination' node
047:             * @param role the nodenumber of the reldef node
048:             */
049:            public RelationEvent(NodeEvent nodeEvent, int relationSourceNumber,
050:                    int relationDestinationNumber, String relationSourceType,
051:                    String relationDestinationType, int role) {
052:                super (nodeEvent.getMachine(), nodeEvent.getType());
053:                this .nodeEvent = nodeEvent;
054:                this .relationSourceNumber = relationSourceNumber;
055:                this .relationDestinationNumber = relationDestinationNumber;
056:                this .relationSourceType = relationSourceType;
057:                this .relationDestinationType = relationDestinationType;
058:                this .role = role;
059:            }
060:
061:            /**
062:             * @return Returns the relationSourceType.
063:             */
064:            public String getRelationSourceType() {
065:                return relationSourceType;
066:            }
067:
068:            /**
069:             * @return Returns the relationDestinationType.
070:             */
071:            public String getRelationDestinationType() {
072:                return relationDestinationType;
073:            }
074:
075:            /**
076:             * @return Returns the relationSourceNumber.
077:             */
078:            public int getRelationSourceNumber() {
079:                return relationSourceNumber;
080:            }
081:
082:            /**
083:             * @return Returns the relationDestinationNumber.
084:             */
085:            public int getRelationDestinationNumber() {
086:                return relationDestinationNumber;
087:            }
088:
089:            public int getType() {
090:                return eventType;
091:            }
092:
093:            /**
094:             * @return the role number
095:             */
096:            public int getRole() {
097:                return role;
098:            }
099:
100:            public int hashCode() {
101:                int result = nodeEvent.hashCode();
102:                result = HashCodeUtil.hashCode(result, relationSourceNumber);
103:                result = HashCodeUtil.hashCode(result,
104:                        relationDestinationNumber);
105:                result = HashCodeUtil.hashCode(result, relationSourceType);
106:                result = HashCodeUtil.hashCode(result, relationDestinationType);
107:                result = HashCodeUtil.hashCode(result, role);
108:                result = HashCodeUtil.hashCode(result, eventType);
109:                return result;
110:            }
111:
112:            public boolean equals(Object o) {
113:                if (o instanceof  RelationEvent) {
114:                    RelationEvent re = (RelationEvent) o;
115:                    return nodeEvent.equals(re.nodeEvent)
116:                            && eventType == re.eventType
117:                            && role == re.role
118:                            && relationSourceType.equals(re.relationSourceType)
119:                            && relationDestinationType
120:                                    .equals(re.relationDestinationType)
121:                            && relationSourceNumber == re.relationSourceNumber
122:                            && relationDestinationNumber == re.relationDestinationNumber;
123:                } else {
124:                    return false;
125:                }
126:            }
127:
128:            public NodeEvent getNodeEvent() {
129:                return nodeEvent;
130:            }
131:
132:            public String toString() {
133:                return "Relation event. type: "
134:                        + NodeEvent.getEventTypeGuiName(getType())
135:                        + ", sourcetype: " + relationSourceType
136:                        + ", destinationtype: " + relationDestinationType
137:                        + ", source-node number: " + relationSourceNumber
138:                        + ", destination-node number: "
139:                        + relationDestinationNumber + ", role: " + role
140:                        + " node event: " + nodeEvent;
141:            }
142:
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.