Source Code Cross Referenced for SshChannel.java in  » Net » ssh-web-proxy » com » ericdaugherty » sshwebproxy » 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 » ssh web proxy » com.ericdaugherty.sshwebproxy 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************************
002:         * $Source: /cvsroot/sshwebproxy/src/java/com/ericdaugherty/sshwebproxy/SshChannel.java,v $
003:         * $Revision: 1.2 $
004:         * $Author: edaugherty $
005:         * $Date: 2003/11/23 00:18:10 $
006:         ******************************************************************************
007:         * Copyright (c) 2003, Eric Daugherty (http://www.ericdaugherty.com)
008:         * All rights reserved.
009:         *
010:         * Redistribution and use in source and binary forms, with or without
011:         * modification, are permitted provided that the following conditions are met:
012:         *
013:         *     * Redistributions of source code must retain the above copyright notice,
014:         *       this list of conditions and the following disclaimer.
015:         *     * Redistributions in binary form must reproduce the above copyright
016:         *       notice, this list of conditions and the following disclaimer in the
017:         *       documentation and/or other materials provided with the distribution.
018:         *     * Neither the name of the Eric Daugherty nor the names of its
019:         *       contributors may be used to endorse or promote products derived
020:         *       from this software without specific prior written permission.
021:         *
022:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
023:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
024:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
025:         * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
026:         * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
027:         * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
028:         * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
029:         * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
030:         * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
031:         * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
032:         * THE POSSIBILITY OF SUCH DAMAGE.
033:         * *****************************************************************************
034:         * For current versions and more information, please visit:
035:         * http://www.ericdaugherty.com/dev/sshwebproxy
036:         *
037:         * or contact the author at:
038:         * web@ericdaugherty.com
039:         *****************************************************************************/package com.ericdaugherty.sshwebproxy;
040:
041:        /**
042:         * Provides a base class for all Ssh Channels.
043:         *
044:         * @author Eric Daugherty
045:         */
046:        public abstract class SshChannel {
047:
048:            //***************************************************************
049:            // Variables
050:            //***************************************************************
051:
052:            /** The type of channel, Shell, SCP, etc */
053:            private String channelType;
054:
055:            /** The unique id of this ShellChannel */
056:            private String channelId;
057:
058:            /** The SshConnection this channel is using */
059:            protected SshConnection sshConnection;
060:
061:            //***************************************************************
062:            // Constructor
063:            //***************************************************************
064:
065:            /**
066:             * Create a new SshChannel of the specified type.
067:             *
068:             * @param channelType the type of channel.
069:             * @param sshConnection the connection to the SSH Server.
070:             */
071:            public SshChannel(String channelType, SshConnection sshConnection) {
072:                this .channelType = channelType;
073:                this .sshConnection = sshConnection;
074:            }
075:
076:            //***************************************************************
077:            // Abstract Methods
078:            //***************************************************************
079:
080:            /**
081:             * Close the SessionChannelClient and all internal
082:             * streams.  This should only be called by the SshConnection
083:             * class and never directly called by a SshChannel implementation.
084:             * Channels should call SshConnection.closeChannel( this ) to close
085:             * itself.
086:             */
087:            public abstract void close();
088:
089:            /**
090:             * Indicates whether this connection is still active.
091:             *
092:             * @return true if this connection is still active.
093:             */
094:            public abstract boolean isConnected();
095:
096:            /**
097:             * Returns the page that should be used to display this Channel.
098:             *
099:             * @return URL of the page used to display this channel.
100:             */
101:            public abstract String getPage();
102:
103:            //***************************************************************
104:            // Parameter Access Methods
105:            //***************************************************************
106:
107:            /** The type of channel, Shell, SCP, etc */
108:            public String getChannelType() {
109:                return channelType;
110:            }
111:
112:            /**
113:             * The unique ID of this connection
114:             *
115:             * @return
116:             */
117:            public String getChannelId() {
118:                return channelId;
119:            }
120:
121:            /**
122:             * The unique ID of this connection
123:             *
124:             * @param channelId
125:             */
126:            protected void setChannelId(String channelId) {
127:                this .channelId = channelId;
128:            }
129:
130:            //***************************************************************
131:            // Public methods
132:            //***************************************************************
133:
134:            /**
135:             * Replaces any HTML control characters with their escaped value.
136:             *
137:             * @param data the string to check
138:             * @return the encoded string.
139:             */
140:            public String encodeHTML(String data) {
141:                // Replace HTML Characters
142:                data = data.replaceAll("<", "&lt;");
143:                data = data.replaceAll(">", "&gt;");
144:
145:                return data;
146:            }
147:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.