Source Code Cross Referenced for TableEvent.java in  » Net » snmp4j » org » snmp4j » util » 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 » Net » snmp4j » org.snmp4j.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*_############################################################################
002:          _## 
003:          _##  SNMP4J - TableEvent.java  
004:          _## 
005:          _##  Copyright (C) 2003-2008  Frank Fock and Jochen Katz (SNMP4J.org)
006:          _##  
007:          _##  Licensed under the Apache License, Version 2.0 (the "License");
008:          _##  you may not use this file except in compliance with the License.
009:          _##  You may obtain a copy of the License at
010:          _##  
011:          _##      http://www.apache.org/licenses/LICENSE-2.0
012:          _##  
013:          _##  Unless required by applicable law or agreed to in writing, software
014:          _##  distributed under the License is distributed on an "AS IS" BASIS,
015:          _##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016:          _##  See the License for the specific language governing permissions and
017:          _##  limitations under the License.
018:          _##  
019:          _##########################################################################*/
020:
021:        package org.snmp4j.util;
022:
023:        import org.snmp4j.smi.OID;
024:        import org.snmp4j.smi.VariableBinding;
025:        import org.snmp4j.PDU;
026:        import java.util.Arrays;
027:
028:        /**
029:         * The <code>TableEvent</code> class reports events in a table retrieval
030:         * operation.
031:         *
032:         * @author Frank Fock
033:         * @version 1.8
034:         * @since 1.0.2
035:         * @see TableUtils
036:         */
037:        public class TableEvent extends RetrievalEvent {
038:
039:            private static final long serialVersionUID = 3340523737695933621L;
040:
041:            private OID index;
042:
043:            protected TableEvent(Object source, Object userObject) {
044:                super (source, userObject);
045:                this .userObject = userObject;
046:            }
047:
048:            /**
049:             * Creates a table event with a status.
050:             * @param source
051:             *    the source of the event.
052:             * @param userObject
053:             *    the user object or <code>null</code>.
054:             * @param status
055:             *    one of the status constants defined for this object.
056:             */
057:            public TableEvent(Object source, Object userObject, int status) {
058:                this (source, userObject);
059:                this .status = status;
060:            }
061:
062:            /**
063:             * Creates a table event with an exception.
064:             * @param source
065:             *    the source of the event.
066:             * @param userObject
067:             *    the user object or <code>null</code>.
068:             * @param exception
069:             *    an exception instance.
070:             */
071:            public TableEvent(Object source, Object userObject,
072:                    Exception exception) {
073:                this (source, userObject);
074:                this .exception = exception;
075:                this .status = STATUS_EXCEPTION;
076:            }
077:
078:            /**
079:             * Creates a table event with a report PDU.
080:             * @param source
081:             *    the source of the event.
082:             * @param userObject
083:             *    the user object or <code>null</code>.
084:             * @param report
085:             *    a PDU of type {@link PDU#REPORT}.
086:             */
087:            public TableEvent(Object source, Object userObject, PDU report) {
088:                this (source, userObject);
089:                this .reportPDU = report;
090:                this .status = STATUS_REPORT;
091:            }
092:
093:            /**
094:             * Creates a table event with row data.
095:             *
096:             * @param source
097:             *    the source of the event.
098:             * @param userObject
099:             *    the user object or <code>null</code>.
100:             * @param index
101:             *    the index OID of the row.
102:             * @param cols
103:             *    an array of <code>VariableBinding</code> instances containing the
104:             *    elements of the row. The array may contain <code>null</code> elements
105:             *    which indicates that the agent does not return an instance for that
106:             *    column and row index. If an element is not <code>null</code>, then
107:             *    the <code>OID</code> of the variable binding contains the full instance
108:             *    <code>OID</code> of the variable.
109:             */
110:            public TableEvent(Object source, Object userObject, OID index,
111:                    VariableBinding[] cols) {
112:                super (source, userObject, cols);
113:                this .index = index;
114:            }
115:
116:            /**
117:             * Gets the row index OID.
118:             * @return
119:             *    the row's index OID or <code>null</code> if {@link #isError()} returns
120:             *    <code>true</code>.
121:             */
122:            public OID getIndex() {
123:                return index;
124:            }
125:
126:            /**
127:             * Gets the columnar objects of the row.
128:             * @return
129:             *    an array of <code>VariableBinding</code> instances containing the
130:             *    elements of the row. The array may contain <code>null</code> elements
131:             *    which indicates that the agent does not return an instance for that
132:             *    column and row index. If an element is not <code>null</code>, then
133:             *    the <code>OID</code> of the variable binding contains the full instance
134:             *    <code>OID</code> of the variable.<p>
135:             *    If {@link #isError()} returns <code>true</code>, <code>null</code>
136:             *    will be returned.
137:             */
138:            public VariableBinding[] getColumns() {
139:                return vbs;
140:            }
141:
142:            public String toString() {
143:                return getClass().getName() + "[index=" + index + ",vbs="
144:                        + ((vbs == null) ? "null" : "" + Arrays.asList(vbs))
145:                        + ",status=" + status + ",exception=" + exception
146:                        + ",report=" + reportPDU + "]";
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.