Source Code Cross Referenced for SshMsgChannelOpenConfirmation.java in  » Net » j2ssh » com » sshtools » j2ssh » connection » 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 » j2ssh » com.sshtools.j2ssh.connection 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  SSHTools - Java SSH2 API
003:         *
004:         *  Copyright (C) 2002-2003 Lee David Painter and Contributors.
005:         *
006:         *  Contributions made by:
007:         *
008:         *  Brett Smith
009:         *  Richard Pernavas
010:         *  Erwin Bolwidt
011:         *
012:         *  This program is free software; you can redistribute it and/or
013:         *  modify it under the terms of the GNU General Public License
014:         *  as published by the Free Software Foundation; either version 2
015:         *  of the License, or (at your option) any later version.
016:         *
017:         *  This program is distributed in the hope that it will be useful,
018:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
019:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
020:         *  GNU General Public License for more details.
021:         *
022:         *  You should have received a copy of the GNU General Public License
023:         *  along with this program; if not, write to the Free Software
024:         *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
025:         */
026:        package com.sshtools.j2ssh.connection;
027:
028:        import com.sshtools.j2ssh.io.ByteArrayReader;
029:        import com.sshtools.j2ssh.io.ByteArrayWriter;
030:        import com.sshtools.j2ssh.transport.InvalidMessageException;
031:        import com.sshtools.j2ssh.transport.SshMessage;
032:
033:        import java.io.IOException;
034:
035:        /**
036:         *
037:         *
038:         * @author $author$
039:         * @version $Revision: 1.20 $
040:         */
041:        public class SshMsgChannelOpenConfirmation extends SshMessage {
042:            /**  */
043:            protected final static int SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91;
044:            private byte[] channelData;
045:            private long initialWindowSize;
046:            private long maximumPacketSize;
047:            private long recipientChannel;
048:            private long senderChannel;
049:
050:            /**
051:             * Creates a new SshMsgChannelOpenConfirmation object.
052:             *
053:             * @param recipientChannel
054:             * @param senderChannel
055:             * @param initialWindowSize
056:             * @param maximumPacketSize
057:             * @param channelData
058:             */
059:            public SshMsgChannelOpenConfirmation(long recipientChannel,
060:                    long senderChannel, long initialWindowSize,
061:                    long maximumPacketSize, byte[] channelData) {
062:                super (SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
063:                this .recipientChannel = recipientChannel;
064:                this .senderChannel = senderChannel;
065:                this .initialWindowSize = initialWindowSize;
066:                this .maximumPacketSize = maximumPacketSize;
067:                this .channelData = channelData;
068:            }
069:
070:            /**
071:             * Creates a new SshMsgChannelOpenConfirmation object.
072:             */
073:            public SshMsgChannelOpenConfirmation() {
074:                super (SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
075:            }
076:
077:            /**
078:             *
079:             *
080:             * @return
081:             */
082:            public byte[] getChannelData() {
083:                return channelData;
084:            }
085:
086:            /**
087:             *
088:             *
089:             * @return
090:             */
091:            public long getInitialWindowSize() {
092:                return initialWindowSize;
093:            }
094:
095:            /**
096:             *
097:             *
098:             * @return
099:             */
100:            public long getMaximumPacketSize() {
101:                return maximumPacketSize;
102:            }
103:
104:            /**
105:             *
106:             *
107:             * @return
108:             */
109:            public String getMessageName() {
110:                return "SSH_MSG_CHANNEL_OPEN_CONFIRMATION";
111:            }
112:
113:            /**
114:             *
115:             *
116:             * @return
117:             */
118:            public long getRecipientChannel() {
119:                return recipientChannel;
120:            }
121:
122:            /**
123:             *
124:             *
125:             * @return
126:             */
127:            public long getSenderChannel() {
128:                return senderChannel;
129:            }
130:
131:            /**
132:             *
133:             *
134:             * @param baw
135:             *
136:             * @throws InvalidMessageException
137:             */
138:            protected void constructByteArray(ByteArrayWriter baw)
139:                    throws InvalidMessageException {
140:                try {
141:                    baw.writeInt(recipientChannel);
142:                    baw.writeInt(senderChannel);
143:                    baw.writeInt(initialWindowSize);
144:                    baw.writeInt(maximumPacketSize);
145:
146:                    if (channelData != null) {
147:                        baw.write(channelData);
148:                    }
149:                } catch (IOException ioe) {
150:                    throw new InvalidMessageException("Invalid message data");
151:                }
152:            }
153:
154:            /**
155:             *
156:             *
157:             * @param bar
158:             *
159:             * @throws InvalidMessageException
160:             */
161:            protected void constructMessage(ByteArrayReader bar)
162:                    throws InvalidMessageException {
163:                try {
164:                    recipientChannel = bar.readInt();
165:                    senderChannel = bar.readInt();
166:                    initialWindowSize = bar.readInt();
167:                    maximumPacketSize = bar.readInt();
168:
169:                    if (bar.available() > 0) {
170:                        channelData = new byte[bar.available()];
171:                        bar.read(channelData);
172:                    }
173:                } catch (IOException ioe) {
174:                    throw new InvalidMessageException("Invalid message data");
175:                }
176:            }
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.