Source Code Cross Referenced for DataShareObject.java in  » Groupware » Data-share » org » datashare » objects » 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 » Groupware » Data share » org.datashare.objects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ----- BEGIN LICENSE BLOCK -----
002:         * Version: MPL 1.1
003:         *
004:         * The contents of this file are subject to the Mozilla Public License Version
005:         * 1.1 (the "License"); you may not use this file except in compliance with
006:         * the License. You may obtain a copy of the License at
007:         * http://www.mozilla.org/MPL/
008:         *
009:         * Software distributed under the License is distributed on an "AS IS" basis,
010:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011:         * for the specific language governing rights and limitations under the
012:         * License.
013:         *
014:         * The Original Code is the DataShare server.
015:         *
016:         * The Initial Developer of the Original Code is
017:         * Ball Aerospace & Technologies Corp, Fairborn, Ohio
018:         * Portions created by the Initial Developer are Copyright (C) 2001
019:         * the Initial Developer. All Rights Reserved.
020:         *
021:         * Contributor(s): Charles Wood <cwood@ball.com>
022:         *
023:         * ----- END LICENSE BLOCK ----- */
024:        /* RCS $Id: DataShareObject.java,v 1.3 2002/02/20 14:16:59 lizellaman Exp $
025:         * $Log: DataShareObject.java,v $
026:         * Revision 1.3  2002/02/20 14:16:59  lizellaman
027:         * changes to improve history retrieval
028:         *
029:         * Revision 1.2  2002/01/20 23:33:22  lizellaman
030:         * add new 'keepalive' packets for if/when DataShare server decides that a connection has been idle too long
031:         *
032:         * Revision 1.1.1.1  2001/10/23 13:37:20  lizellaman
033:         * initial sourceforge release
034:         *
035:         */
036:
037:        package org.datashare.objects;
038:
039:        import java.util.Date;
040:
041:        /** 
042:         * This is the DataShare data object (as a byte array) that is sent between clients/server (ONLY DataShareObjects
043:         * are sent between clients and the DataShareServer).  It contains info about who the object should be sent to
044:         * ('sendToOthers', 'sendToAll', 'sendToClient'- includes a client), but is is only applicable to data channels.  This object
045:         *  can be 
046:         * sent over the Data or CommandStatus Channels of the DataShare server and clients.
047:         */
048:        public class DataShareObject implements  java.io.Serializable {
049:            /** 
050:             * this allows us to serialize this class without 'marshalling' errors.
051:             */
052:            static final long serialVersionUID = 9030536576476457607L;
053:
054:            public int type;
055:            public static final int SENDTOOTHERS = 0;
056:            public static final int SENDTOALL = 1;
057:            public static final int SENDTOCLIENT = 2;
058:            public static final int KEEPALIVE = 9999; // sent by server to clients when TCPSocketTimeout is used and the read has timed out
059:
060:            /** 
061:             * when this instance was created
062:             */
063:            private Date date;
064:
065:            /** 
066:             * the object that is to sent on to clients (the real data of the object)
067:             */
068:            public byte[] objectBytes = null;
069:
070:            /** 
071:             * the client that is sending the data
072:             */
073:            public String sendingClientKey = null;
074:
075:            /** 
076:             * necessary only with SENDTOCLIENT,indicates which client to send data to
077:             */
078:            public String destinationClientKey = null;
079:
080:            /** 
081:             * set only when this instance is used to pass control information in a Data channel,
082:             * such as when this instance contains a RequestHistory object or an ActivateConnectionObject.
083:             */
084:            public boolean isControlObject = false;
085:
086:            /** 
087:             * set only when this instance is retreived from the history of a channel,
088:             * and not when the data has just been generated by an active client
089:             */
090:            public boolean isFromHistory = false;
091:
092:            /** 
093:             * constructor, used to insert creation time for this instance, do not use for DataShareObjects
094:             * used to provide real data
095:             */
096:            public DataShareObject() {
097:                date = new Date(); // new GregorianCalendar().getTime();
098:                type = KEEPALIVE;
099:            }
100:
101:            /** 
102:             * Constructor, used when creating an object that is going to one specific client
103:             */
104:            public DataShareObject(byte[] objectBytes,
105:            //int sendToClientType,
106:                    String sendingClientKey, String destinationClientKey) {
107:                this (); // makes it clear what is happening
108:                this .objectBytes = objectBytes;
109:                this .type = this .SENDTOCLIENT; // should be SENDTOCLIENT, etc.
110:                this .sendingClientKey = sendingClientKey;
111:                this .destinationClientKey = destinationClientKey;
112:            }
113:
114:            /** 
115:             * Constructor, used when creating an object that is going to all or others
116:             */
117:            public DataShareObject(byte[] objectBytes, int type,
118:                    String sendingClientKey) {
119:                this (); // makes it clear what is happening
120:                this .objectBytes = objectBytes;
121:                this .type = type; // should be SENDTOOTHERS or SENDTOALL
122:                this .sendingClientKey = sendingClientKey;
123:            }
124:
125:            /** 
126:             * returns the creation date for this instance
127:             */
128:            public Date getCreationDate() {
129:                return date;
130:            }
131:
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.