Source Code Cross Referenced for ConsumerInfo.java in  » Groupware » Data-share » org » datashare » 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 
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: ConsumerInfo.java,v 1.2 2002/01/29 20:50:17 lizellaman Exp $
025:         * $Log: ConsumerInfo.java,v $
026:         * Revision 1.2  2002/01/29 20:50:17  lizellaman
027:         * Added LoggingInterface, modified the PropertiesInterface implementation
028:         *
029:         * Revision 1.1.1.1  2001/10/23 13:37:19  lizellaman
030:         * initial sourceforge release
031:         *
032:         */
033:
034:        package org.datashare;
035:
036:        import org.datashare.objects.DataShareConnectionDescriptor;
037:        import org.datashare.objects.DefaultObjectInfo;
038:        import java.util.Date;
039:        import java.net.InetAddress;
040:
041:        /**
042:         * Holds information about a Consumer.
043:         * For a consumer, the active boolean value represents whether or not the
044:         * channel a consumer is in has been activated (so the server will send real-time data to it)
045:         *
046:         * @date March 01, 2001
047:         * @author Charles Wood
048:         * @version 1.0
049:         */
050:        public class ConsumerInfo extends DefaultObjectInfo implements 
051:                PersistDataCallbackInterface {
052:            /**
053:             * the ClientInfo for this Consumer
054:             */
055:            protected ClientInfo clientInfo = null;
056:
057:            /**
058:             * the Session this Consumer is in
059:             */
060:            protected SessionInfo sessionInfo = null;
061:
062:            /**
063:             * The channel this Consumer is in
064:             */
065:            protected ChannelInfo channelInfo = null;
066:
067:            /**
068:             * Class constructor, should not be used because it leaves attributes with null values
069:             * and there are no methods to populate them.
070:             */
071:            private ConsumerInfo() {
072:                originalType = CONSUMERTYPE;
073:            }
074:
075:            /**
076:             * Class constructor
077:             *
078:             */
079:            public ConsumerInfo(ClientInfo clientInfo, SessionInfo sessionInfo,
080:                    ChannelInfo channelInfo) {
081:                this (); // set the type of DefaultObject and creation time
082:                name = clientInfo.getName();
083:                toString = clientInfo.getKeyValue();
084:                this .keyValue = clientInfo.getKeyValue();
085:                this .parentKeyValue = channelInfo.getKeyValue(); // consumer's channel
086:                this .grandparentKeyValue = sessionInfo.getKeyValue(); // session channel is in
087:                this .clientInfo = clientInfo;
088:                this .sessionInfo = sessionInfo;
089:                this .channelInfo = channelInfo;
090:                this .clientRealName = clientInfo.getClientRealName();
091:                this .clientClass = clientInfo.getClientClass();
092:            }
093:
094:            /**
095:             * Retrieves a string containing 'Consumer'.
096:             *
097:             * @return fixed value of 'Consumer' for all instances
098:             */
099:            public String getType() {
100:                return CONSUMERTYPE;
101:            }
102:
103:            /**
104:             * Retrieves a description of this instance.
105:             *
106:             * @return client info
107:             */
108:            public String getInfo() {
109:                return this .clientInfo.getInfo()
110:                        + "<tr><td>Joined function</td><td>"
111:                        + this .date.toString()
112:                        + "</td></tr><tr><td>Consumer activity</td><td>"
113:                        + (this .getActive() ? "Active" : "Inactive")
114:                        + "</td></tr>";
115:            }
116:
117:            /**
118:             * the value to use for the key for this instance in the Hashtable of
119:             * the Channel's ConsumerInfo instances
120:             *
121:             */
122:            public String getKeyValue() {
123:                return clientInfo.getKeyValue(); // this will be unique within our Channel
124:            }
125:
126:            /**
127:             * Sets the ADSKey String for this instance to the provided parameter value.
128:             * The ADSKey String is the value provided when the EJB was created for this instance.
129:             *
130:             * @param ak the value to save as the ID for this instance
131:             */
132:            public void setDatabaseID(String /* ADSKey */ak) {
133:                SessionUtilities.getLoggingInterface().debugMsg(
134:                        SessionUtilities.getLoggingInterface().DEBUG,
135:                        SessionUtilities.getLoggingInterface().DATABASE,
136:                        "setDatabaseID(): EJB Key for " + this .getKeyValue()
137:                                + " has value of " + ak);
138:                databaseID = ak;
139:                waitingForKey = false;
140:                keyHasBeenReturned = true;
141:            }
142:
143:            /**
144:             * Retrieves the ADSKey String for this instance.  Should always be checked for null.
145:             * Also realize that this method may block until the ADSKey value is available.
146:             *
147:             * @return the ADSKey String that was previously set for this instance.
148:             */
149:            public String /* ADSKey */
150:            getDatabaseID() {
151:                String this Key = null;
152:                if (this .clientInfo.saveData) {
153:                    if (databaseID != null)
154:                        this Key = databaseID;
155:                    else
156:                        this Key = retrieveEJB();
157:                }
158:                return this Key;
159:            }
160:
161:            /**
162:             * used to return the ClientInfo that corresponds to this Consumer
163:             */
164:            public ClientInfo getClientInfo() {
165:                return this.clientInfo;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.